Magnetic door sensors

Introducing Magnetic door sensors
Published: by Renier Delport

This post introduces Magnetic door sensors, also called reed switches, that are commonly used in alarm systems to trigger movement of the objects (e.g. doors and windows) it is mounted too. It will be updated from time to time when I stumble upon more relevant information. If you stumbled upon more relevant information, see mistakes or doesn’t understand anything, please feel free to comment at the end.

Magnetic door sensor on a door
Magnetic door sensor mounted on a door. Image from

What is a Magnetic door sensor?

A Magnetic door sensor is an alarm sensor that is triggered by movement. 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 field – opening the switch when the two parts are in close proximity and closing when far apart.

Basics of a reed switch
Basics of a reed switch.

When mounted on a for example on a door, the switch is open when the door is closed and vice versa.

Sample uses & alternatives

Magnetic door sensors are mainly used for monitoring doors and windows for security purposes. It can also be used to monitor head counts, 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 and fairly cheap. On BangGood they are sold for about R40. Apart from connecting to the usual alarm system, it can also be connected to microcontrollers for home DIY.

The current flowing through the switch can be used to signal a digital read pin on a microcontroller.


Because Magnetic door sensors needs to be mounted on doors and windows, choosing the correct placement and hiding the wires can sometimes be a bit tricky.


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.

Magnetic door sensor related posts

Try one of’s online software and skills learning courses
Try one of’s online software and skills learning courses
26 April 2018
Improve your knowledge on anything from programming to business skills with’s huge range of professional video courses.

Save, share, comment & Disqus

Use the buttons below, on the left or the bottom of this page to share this post. Your comment is important, but don't be a shit. Keep it constructive and polite.
Share on FacebookTweet about this on TwitterShare on Google+Share on LinkedInPin on PinterestShare on StumbleUpon

Comment via Facebook


About the author
Renier finds himself busy with creative web design and his websites, motorcycling, photoshopping, micro electronics, non-commercialised music, superhero movies, badass series and many other things that are not interesting to most people.