IOT Device #1/100 (ESP8266 Mailbox notifier) continued

I was having some mechanical problems with the previous version of the mailbox notifier where the pieces of mail would not sit flush against the sensor due to getting caught on the PCB box at the rear.
I solved this by building a false floor in the mailbox out of cardboard with the components glued onto the underside of the flooring. I would have been better to buy another mailbox, but I didn’t want to modify the property or the mailbox.
The current modifications are reversible. Plus its also waterproof.


The code is very simple. IFTTT was to slow – taking up to 1 hour to trigger an Android notification. The new version is near instantaneous by using  MQTT – but the main let down is the Android software with a lack of good MQTT software with reliable persistent connections and notifications.
My MQTT broker runs on my $5 Digital Ocean droplet running FreeBSD. For a WiFi connection I enabled a hidden guest network on my router that does not have access to the rest of my network.
The ESP8266 goes into deepSleep() for 60 seconds and wakes, upon wake it checks the A0 (analog) pin, if there is mail this triggers the WiFi to connect and a message to be sent to my MQTT broker.
Here is the code:
[gist https://gist.github.com/wilyarti/d98e248cf7b2bab4b0430bd2a606ed5b /]
Parts list:

I only used a scissors, hot glue gun and soldering iron – so there is not a big tool requirement.
Limitations:

  1. Doesn’t count mail
  2. Annoys you by continuously reminding you that you have mail….

Leave a comment

Your email address will not be published. Required fields are marked *