Magnetic Reed Switch Detector
A reed switch, a glass capsule with two metal blades, closes when you bring a magnet near and lights an LED. It detects the magnet without touching it.
Bill of materials
Everything you need to build it, with the reference you will see on the schematic.
| Qty | Part | Ref. |
|---|---|---|
| 1 | Reed switch (glass capsule that closes near a magnet) | SW1 |
| 1 | 470 Ω resistor (yellow-violet-brown) | R1 |
| 1 | red LED | D1 |
| 1 | 9 V battery with snap clip | BT1 |
| 1 | Small magnet (fridge or speaker magnet) | |
| 1 | Breadboard (400 tie-points or more) | |
| 2 | Jumper wires |
Missing parts? The kits recommended by Impeca Tech include almost all of them. See the kits
Schematic & wiring
On the left, the circuit diagram; on the right, the same circuit built on a breadboard. Both connect exactly the same things.
Wire it step by step
-
Place the components
- Reed switch SW1: one leg in 5f and the other in 9f (either way round). The glass is fragile: do not bend the legs right against the glass.
- 470 Ω resistor R1 (bands: yellow, violet, brown, gold): one leg in 9h and the other in 4h (either way round).
- red LED D1: the long leg (+, anode) in 4f and the short leg (−, cathode, flat side) in 3f.
-
Add the jumper wires
- Red wire: from 5j to the + (red) rail.
- Black wire: from 3j to the − (blue) rail.
-
Connect the battery
- Connect the 9 V battery to its clip: the clip’s red lead to the + (red) rail and the black one to the − (blue) rail. Do this last, once everything else is in place.
-
Test the circuit
- Without a magnet the LED should be off. Bring a magnet to the reed, within a centimetre or less and along the capsule: the LED lights. Move it away and it goes off. Turn the magnet: it works better when parallel to the capsule than when pointing a pole at it.
How to read the holes: the letter is the row and the number is the column of the breadboard (for example 7f). The red (+) and blue (−) rails are the two long lines along the edge.
How does it work?
- 1You bring the magnet close to the reed
- 2The magnetic field pulls the two blades together
- 3The circuit closes
- 4The LED lights up
The reed is a switch with no button: inside a glass capsule two flexible metal blades sit a small distance apart. A nearby magnet magnetizes them, they attract each other and touch, and the contact closes. Current then flows from the battery plus, through the reed and R1 (470 Ω), to the red LED: about 15 mA, with 1.92 V across the LED. When the magnet moves away the blades spring apart and the LED goes out. No transistor is needed: the reed directly handles the LED’s small current. The capsule is glass and its legs are fragile: do not bend them right next to the glass.
Testing & troubleshooting
What you should see
- Magnet next to the reed
- LED current≈ 15 mA
- Voltage across the LED≈ 1.92 V
Approximate values, calculated with typical parts. With real parts they can vary by 10 % or more.
If something does not work
The LED does not light with the magnet
Bring the magnet closer and hold it parallel to the reed; a weak magnet must almost touch it. Check the LED is the right way round (long leg towards the 470 Ω resistor) and that the two reed legs are in different rows of the breadboard.
The LED is always on
There is a magnet nearby (a speaker, a case clasp, a phone) or the two reed legs are in the same row and get joined. Keep magnets away and check how the legs are placed.
Want to automate this circuit with code?
Learn how to program sensors and custom schedules in our e-book “Arduino from Scratch”.