Pico power consumption down to 0.02mA

Posted on
of 2
/ 2
  • Firmwares from this one on (so 1v81 and later) are now able to properly power down USB when in Deep Sleep.

    This drops power consumption from 0.25mA down to 0.02mA - so a pretty massive change that should really help with battery life. For instance a single CR2032 watch battery should now power the Pico for around a year.

    To enable it, all you need is the usual setDeepSleep:


    And unlike the Original board, the Pico's wake up timer is accurate to 1/32768 of a second, so it can re-enter deep sleep even when there are relatively short intervals (the original board could only handle this if the interval was greater than around 2 sec).

    Let me know if you hit any problems - tests so far have been good though.

    The board itself is capable of getting even lower power consumption, so hopefully a few more firmware tweaks and we can get under 0.01mA.

  • ... and this was near the bottom of your priorities... 24hrs ago?!

    Thoroughly impressed!

  • when I know people actually want to use a feature it rises up my list quite fast - especially if it's one I promised it'd have in the KickStarter.

    ... but actually I looked at it again, and given a few months break it turned out not to be as hard as I'd imagined :)

  • @Gordon this great news & 0.01mA would put very close to a deep-sleeping electricimp

  • I just tried to flash my new pico with this firmware and while everything says it loaded fine when I plug it back into my macbook pro the red led stays on and the serial port no longer shows up. I can flash back to 1.80 and everything is fine.

    Figured it out.

  • Nice! Thx a lot Gordon.

  • @Gordon for clarification is deep sleep consumption of 0.02mA true for the Original board?

  • Yes - the Original board has had good power consumption since the original KickStarter boards were sent out. I've got 0.03mA on the Power Consumption page, but I try and be a bit pessimistic with my figures.

  • Hi everybody...
    Sorry but I can't find the firmware 1v81 as mentioned above. The power consumption of my Pico is about 2mA @3.7V. Have you an idea ?
    Thank you for your answer

  • Hi Gerald, which version of firmware do you currently have installed? The latest version (currently 1v85) should have all the changes from 1v81 in it.

    Also, do you have anything connected to the board? Other devices (eg, WS2812 LEDs) can really push the power consumption up, even when off.

  • Hi Gordon and thank you for your answer. When I download the firmware with the "standard mode" of Chrome IDE, I notice a consumption of about 1mA. When I download the 1v85 from the link http://www.espruino.com/binaries/espruin­o_1v85_pico_1r3_wiznet.bin I have a consumption of 12mA. My board "Pico" is all naked and just connected on a LiPo. Have you an idea ?

  • What JavaScript are you uploading to it? By default, when no software is uploaded or deep sleep is disabled (the default) it'll go into normal sleep (around 12mA) - so that sounds like what is happening.

    Did you use save() to save the code to it? If not, it'll start up without any software on it, which will cause it not to deep sleep and to draw 12mA again.

  • Yes, I saved the code with save(). The code is :

    setInterval(function() {
      digitalWrite(LED1, 1);
      setTimeout(function () {
        digitalWrite(LED1, 0);
      }, 20);
    }, 10000);
  • I just uploaded exactly that code to a board with 1v85 on it, and it reads 16.5uA (0.0165mA) on my meter (but actually even touching the pins can cause that to go up to 0.5mA - I think because interference starts to toggle the GPIO hardware).

    Actually thinking about it, the problem might be how you are powering the Pico. Which pins did you connect the battery to? If it's to the USB port, Espruino will think USB is connected and will keep the USB hardware powered up.

    You'd need to connect the battery between Bat and Gnd (opposite sides of the board, near USB), or to a JST connector soldered onto the bottom of the board where the outline is.

  • I use the pins Bat and GND as mentionned... More precisely, I tested with GND and VBAT and another test with GND and BAT_IN. Maybe the board is OUT... I'll try with another one.

  • I tried with another board : always the same consumption of about 1mA. But if I put all the pins as "output" the consumption is about 500uA... rather higher than your value... Have you an idea ?
    The setup :

    • Pico : 1.4
    • Firmware : from Chrome IDE or from Github 1.85 (no difference)
    • Vcc = 3.7V (GND and VBat)
    • 4 - 5mV on a 10Ohms resistor (400 to 500 uA)
    • 100nF Low ESR on wires to the board

    Thank you for your answer !

  • Have you tried just using a meter in current measuring mode rather than going across a resistor? I put a big (47uF) across it just to make sure any spikes are levelled out.

    I did try just now with a Pico 1.4 (I'd been using a Pico 1.3 before) plugged into breadboard and the power consumption seemed a lot higher as you say (in the 0.5mA range).

    However, after having put all the pins into input mode and then connected them to ground (not B6/B7 as these default to serial when USB is unplugged) I get back down to 30uA

    setInterval(function() {
      digitalWrite(LED1, 1);
      setTimeout(function () {
        digitalWrite(LED1, 0);
      }, 20);
    }, 10000);

    Maybe someone else could give theirs a go?

    I'm still really confused about why my 1v4 and 1v3 should be behaving differently though. The circuit itself is the same on the two revisions (just with the addition of a fuse, which isn't used for battery power).

  • Very strange... I tested with your code, pulling down all the inputs as mentioned above (but not B6/B7 and with a 47uF)... and the consumption is about 700uA (measured with an A-meter).

  • On both Picos? I've tried 4 now, 1v3 and 1v4, running 1v85 firmware, and have (with the pins pulled down) got good results off of all of them.

    Do you think you could post up a picture of your setup - I'm sure it's fine but I might not be thinking of something that's different.

    How do you put the software on? I've been setting the whole thing up with the current measurement, plugging in to USB, writing the code, and then unplugging USB. Usually the board won't sleep properly immediately - you might have to wait until the LED flashes once before it goes back to proper deep sleep.

    The final thing is to try and clean the boards with a board cleaner like isopropyl alcohol - salt from hands (or deposits if you soldered the pin headers yourself) could easily add fractions of a milliamp to the power draw.

  • OK... if I connect all the pins and the battery, I plug the USB, I download the code and I unplug the USB, I mesure a consumption of about 10 to 20 uA. The problem now is if I disconnect and reconnect the battery, the consumption rises up to 700uA ! Could you try my first test ? You program the board via USB, you disconnect it, you connect the board on the breadboard and to the battery. In these conditions you should get about 700uA... If so, have you an idea to maintain the consumption at 20uA even if the battery is disconnected and reconnected ?

  • Ok, I'll take a look.

    Is the Pico still working when it's drawing 700uA? When it starts it'll end up drawing maybe 30mA for a fraction of a second, so if what you're using to measure power draw can't supply that, it might be the voltage to the Pico drops and it actually fails to start properly?

  • Yes, the Pico still works with 700uA. It seems that an IO is in an undefined state (the state is momentary fixed with the USB and undefined at start with the battery).

  • Hi Gordon,

    Have you some news about this problem of consumption ?

    Best regards

  • Hi Gerald,

    Sorry for the delay - I've just reproduced and fixed this. If you wait a few minutes you should be able to flash the latest build from http://www.espruino.com/binaries/git/com­mits/master/, which will have this fixed.

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

Pico power consumption down to 0.02mA

Posted by Avatar for Gordon @Gordon