I just recently drove in my dads car, thinking about the amazing things I was going to do that evening. I was considering which movie to watch first as ... Boom ... a bright flash snapped me out of my thoughts. It took only seconds to make me realize that I might have been just a liiiittle bit faster than I should have been and that I have been flashed. But this wasn't the thing I was worried about. I knew that the moment my dad would see that letter with the ticket, I wouldn't be allowed to drive his car ever again. I could already imagine how he would wear me down for driving faster than I was supposed to and going on about what an irresponsible human being I am. There was only one way out: Camp in the front lawn to check on the mail man whenever he was about to put mail in our mailbox. This was a great idea at first, but it started raining in the days that followed and I got bored. Still, sitting there in the garden made me think. There had to be a better solution I kept telling myself. Then it hit me: I could just make the mailbox tell me when there was new mail! After being proud about my genius idea I started working on the project.
First Look: Smart PostBox
The Box looks just like an ordinary post box since it retro fits in most mailboxes. Mailbox orientation doesn't matter too much, it will work either way. The kit will detect mail that was put in the box and the PostBox app will notify you about it.
How does it work?
After tinkering around with a particle Board the final electronics look as follows:
There are three big units to the project: First the main part holding a particle board and most of the other electronics necessary, including door opening detection. Board two holds some LEDs (right hand side). Board three holds fotosensitive resistors (left hand side) with a wavelength sensitivity that matches the LEDs on board two. Board one and two are placed on opposite sites within the mailbox. To be able to place them as efficient as possible the two boards are connected to main board with wires and screw contacts. Once the lid is opened a magnet moves away from a reed contact and it opens (S1). The corresponding digital input will detect the drop to logic low. The controller will wait a brief moment to then start powering the LEDs. In case a letter is inside the box, some of the LEDs are obstructed and therefore the light sensitive resistors maintain a higher resistance compared to a situation where there aren't any obstacles. The resistance is measured with an ADC that measures the voltage drop over an ohmic resistor. In case it detects any mail, it will send this information to the particle cloud, where the PostBox app is able to read it and notify you with a push notification.
If you clear your mailbox a second reed (top right corner) switch will initiate to reset the mail information.
Okay, let's build it!
In case you have all listed parts you can get going right away, otherwise you might have to hold on a litte longer.
You got everything? Well, let's jump right in then!
Software
First, open particle WebIDE and create an account. Follow the steps on screen to link the particle argon to your account. Second you can copy the code from the repository to the web IDE and flash it to the board. Note: For me this worked on local hotspots only! You can connect the board to your home wifi later on. Once the board is successfully flashed you can download the other parts of the repository and open them in Android studio. To make the app work for you, you have to add your particle account credentials in the code and [PostBoxMain.java Line 219]. Starting from there you can compile the code and load it onto your android smartphone. After the app works, you can either create an account for yourself or use the default Admin account.
Hardware and assembly
Building the hardware should be fairly easy, as long as you stick to the Schematics. It is important that you solder the sensors and the LEDs on separate euro boards since they will be placed apart from the mainboard (top and bottom of the box, see image below). To get the best results, you may align the LEDs and the sensors according to the same pattern (like a five on a dice worked best). Note that while the sensors are placed in series, the LEDs are connected parallel! After you soldered these together, you can go ahead with the main board. During main board assembly there is only one important thing to know: Placing the reed switch at the edge of the board is mandatory. Further, think about how you want to place the mainboard in your mailbox, since the reed switch needs to be as close to the magnet as possible. In order to find the perfect location you may consider where to place the magnet during this step too. If you are certain that it will work, you can glue the magnet onto the lid right away or you can do it after all the other parts are finished.
The second cable-connected reed switch can be placed more independently since it has its own cable connection. Its job is to detect the opening of post box door when you collect your mail. It is remote because the many different mailbox shapes and layouts require this degree of adaptability. To make it work, play around with the magnet the same way as you did for the other reed switch. I would highly recommend to glue these in place right when you made them work.
As a final step, glue the sensor board and the LED board in place and connect the cables to the mainboard. You can power the particle with an USB-Cable and a power bank or go with a Li-Po battery that can be directly attached to the board.
Congratulations, you just made yourself a smart PostBox! 🥳📮
What next?
At this point the product is only a prototype with a lot of potential for improvements. Here are the top things you might want to consider:
- Add more LEDs and sensors for more accurate results.
- Remove the reed switches for easier assembly and trigger the measurements via a timer or the app. More frequent measurements let the controller know that mail had been put in or out anyway. This comes at the advantage of decreasing the overall cost and complexity. Furthermore it decreases the size of the device. At the downside it does't allow for realtime notifications without a significant hit on battery life.
- Replacing the controller in order to make the whole thing cheaper. Our program does not require high calculation power. using the particle is therefore overkill and an unnecessary cost factor.
- Replace the euro boards with something cheaper and more flexible and add a casing to the main unit
Comments
Please log in or sign up to comment.