Entry/Exit Notifier: A simple, well-engineered build

By Rob Zwetsloot. Posted

Not only do we like to show off fun, unique, and complex builds in The MagPi, but also Raspberry Pi projects that are just put together really, really well. This month, we want to show off what Wayne Chan has been working on.

“It’s a device that sends a notification e-mail with the push of a button.” Wayne tells us. “At the university where I work, we have had to observe building capacity limits over the last two years. In order to know how many people were in the building, we were required to send an e-mail to the department office when we entered the building for the day and when we exited. I had the idea to make a simple device that could send a pre-written message with the push of a button.”

Sounds simple, right? Wayne had found himself forgetting to send the necessary emails, and thought the process was a bit tedious when he did remember, which became the impetus for the project. There’s a little bit more to it than just being a button that makes it pretty cool though.

“I used an old 512MB Raspberry Pi Model B that I had bought back in 2013 that I never did much with.” Wayne continues. “Because the project needed internet connectivity and the Model B didn’t have wireless LAN, I added a USB dongle. For a display, I decided to use a cheap 16-character by two-line LCD display instead of an LCD panel, because I only needed to know if the email transmission was successful.”

Programmable entry

The code on Raspberry Pi was well thought out as well: “Email was handled by msmtp, a lightweight command-line mail transfer agent,” Wayne explains.

“Since the university used Microsoft Exchange, I used Davmail, an open-source program that acts as a gateway between non-Microsoft mail clients and MS Exchange servers. The push-button interface on the EN/EX Notifier could have been either two SPST momentary switches, one for entry and one for exit, or a single momentary on-off-momentary on SPDT rocker switch. I decided to go with the rocker switch, and connected it to Raspberry Pi’s GPIO pins. When the entry or exit button is pressed, it triggers the appropriate bash script to send an email, and displays a message on the LCD display to tell me if it was successful or not.”

Wayne had thought about automating the system by using the room’s light switch. However, with other people occasionally going in and out, he found it better to just make it a dedicated switch.

Exit, stage right

While Wayne will soon not need to use it, he definitely was able to get some use out of it:

“It functions fairly well. The main issue is that the wireless LAN connection is sometimes unreliable, so it doesn’t send a message when I push the button, but that is mostly due to my office being far away from the nearest router. I’ve had connection problems with other computers, so it’s not caused specifically by Raspberry Pi. I could probably improve the reception by using an adapter with an external antenna, or by using a wired Ethernet connection instead.”

From The MagPi store

Subscribe

Subscribe to the newsletter

Get every issue delivered directly to your inbox and keep up to date with the latest news, offers, events, and more.