Some notes on mBuino power consumption

09 Sep 2014

Further to this question: http://mbed.org/questions/4524/mBuino-not-waking-up-from-sleep/ I have checked the power consumption of the mBuino in various modes.

All power numbers are running from 3.0V on the battery input terminals with all LEDs off and no external load connected.

Battery life is assuming a standard CR3032 coin battery.

ModeCurrent drawBattery life in days
Running13mA1.5 (1)
Sleep7mA3 (1)
Deep-sleep480uA43
Power-down120uA170

To enter power down mode use (2):

void myPowerDown() {
    LPC_PMU->PCON = 0x2;
    SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
    LPC_SYSCON->PDAWAKECFG &= 0xFFFFF800;
    __WFI();
}

(1) Actual life will be less than this since capacity drops with current draws over 1mA,

(2) This skips a number of the steps the user manual lists but same steps are skipped by the library code for deep sleep. I've not seen any problems but your mileage may vary.

09 Sep 2014

I was actually wondering about this, since I never could properly measure it on the mbed LPC11u24. It should be less in Power-Down (few micro amps). In general I would advice powerdown over deepsleep, it wakes up a tiny tad slower, but alot less power consumption.

And indeed, it should theoretically do nice with disconnecting PLL, and other targets do it. But it works fine without doing it, and it is a bit handier (otherwise if you wake up with an interrupt handler, that handler is done at the IRC speed instead of PLL speed). Useful numbers :)

10 Sep 2014

The datasheet for the part gives the deep-sleep power as 360uA and the power down power as 2uA. In both cases the mBuino is taking 120uA over that. My guess would be that some other part on the board is responsible for that power draw.

10 Sep 2014

I don't know if there is a schematic available yet, indeed most likely there is something drawing some current.

10 Sep 2014

No schematic that I can find, I've asked on the manufacturers forum.

Looking at the board there isn't a lot on there. A 5V to 3V (or maybe 3.3V) regulator for the USB power input which will be shut down when running off a battery, a couple of diodes, one will be combining the two power sources, not sure what the others are for. A single transistor and then a range of Rs and Cs.

It could be pullup/down resistors, two 47k or four 100k resistors would account for the current.

Once thing I can be sure of, there is no over current protection on the LDO, I blew it up by shorting something while poking around on the board with a meter. Still runs fine off a battery so hopefully all that is needed is a new regulator.

10 Sep 2014

I once accidently short circuited 3.3V of my KL25Z board. The LDO started smoking, which is never a good sign, but it still works :P.

I have seen on the LPC forum also often claims being made that for low power consumption you should not keep pull ups enabled since they consume something like 40uA each, which also was the max pull-up current. So maybe it is true, but to me it seemed more like an urban legend on those forums. For the LPC11u24 I have only the mbed board, which also used more than it should (few hunderd microamps), however that board has many connections, so it is harder to properly measure it.

On the LPC812 and LPC1114 I have measured powerdown power consumptions which matched very well the datasheets, and that was without any special tricks.

17 Sep 2014

Found it.

Powerdown mode now pulls 3uA

Schematics for the board can be found in the link in post 48 of this thread: https://www.ghielectronics.com/community/forum/topic?id=16227&page=5 (update - and now on the platform page here)

Unconfigured GPIO pins default to having the internal pullups enabled. The board has a pull down on pin P0_3. This conflict was causing the extra power draw in sleep mode.

So the full code to get the mBuino to sleep at about 3uA (low enough that in theory battery life is in the decades region) is:

#include "mbed.h"

DigitalIn progMode(P0_3);

void enterPowerDown() {
    LPC_PMU->PCON = 0x2;
    SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
    LPC_SYSCON->PDAWAKECFG &= 0xFFFFF800;
    __WFI();
}

int main () {
progMode.mode(PullNone);

enterPowerDown();
}
15 Sep 2014

@AndyA: Great work! Congratulations and thank you very much!

Trying it out right now and if I still remember I'll check my powerdown-test mBuino next year to see if it still runs on the same battery! :o)

15 Sep 2014

Nice find, then it indeed nicely consumes what it should consume. This is also why I think all deepsleep code should use powerdown (which I also did for those where I wrote the sleep code and it was available): It is just as easy as deepsleep (contrary to deep powerdown, which requires a system reset for wakeup), only slightly slower to wakeup considering the PLL has to start anyway, and alot lower power consumption.

Effectively it will work forever on a single CR2032.

17 Sep 2014

Cool! Thanks for sharing this Andy A.

11 Dec 2014

Should have posted this here ages ago but here it is now: Library handle all the different power modes in a single line of user code. http://developer.mbed.org/users/AndyA/code/mBuino_Sleep/