Open Sesame Pi

DIY Raspberry Pi Door Monitor

Fritzing has an amazing desktop application which functions as a virtual breadboard.

Browsing the list of components, I came across something unusual, a magnet-based electrical switch called a reed switch. According to that wikipedia article, one of its more common applications is "to detect the opening of a door, when used as a proximity switch for a burglar alarm."

Looking them up on various electronics catalogs, I found several cheap units pre-molded for mounting on doors.

Could I connect one to a Raspberry Pi as a cheap door monitor?

Yes, there were several examples of how to use a reed switch with the Pi's GPIO pins, and thanks to the RPi.GPIO library, programming a reaction when the switch (door) opens and closes was simple.

Pull Requests Welcome!

My current version just sends an email alert, but it's open-source and can be extended to do more interesting things.

OpenSesamePi on Imgur

Unlike the PiScan, which needed no soldering, there is a small amount of wiring needed here, but it's not very difficult.

Also, it's not very memory or process-intensive, so it can co-exist quite happily with an existing Pi already running other software (I use mine in double duty with PiScan, for example, and both run together nicely).

The Pi may be overkill for something so simple, actually, which is why I'm also researching a version based on the ESP8266 wifi microcontroller connected to an Arduino instead. The newly-announced Raspberry Pi Zero may also be a good fit for this application.

Build Your Own

The software is available on github:

The hardware is also simple, with a little bit of soldering to extend the reach of the reed switch wires, and attach a small resistor.

This parts list has two links for each item, the first is an affiliate link, which is a small way of supporting me to continue this work, along with a non-affiliate version underneath.