# Project Power Consumption Calculations

I have built an automated window blind controller that will adjust the angle of a servo based on the value received via a light dependent resistor. Once every 10 minutes the MCU wakes up, gets the current value of the LDR, adjusts the angle of the servo accordingly and then goes back to SLEEP_MODE_PWR_DOWN using the watchdog timer. I am using a 5v 16MHz ATMega168 Arduino Pro Mini as the MCU. I have removed both of the on board LEDs to reduce idle power consumption. I am also powering directly from the VCC pin so that I bypass the on board regulator reducing power consumption even more. I’m trying to determine what is the best battery power option for this project. The project is still in testing but appears to be working as intended.

I have captured the following power consumption readings using an amp meter inline between the power lead during sleep and while the servo is moving to a new angle:

During sleep: approximately 0.70 mA Awake and servo moving: approximately 14 mA

Assuming that the servo will make 4 adjustments each day and that each adjustment will take approximately 2 seconds that equates to 8 seconds each day at 14 mA. The remaining 86,392 seconds will be in sleep mode. So that’s 99.99% of the time in sleep mode and just .01% of the time awake and doing something.

Next, I took the project a step further and created a sketch to mimic the action the servo would take during the course of a normal day and executed that action once every 68 seconds for 24 hours. Essentially every 68 seconds the servo would rotate through the four different pre-programmed positions and then go back to sleep. This equated to approximately 1,270 iterations in a 24 hour period or if I was only getting one iteration a day, close to 3 1/2 years. In between each position I put a three second delay so for approximately 12 seconds each 68 seconds I was pulling 14 mA. For the remaining 56 seconds I was pulling .70 mA. For that 24 hour period I ran power to the Arduino using a 5vdc cell phone wall charger with a power bank capacity tester placed in between the incoming power and the Arduino. The power bank capacity tester has a LCD screen that keeps track of voltage, amps, and mAh.

So, over the 24 hour period, the tester stated that the Arduino used a total of 120 mAh. That does not seem right to me. Am I missing some multiplier? I even put some resistance on the servo (added some weight to increase the current draw) thinking that would increase the amp draw during rotation but the increase was minimal. The most I ever saw the amp reading go up to was .48 amps.

Thoughts? Recommendations? Ultimately, I want to make sure that I use the right type and quantity of batteries to power the project for at least 3 months.

Thanks, Sean

Have a look at Nick Gammon's low power tutorial

If it works from a 4.5v battery connected to the 5v pin (it should) then you avoid the energy losses from voltage regulation.

A barebones Atmega 328 running on its internal 8MHz oscillator is very simple to construct and would run from a 3v battery or from a 3.7v LiPo cell.

...R

darksidekilo6: . . . So, over the 24 hour period, the tester stated that the Arduino used a total of 120 mAh. . . .

120 mAh over 24 hours equals a constant current draw of 5mA (if my maths has not failed me). A Mignon (AA) has a capacity of 2400 mAh. It would last 20 days. You'd need 2 or 3 of these at a time.

6v6gt, thanks for the quick reply.

6v6gt: 120 mAh over 24 hours equals a constant current draw of 5mA (if my maths has not failed me).

The 120 mAh hours was for 1,270 iterations of the loop or 3 1/2 years worth of rotations in a 24 hour period. Realistically, in a 24 hour period I would expect to only have 1 iteration of the loop. So, by way of strict extrapolation of your math, 1 iteration per day should result in the use of 0.095 mAh in a 24 hour period (120/1,270 = 0.095 mAh per iteration). Converting that to constant current draw I get 0.004 mA (0.095/24 = 0.004). Does this look right?

6v6gt: A Mignon (AA) has a capacity of 2400 mAh. It would last 20 days. You'd need 2 or 3 of these at a time.

Using the Mignon (AA) battery with a capacity of 2400 mAh, again using strict extrapolation, should get me about 70 years!!! (2400 mAh/0.095 mAh/day = 25,263 days). That does not seem possible!!! Where is my math going wrong?

Thanks, Sean

darksidekilo6: Where is my math going wrong?

An arduino draws current even when it does nothing. But, as Robin2 said, sleeping can actually reduce the consumption to somewhere in the µA-range.

lg, couka

darksidekilo6: . . . Using the Mignon (AA) battery with a capacity of 2400 mAh, again using strict extrapolation, should get me about 70 years!!! (2400 mAh/0.095 mAh/day = 25,263 days). That does not seem possible!!! Where is my math going wrong? . . .

Just take the constant 0.70mA current draw (ignoring the short servo activity) That is 0.70mAh/h (energy/time = power) So in 24 hours, that is 17mAh. A Mignon AA cell with a capacity of 2500 mAh would last about 150 days before being fully discharged.

Have a look at an online battery life calculator eg: http://www.digikey.ch/en/resources/conversion-calculators/conversion-calculator-battery-life

Just a couple of points: Even when the battery has some remaining life, it would be useless to drive the servos and Arduino. 0.70 mA constant current draw is actually quite high for an ATMEGA328P in powerdown mode. How are you waking it up? Using the watchdog timer ?

Awake and servo moving: approximately 14 mA

Most hobby servos have a startup current of an ampere or so, and consume several hundred mA when moving. What type is yours?

jremington: Even when the battery has some remaining life, it would be useless to drive the servos and Arduino. 0.70 mA constant current draw is actually quite high for an ATMEGA328P in powerdown mode. How are you waking it up? Using the watchdog timer ?

6v6gt, thanks for the reply. Been away from an internet connection for a while so I have not been able to respond. I am using a watchdog timer. Tried to post the complete sketch but it is longer than 9000 characters so the system wont let me post it. Here is just the main loop:

``````void loop()
{
BatteryCheckTimer();
AwakeTimer();
if (BatTimer == BatCheckTime)  //BatCheckTime is set for 8 iterations through the 8 second WDT loop (about 1 minute)
{
doBattCheck();
}

if (ATimer == SleepTime)  //SleepTime is set for 80 iterations through the 8 second WDT loop (about 10 minutes)
{
doWhileAwake();
} //End of Main loop if timer was reached

//Preparing to go to sleep

byte old_PRR = PRR;                              // disable Internal modules//
PRR = 0xFF;                                      // disable Internal modules//

MCUSR = 0;                                       // clear various "reset" flags//

// Watchdog Timer Parameters//
WDTCSR = bit (WDCE) | bit (WDE);                 // allow changes, disable reset
WDTCSR = bit (WDIE) | bit (WDP3) | bit (WDP0);   // set WDIE, and 8 seconds delay
wdt_reset();                                     // pat the dog once program has executed.

// Sleep Activation //
set_sleep_mode (SLEEP_MODE_PWR_DOWN);            //Sleep mode Selection//
sleep_enable();                                  //Sleep Now//

sleep_cpu ();                                    //CPU is now sleeping
// Once awake, code executes from this point. Once CPU wakes up do the follwoing to restore full operations
sleep_disable();
PRR = old_PRR;
}
``````

So, I hooked up a multimeter and set it to monitor current draw. I watched it for 30 minutes and below are the results.

1. Constant current draw is 26.8 microamps.
2. Every minute the sketch wakes up and quickly checks the battery voltage. This process takes less than a seconds and the current draw increases to 38.8 microamps.
3. Every ten minutes the sketch wakes up and checks the LDR sensor. If the sensor reading is different from the last reading the servo moves to a new preset angle. When this happens the current draw increases to about 11 milliamps. I forced a servo rotation during this time period so that I could measure the current draw. However, during the course of a normal day, I would expect the servo to only rotate no more than four times (when the sun is rising, when the sun is at its highest level, when the sun is setting, and finally when the sun is set).

For the last 12 days I have been running the project from a single 18650 3.7v LiPo battery. When I started the battery was at 4.12v. Battery reading today is about 3.68v. Seems to me that the project is draining the battery faster than it should be. I drained the battery and then fully charged it before starting the test so I know the battery is good. I used an inline power bank capacity tester to measure the battery capacity during charge and when it was done it registered 2405 mah.

Here are the components of this project:

1. Arduino pro mini with on board LEDs and voltage regulator removed.
2. LDR sensor with 10k resistor
3. LED with 220K resistor for low battery warning
4. 5v booster converter with on board LEDs removed (used to boost the 3.7v LiPo battery to 5v)
5. Knock-off clone Futaba S3003 servo