Deep sleep draws 0.9mA

Posted on
  • I have a Pico connected to a wifi module through a shim and an e-ink display, and it's all powered by 3 AA batteries. This setup wakes up every hour to fetch data and refresh the e-ink display. The code is here. Unfortunately the batteries only last about two weeks, which is a lot shorter than I expected. I've measured the power draw using a cheap multimeter, and it draws about 90mA when the wifi is active, 20mA when refreshing the e-ink display, and 0.9mA when idle. I've set it to deep sleep, I disable the wifi and power down the e-ink display, but that is still too much power consumed, IMO.

    I'm wondering if the serial connection could possibly consume some power, through pull up/down resistors? Or maybe it's the voltage regulator? Any other tips to limit power consumption?

  • Hi,

    The Pico + ESP01 module shouldn't draw that much power in deep sleep. What's the power draw if you upload no code at all apart from setDeepSleep(1)? And what if you disconnect the eInk display?

    On STM32 when you do setDeepSleep it should shut off the Serial port automatically, but as you say there could be pullups... Since Serial will automatically want to pull the pin up, but if ESP8266 is off, it may be being parasitically powered through those serial pins.

    Maybe when you're not using the ESP8266 you could turn it off and then do;; to set both the serial port pins to inputs?

  • I tried with this program:


    It draws a steady 312uA. When I change the commented line so that B9 is input it draws 89mA, so it seems like the wifi chip is enabled then. Probably there is some charge left that isn't drained, leaving it on (my guess here). This is with the e-ink display disconnected.

    I tried a few different things but couldn't get it below 300uA. Unfortunately I managed to short my cheap multimeter, so now it's not saying anything at all...

  • Ok, great - that's a bit better I guess. So are you using an ESP01 with the shim?

    So that's using A2 and A3 for serial. You could try A2.mode("input");A3.mode("input"); and see if that helps at all?

    A0, A10 and A1 are also connected and you could try setting those to inputs.

    Unfortunately I managed to short my cheap multimeter, so now it's not saying anything at all...

    That can always be a pain if yoy leave your meter in current measurement mode - I've lost track of the times I've done it :) but if you open it up there's usually a fuse inside that you can replace (because it is so common to do).

  • So I've been trying this again, and I have a plausible explanation. Apparently the ESP01s had pull-up resistors on three pins, including the ch_pd. This is a 12k resistor, which means that when I connect to ch_pd to ground it draws 3.3v / 12kohm = 0.275mA! The ESP01 (without the s) does not have this pull-up resistor, it's only there is the newer s version. I'll try to de solder it and see how that affects it.

    (yes, I bought a new more advanced multimeter)

  • yes, I bought a new more advanced multimeter

    ouch, BTW it happened to me too, fortunately I found pack of 20 fuses for my multimeter (10 for 600mA and 10 for 10A range) on aliexpress for ~2USD so I am ready when it happens again :-)

  • Yup, removing the pull up resistor from the esp01s helped! I unsoldered the resistor circled in the attached image, and now the device deep sleeps with a current of 30uA!

    1 Attachment

    • 20231115_204301~2.jpg
  • and now the device deep sleeps with a current of 30uA!

    Nice! At first I was a bit confused which device you put to deep sleep - Pico or esp8266 but after re-reading it is clear - you put Pico to deep sleep and turn esp8266 off by pulling CH_PD down.

    Looks like the ESP AT firmware can deep sleep too so maybe that would work too without removing resistor and pulling CH_PD low­at/en/release-v2.1.0.0_esp8266/AT_Comman­d_Set/Basic_AT_Commands.html#cmd-GSLP
    So instead of pulling CH_PD one would send the AT command to sleep and toggle RST to wake it up. However I suppose this is more complicated and would draw a bit more (~20uA) so would be useful only if one has ESP01S and really does not want to remove the resistor.

  • Thanks! A picture really does make a huge difference! Do you think it's something that's worth adding to ?

  • I doubt many others will need this, but hopefully they will find this thread and figure it out.

  • Just a quick follow up to note that now things are working very well, almost too good. When the espruino pico is in deep sleep and I remove the battery it doesn't reset, it continues to run for a short while, probably purely on the charge left in the capacitors! This unfortunately makes it hard to reset the device, which I sometimes have to do. I haven't checked how long it can run without batteries, but at least a few seconds.

  • That's great! Really good to know :)

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview

Deep sleep draws 0.9mA

Posted by Avatar for MariusGundersen @MariusGundersen