Lisleapex Blog
Published © Apache-2.0

Reed Switch Controls Motor Rotation

How does the reed switch control the rotation of the motor?

BeginnerWork in progress2 hours65
Reed Switch Controls Motor Rotation

Things used in this project

Hardware components

1N4007 – High Voltage, High Current Rated Diode
1N4007 – High Voltage, High Current Rated Diode
×1
Resistor 10k ohm
Resistor 10k ohm
×1
Reed Switch, SPST-NO
Reed Switch, SPST-NO
×1
IRF520 MOSFET Transistor
×1
Gravity: Analog LM35 Temperature Sensor For Arduino
DFRobot Gravity: Analog LM35 Temperature Sensor For Arduino
×1
3D Magnetic Sensor 2Go
Infineon 3D Magnetic Sensor 2Go
×1
Fan Filter Assembly, Plastic
Fan Filter Assembly, Plastic
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Magnets, Button
Magnets, Button

Story

Read more

Schematics

Reed Switch Controls Motor Rotation

Code

Untitled file

Arduino
#define FAN_pin 9 //Motor interface

#define Magnetic_pin 5 //Reed switch interface

void setup() { //This function only runs once after power-on

  pinMode(Magnetic_pin,INPUT); //Set the reed switch interface to input state

}

void loop() { //This function runs in a loop

  if(digitalRead(Magnetic_pin) == LOW) { //When a magnet is close to the reed switch

  digitalWrite(FAN_pin,HIGH); //Motor rotation

  }

  else { //otherwise

  digitalWrite(FAN_pin,LOW); //Motor stops

  }

}

Credits

Lisleapex Blog
26 projects • 0 followers
Fast Delivery of High-Quality Electronic Components
Contact

Comments

Please log in or sign up to comment.