Reed Switch

Reed switch is basically an electrical switch which is operated when a magnetic field is brought near to it. It was invented by W. B. Ellwood in 1936 at bell laboratories. It is made up of two small metal pieces kept inside a glass tube under vacuum. In a typical reed switch two metal pieces will be made of a ferromagnetic material and covered with rhodium or ruthenium to give them long life. The switch will be activated when there is a presence of magnetic fieldaround the switch.





The glass enclosure of the two metal pieces protect them from dirt, dust and other particles. Reed switch can be operated in any environment such as environment where flammable gas is present or environment where corrosion would affect open switch contacts.

There are two types of reed switch.
Normally open reed switch
Normally closed reed switch

In normally open reed switch, switch is open in the absence of magnetic field and it is closed in the presence of magnetic field. Under the presence of magnetic field, two metal contacts inside the glass tube attract each other to make contact.

In normally closed reed switch, switch is closed in the absence of magnetic field and it is open in the presence of magnetic field.

Applications of Reed switch
  1. Used in telephone exchange
  2. In laptops to put the screen on sleep if the lid is closed
  3. Used in window and door sensors in burglar alarm system

Components Required

  1. Arduino Uno
  2. Reed switch
  3. Resistors
  4. LED
  5. Magnet
  6. Connecting wires


Arduino Reed Switch Circuit Diagram




To interface reed switch with Arduino we need to build a voltage divider circuit as shown in the figure below. Vo is +5V when the switch is open and 0V when the switch is closed. We are using a normally open reed switch in this project. Switch is closed in the presence of magnetic field and it is open in the absence of magnetic field.




Code
int LED = 7;
int reed_switch = 4;
int reed_status;

void setup ()
{
   pinMode (LED, OUTPUT);
   pinMode (reed_switch, INPUT);
}

void loop ()
{
   reed_status = digitalRead (reed_switch);
   if (reed_status == 1)
     digitalWrite (LED, LOW);
   else
     digitalWrite (LED, HIGH);
   delay (1000);
}

video

No comments

Theme images by Dizzo. Powered by Blogger.