Magnetic door sensors can establish if a door is open or closed and are commonly used in alarm systems to trigger the opening and closing of doors and windows.
Table of contents
Introduction to magnetic door sensors
Magnetic door sensors, also called reed switches, are sensors that use a magnet to establish whether a door is open or closed. They 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 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.
Limitations
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.
Conclusion
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 trigger switches for windows and doors in home automation projects.