Battery powered ESP-01 smart switch

All valid options, especially the first one.
Test your multimeter current reading with 1M resistor across 3.3V.

I am not sure if I tested what you wanted me to test.

I used the LDO to feed 3.3V to a 1M resistor and measure the current in series with my multimeter; it was reading 3.34uA, which I think shows that the multimeter can measure such small currents. When taken out of the circuit, the multimeter measures the resistor at 0.988M, so that makes sense (3.3/0.988 = 3.38uA)

Yep, that was the purpose.

I think the ā€˜fake’ and ā€˜damaged’ options are the most likely. Current leaks can be the result of overheating during soldering, and if you hand solder SMD components the temperature is often above the temperature in the datasheet. And if you buy cheap fakes you never know what shortcuts were taken. Sometimes they can make the same quality cheaper or live with lower margins. Sometimes not.
Anyway, still following this thread with interest!

And sometimes genuine chips that don’t pass quality control end up in trash… but some instances are so ā€œeco-mindedā€ that you soon find them online.

Yep. That was part of the ā€˜sometimes not’

Quick update: the battery experiment is still running. We’re well over 2 months at this point and I’m very happy with how it’s going.

I tested another ā€œfakeā€ RT9080 from the same batch and saw similar results as with the first one - 76uA quiescent current instead of the expected 2-4uA. I knew this was a possibility when I ordered from Aliexpress, but Digikey and co have 20.- flat shipping fee where I live, so I was reluctant to pay that much for 1.- worth of components. Now I need to make a bigger order anyway for another project, so I’ll probably order some genuine RT9080. I was checking alternatives in the DigiKey catalog and found the MCP1812AT-033/TT which has similar characteristics as the RT9080, but lower output current (300mA vs 600mA) and lower quiescent current (0.5uA). I think I’ll order a few to test them too.

I also wanted to revisit the soft latching suggestion from @Spiro and @donburch888 and I was hoping to find an IC that could accomplish that instead of having to build a circuit from scratch, but I haven’t been able to find what I was looking for. If you have any suggestion, I’m open. Its role would be to replace the mosfet that I was planning to use between the GPIO pin of the ESP and my circuit, allowing the ESP to wake up, turn on the circuit and go back to sleep while leaving the circuit on. Right now, my 1 mosfet solution would require the ESP to stay awake and keep the GPIO pin high the whole time, which obviously would reduce greatly the battery autonomy.

Not ha hardware suggestion & I haven’t tried it myself, but maybe it’ll help.

The latest ESPHome 2025.11 release has a ton of optimisations for wifi & memory. Maybe give it a shot and see if you can squeeze out a bit more juice out of your battery.

wow, interesting discussion. I have the same exact use-case (automate some small portable lights) and came to the same conclusion.

In my case, I actually could use mains power and a relay, but if a reliable battery solution exists, I’m all for it.

@asktoomuch may I ask what your current progress is? Have you been able to successfully automate your lights as planned? What’s your current estimate on battery life?

@rice12 I haven’t made much progress unfortunately, as I have had very little free time recently. I received a batch of genuine RT9080 from Digikey but I didn’t test them yet. I’m planning to do that soon. I also discovered that MCP1700-3302E/TO also exist, which would be much easier to integrate as is is a TO-226-3 component instead of the tiny SOT23 SMDs I have been dealing with so far. I’ll keep it in mind if I need to make another order on Digikey in the future.

Regarding my deep-sleep battery life experiment, I am astonished that it is still running. I was expecting the battery to die around the 2-month mark, but it has now been running for more than 16 weeks (almost 4 months). At this point, I might forego any optimization that I had planned for the first iteration and just use it as-is. For me, having to charge the AA batteries twice or thrice a year is a no-brainer.

I finally found some time to test the genuine RT9080 from Digikey. To the surprise of absolutely nobody, I can now confirm that I was indeed scammed by AliExpress.

I did the exact same experiment as when I initially tested the fake components, and repeated the test for both of them today in exactly the same conditions. The results speak for themselves:

  • Genuine RT9080’s quiescent current: ~2uA
  • Fake Aliexpress RT9080’s quiescent current: ~80uA

Here’s a photo of both components, for reference:

The real part is marked 2U=HH3, the fake one is marked 2U=J6S

And here is the listing for the fake part, do NOT buy if you’re looking for a low quiescent current part: https://de.aliexpress.com/item/1005009348334551.html

You live, you learn :slight_smile:

I still don’t know if I’ll be using them, as my ESP-01S seems to have survived fine being supplied with 4.2V and we’re now at more than 4 months of autonomy on a single charge and it’s still happily running. We’ll see.

I’m pretty sure it’s less happy than you think.

Just another quick update, my battery experiment with the ESP-01S is still running. It greatly exceeded my expectations, still working after 7 months, so I consider it a massive success :smiley:

I have however decided to stop it here, because I can see that the voltage of the pack is getting low: 3.4V. It is still fine for the MCU, but I don’t want to damage the cells. Indeed, one of them has dipped to 1.07V, which is getting low for a NiMh battery. The other 2 are at 1.17V and 1.14V. I’m not sure how to explain the difference in discharge, I guess it has to do with variability in the cell’s chemistry and manufacturing tolerances.

I have not yet devised a method of both protecting the MCU from over-voltage when the cells are freshly charged and protecting the cells from over-discharge. If the ESP starts browning out at 2.8V, that’s less than 1V per cell and that’s really not ideal for their lifespan.

I was thinking maybe I could use a diode (0.6V drop) or a couple of Schottky (0.3V drop) between the pack and the MCU to drop the voltage from 4.2V to 3.6V when the pack is fully charged, and force the MCU to shutdown when the pack is at 3.1-3.3V instead of 2.5-2.7V, which would greatly help protect the cells.

However, I am a beginner with electronics and I am unsure that this would have the expected effect. For one, it would mean adding a source of power dissipation, reducing the autonomy of the device. And I am unsure how consistent the voltage drop of a diode is at different current loads.

Do you have any thoughts about that? I know I can use a LDO regulator to protect for over-voltage, but that does nothing to protect the pack from over-discarge.

Voltage regulators and diodes are wasting lot of battery. Either abuse all like you did (knowing the risk) or get some suitable battery management IC.

I don’t think battery management IC for NiMH chemistry are very common however. This is something you see more for lithium cells. I wonder how this is normally solved in common appliances, like a portable radio, walkman, game controller, kitchen scale… I have even seen a beard trimmer that was using 2 NiMH batteries internally. My lack of experience is doing me a disservice in this instance.

Correct me if I’m wrong, but the energy waste of diodes and regulators mostly happens at higher currents, when the MCU is awake and pulling dozens or hundred of mA instead of a few uA when it’s asleep, right?

  • 4uA * 0.6V = 2.4uW (deep sleep)
  • 50mA * 0.6V = 30mW (awake, not transmitting)

Of course, in that case you’d want to minimize the time that the MCU spends awake even further. Right now, with my basic approach of using a mosfet to turn on the main circuit, that is not ideal. But I still haven’t found how to simply implement the self-latching suggestion from before, which would allow the ESP to go back to deep-sleep after turning on the main circuit.

Battery management for nimh today is obviously less common than for lithium, but there is plenty of choice still available. LDO or diode waste power according to current and voltage drop, so if current is tiny, so is waste.
For very low power devices be aware of battery self discharge, it can become noticeable part.