Skip to content
Motion

Magnetic Reed Switch Door/Window Sensor

Simple, reliable open/close detection for DIY alarms.

A reed switch is a simple electromechanical switch made of two ferromagnetic metal reeds sealed inside a glass tube. The reeds snap together to close the circuit whenever a magnet passes near them, and spring apart when the magnet moves away. With no power draw and no moving parts beyond the reeds themselves, it's the classic low-cost sensor for detecting whether a door or window is open or closed in DIY security systems, and for simple proximity or rotation-counting triggers.

Specifications

Switch typeNormally-open (NO) magnetic reed switch — normally-closed (NC) variants also exist
Operating voltagePassive component — rated for typical logic-level or low-voltage switching, commonly up to 100-200V depending on part
Switching current~0.5A max typical for small glass reed switches
Actuation distance~10-15mm typical, depends on magnet strength and reed sensitivity rating
Response timeSub-millisecond mechanical closure, effectively instantaneous for most microcontroller polling rates
InterfaceSimple digital I/O — read as a plain HIGH/LOW switch input with a pull-up or pull-down resistor
PackageOften sold pre-wired in a two-part door/window sensor housing with the matching magnet included

Pinout

PinNameDescription
1Lead 1One side of the switch contact — wire to a digital input pin
2Lead 2Other side of the switch contact — wire to GND (or VCC, depending on pull configuration)

Wire one lead to a digital input pin and the other to GND, then enable the microcontroller's internal pull-up resistor (INPUT_PULLUP) so the pin reads HIGH when open and LOW when the magnet closes the switch — this avoids needing an external resistor for a simple door/window sensor build.

Variants

Pick the pre-wired door/window sensor for a fast alarm-system build since the magnet spacing is already matched. Use a bare reed switch when embedding into a custom enclosure, and consider a Hall effect sensor instead if you need a fully solid-state, higher-cycle-life alternative.

VariantTemp rangeHum rangeAccuracyProtocolPrice
Door/window reed sensor (pre-wired pair)~$1-3
Bare glass reed switch~$0.20-1
Hall effect sensor~$0.50-2