Hacker News new | past | comments | ask | show | jobs | submit login

Wow! This is some phenomenal engineering!

> Another area that stumped me is how to shut the power off 100% on the device, so that it can remain “off” for weeks or months.

This is actually a pretty solvable problem...

https://circuitcellar.com/resources/quickbits/soft-latching-...

Then the microcontroller can choose at any time to completely shut off the entire circuit (including itself), and extremely little power will be consumed until something (like a button) completes the power-on circuit again.

For ease of prototyping, there are off-the-shelf units you can play with: https://www.sparkfun.com/sparkfun-soft-power-switch-jst-2mm....

Some more advanced soft power switch circuits (like the SparkFun switch) also include the ability to forcibly power down a misbehaving device by holding down the button.

The design used in the SparkFun switch also allows your microcontroller to know if the button is pushed while the device is running, so you could imagine repurposing your existing button to also restore power to the device if the device is off, and still retain the existing functionality for cycling through watch faces. Then, either the device could automatically shut itself off after a period of inactivity or when the battery gets too low, or the user could click and hold the button for some number of seconds to turn the device off completely that way.




This is exactly what I was looking for! I had a foggy idea of using a MOSFET and the button to close/open the circuit but I needed something like this to show how it all fits together. Thank you!


No problem. I haven’t had a chance to do anything hardware related for a long time, so it’s fun to think about hardware problems again.

On the topic of extending battery life mentioned in the article, one relatively straightforward thing to investigate is simply reducing the processor clock speed. Your application probably doesn’t need to run at full tilt. I think there is a function called setCpuFrequencyMhz — I think it only works with a few specific frequencies, but the lower the frequency you can pick (while still keeping up with your application’s needs), the less power the system should consume while awake.

Of course, you want to be putting the processor to sleep between updates anyways, and there is a trade off between sleeping more (which means running the processor faster so it can sleep sooner, “race to sleep”), versus the inefficiency caused by running a processor higher on the frequency/efficiency curve, so there might be an optimal frequency that isn’t the lowest or the highest possible option. It’s something that would need to be measured.

Just some thoughts! It might not make a big difference if the processor is already sleeping most of the time, but I figured I would mention it as something to try.


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.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: