1
\$\begingroup\$

I'm building a project based on an ESP32-C3 MCU that does not use any RF (no Wifi, no bluetooth, nothing). Since the current that the whole circuit uses is somewhere around 4 - 5 mA, I was hoping to power it from two coin cell batteries (CR2032, 3V each, in series).

(I prefer regular CR2032 batteries rather than LiIon because they are much cheaper and last longer. But, that internal resistance is killing me).

When I run this off of a bench power supply, it runs fine and indeed only takes 4-5 mA. When I run it off of the coin cell batteries, the ESP32 goes into a loop of automatic brownout resets and never gets powered up.

The voltage regulator I chose is the MIC5225-3.3 (data).

I've definitely successfully run other MCUs off of coin cell batteries (specifically, the ATSAMD21) so I thought there would be a way to get this to work.

Any suggestions?

enter image description here

\$\endgroup\$
5
  • \$\begingroup\$ I have two in series, so 6V. This is enough voltage but the internal resistance of the coin cells seems to be causing brownouts at high current draw. \$\endgroup\$ Commented Dec 26, 2021 at 20:28
  • 2
    \$\begingroup\$ I wonder if the ESP32 is drawing significantly more current during startup. If so you might be able to optimise the startup code to reduce power consumption as early as possible. Given the low drop-out of the regulator it’s most likely that the cells are the limiting factor rather than the regulator. Possibly adding capacitance in parallel with the cells and delaying releasing reset on the ESP32 until the capacitance is fully charged will help. \$\endgroup\$
    – Frog
    Commented Dec 26, 2021 at 20:28
  • 1
    \$\begingroup\$ @Frog I've seen many posts claiming up to 300mA peak during startup even before RF initialization, and then additional surges on WiFi or BT startup. The usual way of dealing with this is indeed to slam a huge capacitor on the supply. Which often does not help much without precharge or voltage supervisor on enable pin \$\endgroup\$
    – Maple
    Commented Dec 26, 2021 at 20:54
  • 1
    \$\begingroup\$ If you have an oscilloscope, measure the current vs. time for your circuit as it is turned on, and post it. @Frog's comment is perilously close to an answer. \$\endgroup\$
    – TimWescott
    Commented Dec 26, 2021 at 20:55
  • \$\begingroup\$ Thanks everyone! I am kind of surprised by how much current the ESP32 draws as I thought it was meant to be useful for IOT, ultra low power applications, but I guess it's not really quite as low as other MCUs even with the radios off. \$\endgroup\$ Commented Dec 26, 2021 at 22:47

1 Answer 1

1
\$\begingroup\$

I'm working on ESP32, so I just put a 1R resistor in series with the supply to check power supply current at boot. Yellow trace, 1 ohm, so 1V = 1mA.

enter image description here

Labels on plot:

RST - reset button released.

1 - it enters arduino setup() and the first thing it does is pulse a GPIO (blue trace) so that shows up on the scope.

4 - frequency is lowered to 80MHz, which does reduce current draw a bit.

3 - WiFi is enabled, so that's not relevant to your application. Current spikes much higher than what the graph shows, but I cropped it for better viewing of the interesting parts.

Between RST and 1, you have no control, it's executing the bootloader and startup code, and it draws about 55mA for 250ms. That's quite a lot for CR2032, it is surprising that it even manages to initialize the serial port and print something. The battery must be new!

Would a capacitor help ? i=C dv/dt, so C=i dt/dv. For the input voltage to drop from 6V to 3.5V (dv=2.5V) during dt=0.25s with i=55mA, this gives C=5500µF, to place in parallel with the battery, before the power switch. Not entirely practical, and not very "thin and fashionable" either, but doable.

To reduce this current, you'd have to hack the SDK to insert some code that would execute right at boot. Perhaps something to lower clock speed, or insert some periodic sleeps to reduce average current draw. Of course, you can't modify the ROM bootloader, so if it wants to read the whole flash to checksum it before running the code, then you're stuck...

I'm not going to do it, but if you really want to run an ESP at 5mA, I guess you'll have to recompile the SDK and bootloader and insert a bit of code at the beginning to pulse a GPIO like I did... If that happens reasonably quickly after boot, then perhaps you can reconfigure it for low power at this point, and get away with a much smaller capacitor.

If you're not using the arduino "framework" but instead the espressif SDK, it could behave differently (it would be nice if it booted faster).

Another potential culprit would be the LDO. It is a micropower LDO, and these tend to be very slow and take forever to react to pulsed loads:

enter image description here

Note, they decided to do this measurement with a 4.7µF output capacitor, whereas the first page of the datasheet has a 2.2µF. Presumably the smaller capacitor value resulted in graphs that were not conducive to more sales. I would recommend 10µF X7R MLCC, that's cheap enough.

Another suspect is the NeoPixel. I have some of a different brand, and when these power up, they flash, and therefore they draw a pretty chunky current spike too. I'd recommend checking for this. They also draw an unreasonable amount of current even when set to dark, so a PMOS on the VCC to turn the thing off when not in use could make the battery last longer. Of course, then, when you want a slow and smooth fade from black, then you have to power it up first, and it flashes, so bummer.

But well, if you're not using the WiFi and the bluetooth, why use an ESP32? OK, the PWM is great, but with a pair of CR2032 you're not running a bunch of high power LEDs either... and the PWM doesn't work in light sleep mode because the peripheral clock is disabled.

\$\endgroup\$
3
  • \$\begingroup\$ Ah, thank you! This is all incredibly helpful. I appreciate your instructions for how to use a scope to measure current draw over time... that is new to me but very helpful! What I'm building is basically a gift toy application that I plan to give away in large quantities, and I'm trying to keep the unit cost. My original MCU of choice was an ATSAMD21, but those are hard to get and cost around $3, so I had been working on ESP32-C3 which is readily available at $1.18. Anyway I think I may have to go back to ATSAMD21 which works nicely off of two cs2032s. \$\endgroup\$ Commented Dec 26, 2021 at 22:46
  • \$\begingroup\$ By the way, I am running a charlieplexed grid of 144 tiny LEDs running cute PWMed animations. My goal is to run for about 20-30 hours total off of two CR2032s. Since the MCU can be off while the animations are running (I am using a chalieplexer chip) this seems doable \$\endgroup\$ Commented Dec 26, 2021 at 22:50
  • \$\begingroup\$ OK! Cool project! Yes it's hard to find micros these days... Would a 8-bit chip fit the bill? Or STM32G0 looks like there are enough in stock... \$\endgroup\$
    – bobflux
    Commented Dec 27, 2021 at 9:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.