Door Security Using Magnetic Reed Switch
DOOR SECURITY MONITOR SWITCHES
Using a magnetic reed switch to the edge of the door and door frame which changes states when the door is opened or closed. This device increases the level of security mainly in industries as it is very important safety feature. This could even be used in our day-to-day lives in our workplaces and homes.
What is the use of magnetic reed switch in these devices?
The magnetic reed switch is typically installed on the door frame and the magnet that activates the switch is usually installed on the door. The device is introduced to a magnetic field, the two ferrous materials inside the switch come together and the switch closes and circuit is complete, thus the magnetic field is removed, the reeds separate and the switch opens.
Magnetic Reed Switch
Green LED – Buy
Arduino Board – Buy
Two 220ohm Resistor
10K ohm resistor
const int reed = 2; // the number of the pushbutton pin
const int ledPin = 13; // the number of the LED pin
int reedState = 0; // variable for reading the pushbutton status
// initialize the LED pin as an output:
// initialize the pushbutton pin as an input:
// read the state of the pushbutton value:
reedState = digitalRead(reed);
// check if the reed switch is active
// if it is, the reedState is HIGH:
if (reedState == HIGH)
// turn LED on:
// turn LED off:
How does this device function?
When we expose the reed switch to a magnetic field, the green led glows which signifies that the door is closed. When the magnetic field is reduced, the red led glows (the door is open).