mBed only runs 4.5 hours on 3 x AA ? is that right ?

28 Nov 2010

Hi all,..

wired mBed up to an SE95 temp sensor.

set the RTC, and have it logging to the filesystem.

I get this nice graph, but as you can see 3x Brand New AA's last about 4.5 hours.

second time I've tried it, 4xAA's don't last much longer.

so, is this what you'd expect ? If it's right, then it's right.. I just want to know if that's normal, and what's the best way to power it away from my PC.

(this was out in my shed this afternoon, I was hoping to leave it overnight!)

cheers

Dave.

  

28 Nov 2010 . Edited: 28 Nov 2010

There's a table listing power consumption of the mbed versus what peripherals are on/off and what sleep state is in effect.

Doing no sleeps, I recall that the mbed consumes close to 200mA. So compare that load to the capacity of various batteries (amp-hours or AH).

Let's take your 4.5 hours and 3 AAs. They're in series so the capacity is that of a single AA. Common AA alkaline are about 2000 mAH (milli-amp-hours). So 2000/200 = 10 hours. If the AA's are instead 1500mAH, it would be 7 hours.

But, the issue is voltage droop in the batteries versus the headroom needed by the 3.3V regulator. The AH rating of batteries doesn't seem to be standardized in terms of voltage droop - kind of oriented to old flashlight bulbs which still produce some useful light at 25% voltage.

But look at using the sleep functions of the LPC.

28 Nov 2010

Many thanks..

I've been wiring it to a car battery usually and an LM7805, which means it last for weeks ;-)

It probably didn't help that it was -2 out there I suppose ?

I just didn't know how long AA's last on this sort of electronics, so didn't know if I had a problem.

thanks...

28 Nov 2010 . Edited: 28 Nov 2010

cold weather ruins batteries, so whatever figure you have for how long it should last using the battery ratings is a overestimate.

voltage regulators also cut out at a certain input voltage, so you might not be able to use the full 'charge' of the battery, depending on how temprature and use affects the output voltage.

I'd go with 4.5 hours at -2 as correct.

02 Dec 2010

The mbed link processor seems to draw quite a lot of power, so I suspect the deginers were not trying to optimize the device as a whole for low power.  A similar device (using an STM ARM chip) I've been using (see http://speleotrove.com/avionics/) uses 15mA basic, 5mA for the LCD screen, and 35mA for the GPS sensor.  As a result it runs for 9+ hours from a single AA battery.

See also: http://mbed.org/forum/mbed/topic/555/?page=1#comment-2769

Mike

 

02 Dec 2010 . Edited: 03 Dec 2010

http://mbed.org/users/simon/notebook/interface-powerdown/ has new firmware that turns off the "magic" USB interface chip allowing the mbed to use the low power sleep modes. If you are running off limited power (i.e., Solar, Wind, Battery), you will want to check it out. Someone thought in another forum post that the "magic" chip is actually another ARM processor. It keeps the mbed main processor in debug mode for the USB drive style interface. So if that is all true - you should save quite a bit of power by turning it off when on battery power (assuming no USB needed). I think you need to be out of debug mode for the really low power sleep functions. It seems to save 30-40MA without going into Sleep modes when you call the new firmware magic chip powerdown function.

http://mbed.org/users/no2chem/notebook/mbed-power-controlconsumption/ has some info on power and some functions to save power. PHY_PowerDown() also saves another 30-40MA (if you don't need Ethernet)

 

03 Dec 2010 . Edited: 03 Dec 2010

So with the two ideas above, I ran a test and it would just about double battery life to do this

 

 

#include "mbed.h"
#include "PowerControl/PowerControl.h"
#include "PowerControl/EthernetPowerControl.h"
// Need PowerControl *.h files from this URL
// http://mbed.org/users/no2chem/notebook/mbed-power-controlconsumption/

#define USR_POWERDOWN    (0x104)
int semihost_powerdown() {
    uint32_t arg;
    return __semihost(USR_POWERDOWN, &arg);
}

DigitalOut myled1(LED1);
DigitalOut myled2(LED2);
DigitalOut myled3(LED3);
DigitalOut myled4(LED4);
int main() {
    int i;
    int count=0;
    int result;
// Normal power level around 690mW
    count = 1;
// If you don't need networking...
// Power down Ethernet interface - saves around 175mW
// Also need to unplug network cable - just a cable sucks power
    PHY_PowerDown();
// If you don't need the PC host USB interface....
// Power down magic USB interface chip - saves around 150mW
// Needs new firmware (URL below) and USB cable not connected
// http://mbed.org/users/simon/notebook/interface-powerdown/
    result = semihost_powerdown();
// Power consumption is now around half
    while (1) {
        for (i=0; i<3; i++) {
            count = count<<1;
            myled1 = count & 0x01;
            myled2 = count & 0x02;
            myled3 = count & 0x04;
            myled4 = count & 0x08;
            wait(0.0625);
        }
        for (i=0; i<3; i++) {
            count = count>>1;
            myled1 = count & 0x01;
            myled2 = count & 0x02;
            myled3 = count & 0x04;
            myled4 = count & 0x08;
            wait(0.0625);
        }
    }
}


Could save some more power by replacing wait() with Sleep(). I have not seen an example showing how to use the RTC to wake up from sleep yet, but that should save some more power.