Smart Mailbox vol. 2: a software demonstration
In our last blog post, we briefly introduced our Smart Mailbox project. Now it’s high time we presented a first demonstration of our prototype at work! This demonstration will focus on the prototype’s control software features, so only the most elementary hardware is used. But before the demo itself, let’s first have a look at the control software implementation.
The software controlling the Smart Mailbox is implemented as a Finite State Machine. A simplified state diagram is shown below:
At any given moment, the mailbox exists in one of four distinct states, in which it remains unless a specified condition is triggered. The input from different sensors (pressure sensor, photodiode, door contact sensor) determines the transition between states.
Each state is associated with a specific LED color: blue for an empty mailbox (indicating that it is ready to receive mail), green for a mailbox containing new mail and orange for a mailbox containing mail which has been checked before. If the door is open, the LED is turned off.
Moreover, sensor-based events, whether initiating a state transition or not, add a message into a First-In-First-Out queue. The queue is processed at regular intervals and based on user preferences, some messages can be pushed as SMS, emails or app notifications. As these three options are not yet complete, for the purposes of this demonstration, the messages are displayed on a laptop monitor via a serial UART connection.
The simplified hardware setup used for the demonstration is presented in the picture below:
A pressure sensor registers changes in pressure / weight as changes in its resistance value, while a Hall effect sensor acts as a switch and detects whether the door is open or closed. A photosensitive component (actually also visible in this picture but only to those with nearly superhuman perception) will supplement detection of mail items of negligible weight (e.g. package pick-up notes) and will provide an indication of whether the mailbox is full and/or its slit is blocked.
The video that follows displays some key features of the Smart Mailbox. Basically, if they so desire, users are notified every time a new item lands into their mailbox, every time the mailbox door opens and also in the case that the weight inside the mailbox is reduced while the door remains closed, which might indicate that the contents of the mailbox have been illegitimately tempered with.