Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Another alternative is to use ESP32's deep sleep mode. You can tell ESP to sleep until some event occurs. There are many options for waking up the microcontroller.

https://docs.espressif.com/projects/esp-idf/en/stable/esp32c...

It uses little power, so standard 18650 battery could last years with single charge.

https://www.programmingelectronics.com/esp32-deep-sleep-mode



The ESP32-S3 spends most of its time in deep sleep, only waking up for about 5-10 seconds every 5 minutes. The problem I ran into was that not just the ESP32-S3, every component on the board (the accelerometer, the haptic motor driver, the LiPo battery charger, the 3v3 LDO) has a some constant, minimum (quiescent) current draw. And even how your resistors are configured (pullup or pulldown) and their resistance values contributes. To diagnose it, I would need a precision measurement tool like a ($1k) Joulescope https://www.joulescope.com/products/js220-joulescope-precisi... and probably a significant amount of time.


I recommend the [nRF PPK II](https://www.nordicsemi.com/Products/Development-hardware/Pow...), it's (relatively) affordable and most likely would dl the job just fine for you


Here's a nice video featuring the product: https://www.youtube.com/watch?v=GqmnV_T4yAU


I have also recently been through the same steep learning curve you have and the following worked for me. Reading spec sheets is fine but nothing beats measurement if its feasible. I built a custom PCB with all the power pins for all the peripherals broken out so I could put an ammeter in series with each of them individually. Then I used Nordic's inexpensive power profiler kit 2 (search for Nordic PPK2 - its under $100). Really decent specs at 100kHz sampling rate and 100nA resolution - you connect it to a PC to see the charts. I also bought my own resin 3D printer. They are so cheap these days and it helped with iterating on designs and not having to wait days for things to arrive. PS, great post, loved it.


I had this problem on a low power design. We were making an industrial temperature sensor for something that moved and we needed to run on battery.

What I ended up doing was using a second voltage regulator with an enable pin for all the accessories. When the MCU wakes up it turns power on to the accessories and waits for things to stabilize, maybe 1ms or so. Then it does what it needs to do and before going back to sleep turns all the accessories back off.

Costs you a few extra parts and a second voltage bus and the hassle of programming but it turns "small quiescent draw" into essentially zero. Maybe the regulator has a bit of leak but it should be pico amps or less.


Here's a nice write-up where power consumption is measured using a voltmeter: https://peppe8o.com/raspberry-pi-pico-w-power-consumption/


Wait until you look at the leakage current of capacitors..! Very poorly specified, if at all, and can actually swamp the consumption of active components in these low or sub-microamp situations. The dual voltage rail that msanford described is the way to go here, gate as much as you possibly can and really focus on reducing the duty cycle.


ESP's deep sleep is not great - the datasheet for the C3 says 5 uA. That's an order of magnitude above low power microcontrollers (e.g. ATSAML), and two orders of magnitude above an ultra low power timer. Not horrendous, but higher than I'd prefer for a tiny watch battery.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: