Magnetic door sensors, also called reed switches, are sensors that use a magnet to establish whether a door is open or closed.
Table of contents
Introduction to magnetic door sensors
Magnetic door sensors are commonly used in alarm systems to trigger the opening and closing of doors and windows.
It consists of two parts encased in a plastic shell — a magnet and a sensor/switch.
In combination, it basically works by opening/closing a reed switch by using the magnet’s magnetic field. When the two parts are next to each other the switch is closed and when they are far apart the switch is open.
When mounted on a for example on a door or a window, the switch is open when the door or window is closed the switch is closed.
This can be used by an alarm system, or for example an Arduino microcontroller or Raspberry Pi, to monitor the activity and trigger an alarm when needed.
Sample uses & alternatives
Magnetic door sensors are mainly used for monitoring doors and windows for security purposes. It can also be used to monitor headcounts, e.g. how many times it was opened in a set period of time.
What makes magnetic door sensors so special?
These little sensors are readily available, easy to mount, easy-to-use and fairly cheap.
The current flowing through the switch can be used to signal a digital read pin on a microcontroller.
Because magnetic door sensors need to be mounted on doors and windows, choosing the correct placement and hiding the wires can sometimes be a bit tricky.
To get started with magnetic door sensors, you might need some of the following accessories.
We have tested most of these products ourselves. Other selection criteria include affordability, quality, availability and average user rating and popularity by other buyers.
Links will open in a new window. (Dead or old links can be reported in the comments section below.)
With their ease of use, price and availability, magnetic door sensors are fairly easy to incorporate into projects for example with Arduinos and Raspberry Pis.
They are great to be used as a trigger switch for windows and doors in home automation projects.