Introduction: Reed Switch With Arduino
Reed switch is used in many of the real-life applications such as magnetic door switch, laptops, smartphones etc. In this instructables, we will learn about Reed Switch and guide you, how to Interface a Reed Switch with Arduino.
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Things You Need
Step 2: Schmatics
To interface reed switch with Arduino we need to build a voltage divider circuit as shown in the figure below. Voltage 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.
Step 3: Code
Please copy the following code and upload it to the arduino Board :
int LED = 7;
int reed_switch = 4;
reed_status = digitalRead(reed_switch);
if (reed_status == 1)
Step 4: Reed Switch in Action
After connecting everything together and uploading the code to your arduino so whenever i put a magnet near to the reed switch it gets triggered and LED turns ON.