Mailbox notifier project upgrade

Time for an upgrade to my mailbox notifier. I long wanted to give it an upgrade and folks kept asking. Here are the things I wanted to change/add:

  • the transistor was a rather unnecessary complication and it made assembly more difficult. The hall sensor could simply be powered from a Moteino pin
  • a more weather proof enclosure would be nice
  • use more velcro to keep the thing from falling off (happened a few times when the mailman was more violent with my mailbox door).
  • how about battery voltage reading too!
  • upgrade code to use structs since all I’m sending is a bunch of integers
  • I wanted a standalone receiving unit with a LCD screen which I could operate from another 9V battery or just plug into an FTDI for quick reading. The other receiver on the RaspberryPi could still receive the same packets and still send an SMS

Clipboard01

First, I assembled a voltage divider for a battery voltage reading circuit. I added a small cap on the lower portion to help the ADC be more stable at higher resistor values, as suggested in this Jeelabs post – it seems to be a pretty good method without getting too fancy and expensive, perfect for quick projects like this. I used 1Mohm and 470Kohm and 0.1uF in parallel with the 470K, but you could use higher resistor values to keep that parasitic drain through the divider even lower (perhaps 10M and 4.7M). The 1M is soldered to the “VIN” pin, the 470K bottom to “GND”, and the middle point to A2 for reading the battery voltage. The 1M+470K gives a ratio of 31.97%. So to calculate the actual voltage of the battery I need to know what the battery rated voltage is (ie starting point) and of course the ADC reading. The details of this calculation are in the new sketch for the standalone receiver. The sensor node just sends the ADC reading, and the receiver then decides how to interpret that based on the battery rating in the sensor.

DSC02907_w

Next up is removing all the old peripherals and rewiring everything a bit more neatly.

DSC_1121_wDSC_1118_w

Previously I had the Moteino just taped to the battery. That was not ideal at all. While everything is enclosed in the mailbox and protected, it’s possible the door could be left open and exposed to the elements. So I spent some time researching a good enclosure, including ebay, amazon and other places. Have not really found something I was happy with, and everything was in the $7-$50 range, so I looked around in my junk to see if I can figure something out or make one on the fly. I found this nice pack of screws that I got from HD – my favorite hardware store  – which was still pretty compact and fit everything perfect, plus it had a clear lid in case I need it and it closed the box very snugly. I could then use some velcro on the back of it to keep it tight on my mailbox door, and some clear tape to weather seal the unit. The box (full of 50 screws) is $1.94, it can’t get any better/cheaper than this. I will probably grab a bunch more for other projects when I stop by HD.

DSC_1113_wDSC_1123_w

I used some white packing foam to keep stuff in place without having to hot glue everything, and I taped the hall sensor on one of the sides, which will align with the magnet that sticks on the inside of the mailbox for triggering an OPEN/CLOSE event.

I then added the velcro from HD, reprogrammed it and proceeded to install the sensor in the mailbox:

DSC_1125_wDSC02913_w

For the standalone receiver I used a Newhaven I2C LCD with backlight (ST7036i). It worked great with this library and using a custom character generator I could add custom icons for battery levels. The nice thing about this LCD is that it works on two data wires, and has a backlight, and it runs on 3.3V with the backlight being pretty low power. These would actually be nice to source for my store. The receiver code uses structs to read data from the RFM12B on the Moteino R1 which runs it. If you want to implement this, you could certainly use another regular LCD but you will need more pins in case it’s not a I2C or serial LCD, but mind the fact that I used a 3.3V LCD which could be powered directly from the Moteino’s “3.3V” regulated power pin. If you have a 5V LCD you will need a 5V power source instead.

So now whenever I want to check my mail, I just plug in another 9V battery and I wait for the next packet telling me when the mailbox was last opened and closed, and also the battery voltage. The sensor transmits every 8 seconds, and I can pick it up in my basement and pretty much anywhere in the house. I’m quite happy with this standalone unit, I will need to find a good enclosure for this also, and perhaps make a custom PCB for it to plug the LCD.

Fun fact: the remote Moteino still runs on the same 9V battery I installed in mid February (I did take it out of service for a few weeks though), and it’s at 7.9V now after a bunch of testing for this upgrade, not bad, I will try to remember to post an update here when it runs out. The cool thing about this project/LCD/enclosure is that I could use a large 2Ah lipo battery which is rechargeable. I might do that when the 9V finally dies.

DSC02914_banner_w

19 thoughts on “Mailbox notifier project upgrade

  1. hi Felix, nice write up. wrt the voltage divider, keep in mind the ADC input pin has some resistance to ground. That will be in parallel with the lower resistor, and could change the voltage divider ratio a bit. Especially if you used really high resistor values in the megohms.

    • The blog post describes what the parts are, there’s a schematic, also the pictures show how to make it. I plan to make this a kit sometime in the future just didn’t get around to it yet.

  2. Hi Felix,
    I like your blog.
    First, you have right, is neccessary to put outside anntena because if the mailbox is from metal the electromagnetic wave do not go too very well outside (mailbox is like Farraday cage).
    Second, why not put at the door magnet and the circuit box inside? In this manner the circuit is not necessary to move and is protected inside.

    • Thanks, mainly because of the way my mailbox is made and the plastic tray that has side walls, which is pulled out by the mailman, and because it would interfere with mail pieces that are pushed inside. The magnet is very small and won’t interfere. I could mount the circuit in the back of the mailbox but then I would have to run the sensor to the front with wires and it would be difficult to remove it.

      • I am considering building a Mailbox Notified.
        I had a few questions.

        1) Do you think the moteino will be able to transmit properly in a mailbox that is enclosed in brick?
        I would like to place my moteino and battery in the back of the mailbox, and just bring the hall effect sensor and antenna to the front.
        I wanted to make it so that no one really sees my moteino setup.
        2) Is the antenna of the moteino just a wire that is soldered to the moetino?
        3) Is there any guidance on how to setup a raspberry pi to listen to the moteino and send the email notification?

  3. Could the ground side of the voltage divider be connected to a an IO pin and brought low when you want to take a measurement to save even more power?

    • Hm.. not sure, because current might sink between the battery and the 3.3V of the pin. It could be less than trivial to measure that. But I guess you could try and let us know how it goes 🙂

  4. Powering the hall effect sensor from a Moteino pin gives it 3.3 Volts, right? The datasheet for the hall effect sensor in your shop says the minimum supply voltage is 3.5 Volts. Do I need to use a different hall effect sensor or does the one in your shop work OK at 3.3 Volts?

  5. The 10k pull-up resistor for the hall effect sensor may not be needed. I used the 20k internal pull-up of the ATmega on the Moteino and it worked fine. Here’s how to enable the internal pull up:

    pinMode(4, INPUT); // set pin 4 to input
    digitalWrite(4, HIGH); // turn on pull-up resistor

    More info here – http://arduino.cc/en/Tutorial/DigitalPins

    Heads up, I had the hall effect sensor pin-out wrong. The datasheet is a bit confusing with the pins numbered sequentially in the figure but the table is not. Also the Fritzing illustration above is wrong. The sensor pins from left to right are: 1 Power, 2 Ground, 3 Output.

  6. Hi Felix

    What size and type of magnet is big enough to trigger the hall effect sensor and at what distance?

    • I have a small neodymium magnet the size of a BB and it triggers the hall effect sensor about 1/8″ away. A 1/4″ cube neodymium magnet works at 3/8″ gap.

  7. The original 9V battery died mid November 2013 so I changed it to a fresh 9V and upgraded to RFM69W. The battery voltage drops significantly in the cold winter and rises when it’s hot. A 6x9V batt pack is $13 at HD, so $2 gets you 10 months of mailbox notifier service .. not bad I think. Worth noting that the mailbox notifier is now out there in bitter cold transmitting every half minute, I get every packet across the street into my basement and the signal is strong at -80-90dBm, so I’m happy. It’s a RFM69W by the way, not HW.

Comments are closed.