Snail Mail Notifier’s Simple Power Management To Maximize Battery Life

There are no weird, specialized components nor esoteric sleep mode tricks behind the long battery life of [Zak]’s WiFi mail slot watcher. Just some sensible design and clever focus on the device’s purpose: to send an HTTP request whenever it detects that the front door’s mail slot has been opened. The HTTP request is what kicks off useful notifications, but it’s the hardware design that’s really worth a peek.

The watcher’s main components are a ESP-M2 WiFi module, a reed switch, and a single lithium cell. Here’s how it works at a high level: when the mail slot is opened (detected by the reed switch), the ESP module is powered up just long enough to connect to the local WiFi network and send a single HTTP request, after which it shuts back down. The whole process takes between four and ten seconds.

As mentioned, the power control isn’t managed by any unusual components; it comes down to a NAND gate with a single inverted input, and a MIC5504 3.3 V regulator responsible for feeding the ESP board. The logic gate controls whether the voltage regulator is enabled or disabled, and therefore whether the microcontroller receives any power at all. Most of the time the regulator is disabled, but when the reed switch triggers, its input to the NAND gate is pulled low and the regulator is turned on, booting up the ESP board.

In order to stay on, the first thing the ESP board does is use a GPIO pin to drive the inverted input of the NAND gate high in order to keep the regulator enabled, and it has a window of about half a second to do this. Once the HTTP request is sent (and the battery voltage sensed), the ESP board pulls that pin low, disabling the regulator and turning itself off until the reed switch once again begins the process.

After seven months of use, the battery has dropped from 4.2 V to 3.9 V, so there’s plenty of life left. The project’s GitHub repository has the necessary code if you’d like to apply some of its ideas to your own projects. Alternately, you may wish to consider supercapacitors and solar in lieu of batteries. Even if ultra-level power savings isn’t your bag, when WiFi and networking is involved, there are software-level opportunities to be more efficient. Even a judicious 1 ms delay can save a surprising amount of power in the right circumstances.

33 thoughts on “Snail Mail Notifier’s Simple Power Management To Maximize Battery Life

      1. Always between 2:00 and 4:00 pm. But I could have easily added condition to delay or suspend announcement if I had weird mail service during sleep. But the USPS transitioned me to a centralized mail kiosk out of Z-Wave range. I now subscribe to the USPS service that sends you images of mail scheduled for delivery. I only pick up the mail if there’s something other than junk.

    1. Does it matter if it is a POST or GET? How the other side handles the http request is important. Could be a http TUNNEL or a snmp PING as long as there is a notification on my smart(watch/phone) to go check the mailbox, the contact protocol is rather unimportant. Could be a smtp message :D

  1. not as smart as I expected. I thought it would use mechanical switch to keep power circuit open and when door is opened – feed just right amount of electricity to send the message. Given time needed to complete the request – charge some sort of capacitor?

  2. I do sort of appreciate the simplicity of this design, but it is not optimized very much for low power. But compensating with a very big battery and charging it every one or two years seems acceptable.

    The 74LVC1G98 has a maximum quiescent current of 4uA (0.1uA typ) and I’m a bit confused what that delta Icc “Additional supply current” with upto 500uA is ??? The MIC5501 is quite low power (50nA typ. 1uA max) but it’s still a second IC sucking current. (Or better sipping current). I’ve come to really appreciate the power down circuit of the ubiquitous “transistor tester”. In the off state the only current is leakage through a single PNP transistors (BJT’s generally have lower leakage then Fet’s) (Also note that leakage doubles about every ten degrees celcius.

    And of course using WiFi and “low power” do not fit together very well. Needing 4 to 8 seconds just to start up the radio and send a message is atrocious, and WiFi sucks a lot of power in that time. There are plenty of other radio’s that can bring this back to 10ms or so, and use less power in that time too. So that is an improvement of over 2 orders of magnitude.

    Also, when you get the energy needed for the radio down, you can further simplify the power circuit. A reed switch that charges a capacitor when closed could then store enough energy to send some message through.

    This brings back some memories about Jeelabs / Jeenode. He blogged a lot about low power design and had sensor nodes with a radio that ran multiple years from a single coincll.

    As an alternative, you can also use one of those energy harvesting light switches. A year ago BigClive tore one down, his video has the title: “Inside a kinetic self-powering remote switch”

    1. I think it’s a stretch to say that WiFi and low power don’t fit together very well. I’ve had an ESP8266 sending one message a day and deep sleeping the rest of the time running for 1044 days off two AAs. No mechanical interlocks or other weirdness at all. Wakes up, takes a distance measurement with a TOF sensor, sends it to the cloud, goes to sleep, and repeats it all in a day. WiFi works great for my purposes.

    2. I think it’s a bit of a stretch to say WiFi and low power do not fit together very well. I have an ESP8266 sensor that wakes once a day, takes a time of flight measurement, reports it to the cloud via WiFi and goes back into deep (software) sleep, and it’s been running 1044 days on the same 2 AA batteries. It looks like it will make at least 3 years at this rate. That’s about as good as I get on any AA-powered device.

  3. I did go a similar route, albeit not using a voltage regulator, for a mailbox sensor attached to home assistant.
    https://www.espthings.io/index.php/2022/11/05/et-sw01-a-very-low-consumption-mailbox-switch/
    We expect at least 2.5 years of running time out of a CR123a non rechargeable battery. And that is low power enough 🙂. Reason for not using a rechargeable cell is the need for a regulator and the relative high self discharge of rechargeable cells compared to primary, non-rechargeable, cells.

  4. Hey everyone

    I am currently thinking about building the wifi version of this and was wondering if someone has one of the circuit boards available or can tell me where I could buy the components and the board

  5. I am currently thinking of building myself one of these modules and was wondering if someone has a supplier for the circuit boards or could tell me where to find something like that?

Leave a Reply to BubbaCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.