Reed Switch
A reed switch is a magnetic-field switch sealed in a glass tube.
Part images
What it is
A reed switch is a magnetic-field switch sealed in a glass tube.
How students use it
Students use it for door/window sensors, magnet-triggered counters, hidden switches, and simple security-themed projects.
Pins and power
Two switch leads. Most small reed switches are non-polarized for basic low-voltage signal use.
Passive switch. Read it as a 3.3V-safe digital input with a pull-up or pull-down.
SunFounder explains that two overlapping metal reeds close when a magnetic field is strong enough and open again when the field weakens.
Voltage and safety
Use as a low-voltage signal switch only in ObsoleteHQ projects.
The glass body is fragile. Do not bend leads right at the glass seal, and power off before repositioning.
Module internals
Two ferromagnetic reeds, sealed glass tube, inert gas or vacuum, and two external leads.
Datasheet notes
SunFounder does not identify a manufacturer part number. Match the exact glass switch before relying on contact rating or operate/release distance.
Common libraries
No special library is needed. Use machine.Pin and debounce if the project counts transitions.
Common mistakes
Putting the magnet on the wrong side or too far away, breaking the glass tube, leaving the input floating, and expecting every magnet to trigger at the same distance.