I am just looking at Arduino power consumption for a bettery operated device might be and wondering what the best possible target might be in sleep mode. Tests here so far suggest 600uA and wondering if this can be improved upon?
Any thoughts on if this can be improved upon welcome
The ATmega328 datasheet says 0.1µA in Power-Down mode and indeed this can be done.
Note however, that ATmega328 power consumption and Arduino power consumption are two different things. Parts of an Arduino continue to draw current regardless of what the microcontroller is doing.
Hi, Thanks for all the great info folks, very interesting.
Using Nick's code below I was able to get down to 400uA with everything unlugged which suggests the rest is down to the board peripherals?
The board I'm using is this one: http://www.seeedstudio.com/wiki/Seeeduino_Stalker_v2.1 which is a great product but as it is designed for low energy battery use I'm surprised that I cannot get the power consumption down a bit more. I will keep tinkering now I'm much better informed thanks to you folks
#include <avr/sleep.h>
#include <avr/wdt.h>
const byte LED = 9;
void flash ()
{
pinMode (LED, OUTPUT);
for (byte i = 0; i < 10; i++)
{
digitalWrite (LED, HIGH);
delay (50);
digitalWrite (LED, LOW);
delay (50);
}
pinMode (LED, INPUT);
} // end of flash
// watchdog interrupt
ISR (WDT_vect)
{
wdt_disable(); // disable watchdog
} // end of WDT_vect
void setup () { }
void loop ()
{
flash ();
// disable ADC
ADCSRA = 0;
// clear various "reset" flags
MCUSR = 0;
// allow changes, disable reset
WDTCSR = _BV (WDCE) | _BV (WDE);
// set interrupt mode and an interval
WDTCSR = _BV (WDIE) | _BV (WDP3) | _BV (WDP0); // set WDIE, and 8 seconds delay
wdt_reset(); // pat the dog
set_sleep_mode (SLEEP_MODE_PWR_DOWN);
sleep_enable();
// turn off brown-out enable in software
MCUCR = _BV (BODS) | _BV (BODSE);
MCUCR = _BV (BODS);
sleep_cpu ();
// cancel sleep as a precaution
sleep_disable();
} // end of loop
point5:
Using Nick's code below I was able to get down to 400uA with everything unlugged which suggests the rest is down to the board peripherals?
That much could easily be drawn by the voltage regulators, even if you are injecting power downstream from the regulators' output. In addition the RTC spec shows that it draws 100-200uA. The simplest solution for ultra-low power would be a standalone '328 chip. Myself I like to use Sparkfun's Pro-Micro because you don't need a chip socket or PCB, but it requires some minor surgery to cut the trace from the voltage regulator.
Current drawn by an Atmega328p with external 16 MHz Crystal = 13 mA
I did a test. I run the code from here:
on a breadboard having, on it, just an Atmega328p connected with a 16 MHz Crystal and two 22 pF capacitors.
The circuit draws 13 mA from the 5V power source.
simplex: Current drawn by an Atmega328p with external 16 MHz Crystal = 13 mA
That sounds reasonable if you are not using any power-saving techniques. Using code similar to Nick's demo linked above, I could get a 16MHz 5V Arduino down to approx 1uA. My multimeter is not good enough to read these very low currents with any accuracy, so I cannot say if the real current was less than that. The datasheet claims 0.1uA at 3V, and I've no reason to doubt that.
Once you get to a few uA your battery's internal self-discharge will be the dominant factor (and the duty cycle at which you pull higher currents). 1uA ~= 9mAh/year
These are approximations but the general idea is that you don't need to get excited about using less than 1 uA because the battery is going to self-discharge much faster than that, particularly NiMH batteries.
To confirm MarkT's figure, if you use 1 uA then over a year that would be:
I got 8mA with Nick's power sketch J with the same setup sans coin cell (broke, new holder next week). I think that that the Xbee 3v3 regulator is costing an order of magnitude. There are two leds, but I am sure they only cost 10-15mA. I will investigate if they can be disabled other than scrapping. Considering the LiPo and solar option, I am not sure what we are discussing unless the unit is north/south of 80 degrees.
With an internal clock and no regulator/LEDs, I replicated Nick's sleep tutorial +5% of 0.35uA with a breadboard setup. I have not tried just the watchdog, which this SeeedStudio Stalker is capable of (Interrupt traces cut to enable). I am not sure why the Narcoleptic library does not shut the ADC down.
Properly optimized, the coin cell will die before the LiPo gives out.
I could get a 16MHz 5V Arduino down to approx 1uA.
If you could get the avr to run on a 16Mhz crystal with less than 1ua, you should contact Atmel,
Getting an avr to run below 50ua is easy, even on a crystal. Getting it to run below 10ua on a crystal is difficult. Getting it to run below 1ua on a crystal is out of this world.