Lefebure.com / Articles / Cloud-enabled Mailbox
The story of a mailbox that can send e-mail.
Background: The USPS used to deliver my mail with a mail truck that didn't have a muffler. I could hear the engine as it drove away from the mailbox, even in my house with music playing. That was great. My current mail carrier drives a newer vehicle that runs quiet. When I am expecting a package to arrive, instead of periodically checking the mailbox to see if the mail has been delivered, I wanted a way for the mailbox to notify me of a delivery.
Requirements: I wanted the system to generate an e-mail, so that I can be notified anywhere. I wanted it to be inconspicuous so nobody would notice it. Since it is not near power, it had to be solar powered with a wireless data connection. I decided to use the Electric Imp for the brain of the system for a variety of reasons: It's tiny, it has WiFi, the firmware is remotely updatable, and it has a very low power mode.
Electric Imp offers a breakout board known as the "April" model that makes this module easy to do breadboard testing with. I opted to use this breakout board and add my components to a daughter card that would connect directly to it. I have power inputs for a battery and solar panel, both with reverse polarity protection using MOSFETs to minimize voltage drop, a voltage divider circuit to measure the battery voltage, an I2C-to-Onewire converter with a DS12B20 temperature sensor, an input for the mailbox door detection, and one LED. The resulting schematic and board layout are shown here.
I used OSH Park's PCB service to make the circuit board. They charge $5 per square inch for three copies with free shipping, so this little board came to $8.25. This picture shows the bare board. I used the skillet method to solder the surface mount components, then hand soldered the through-hole parts to it. I also added a male header to the April board.
The plastic mailbox mounts to a 2x6, which is mounted to the post in the ground. I wanted to mount all of the electronics inside the 2x6 board. By putting everything inside the 2x6, everything would be hidden and somewhat protected from the weather. I purchased a 6 volt battery that is just under 1 inch thick. I cut a pocket into the 2x6 for the battery, fuse, wiring, and the electronics.
I used a CNC router to cut the pockets. I placed the components on the board, traced approximately where they should go, drew that in CAD, generated the code for the pocket, then cut the holes on the CNC router.
The result is that everything except the solar panel is contained within the dimensions of the 2x6.
I used silicone sealant and clear plastic to create a waterproof compartment for the electronics. Here it is attached to the post.
Looking from the bottom, you can see the magnet that is attached to the door, as well as the reed switch in the 2x6. When the door opens, the magnet causes the reed switch to close, triggering the Electric Imp to wake up and send a message.
The Electric Imp contains a light sensor, so I made sure to allow light to get to it. This will allow reprogramming of the WiFi network to join, and monitoring of light levels.
There is a small solar panel to keep the battery charged. For right now it is simply taped to the mailbox with clear packing tape. I need to find a mounting solution that is a bit more durable.
I have programmed the Electric Imp to wake up every 10 minutes, check the temperature, battery voltage, light level, and WiFi signal strength, upload the data to my website, then go back to sleep. The website logs the values to a database and has some code to check the values against alert levels, and send e-mails for those sensors that have triggered an alert.
The primary goal was to get an e-mail when the mailbox is opened, and here is what that e-mail looks like.
Summary: Performance is great, no false positives or negative so far. The temperature data is interesting, but not particularly useful. I believe I purchased too large of a solar panel based on the voltages I'm seeing - 9 volts on a 6 volt battery is going to over-charge it. I may try pointing the solar panel down so that it never gets direct sunlight, thus reducing its charging ability to a level that won't over-charge the battery.
Last updated: August 17, 2014