Pages: [1] 2   Go Down
Author Topic: Lowest Arduino Power consumption  (Read 2829 times)
0 Members and 1 Guest are viewing this topic.
UK
Offline Offline
Sr. Member
****
Karma: 0
Posts: 278
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

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 :-)
Logged

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Tests here so far suggest 600uA

That's about 500us too high. It is definitely possible to go below 100us, and south of 50ua.
Logged

UK
Offline Offline
Sr. Member
****
Karma: 0
Posts: 278
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks, thats a big improvement.  Do you know where I can find some code examples to look at and test?
Logged

USA
Offline Offline
God Member
*****
Karma: 14
Posts: 644
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Nick Gammon has done a great job putting together information on ATmega power management over at his own set of forums.
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

http://www.gammon.com.au/power


Under the right circumstances you can get to around 0.35 uA (350 nA).


(edit) Ninja'd by Far-seeker! Yes, that's the place. smiley-wink
Logged

Grand Blanc, MI, USA
Offline Offline
Faraday Member
**
Karma: 93
Posts: 3968
CODE is a mass noun and should not be used in the plural or with an indefinite article.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Do you know where I can find some code examples to look at and test?

BoD usually are some of the biggest current consumers.

all pins to  output high;

disable watch dog;

use internal rc oscillator at the lowest frequency;

disable as much as you can;

go into power saving modes as deep as you can;

...

Logged

UK
Offline Offline
Sr. Member
****
Karma: 0
Posts: 278
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 :-)


Code:
#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
« Last Edit: October 20, 2012, 07:00:47 am by point5 » Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Looking at that board I can't help thinking the other devices are likely to consume power.



The clock, the charge controller, the Xbee (if inserted), and the SD card (if inserted).

I would look at the datasheets for each of those devices and work out what they are likely to consume.
Logged

Switzerland
Offline Offline
Sr. Member
****
Karma: 6
Posts: 375
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 109
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Current drawn by an Atmega328p with external 16 MHz Crystal = 13 mA

I did a test. I run the code from here:
http://arduino.cc/forum/index.php/topic,125248.msg962251.html#msg962251
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.

Logged

Switzerland
Offline Offline
Sr. Member
****
Karma: 6
Posts: 375
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Offline Offline
Shannon Member
****
Karma: 200
Posts: 11718
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

[ I won't respond to messages, use the forum please ]

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Exactly. I have a table on the page I linked above. Here it is:

Code:
Type        Capacity mAH  Discharge %/month   Self discharge (uA)

CR1212            18              1                  0.250
CR1620            68              1                  0.950
CR2032           210              1                  3
NiCD AAA         350             20                 98
NiMH AAA         900             30                375
NiCd AA         1000             20                270
Alkaline AAA    1250              2                 35
NiMH AA         2400             30               1000
Alkaline AA     2890              2                 80
Li-Ion          4400             10                600

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:

Code:
0.000001 * 24 * 365 = 0.00876 = 8.76 mAh
« Last Edit: October 20, 2012, 07:38:17 pm by Nick Gammon » Logged

California
Offline Offline
God Member
*****
Karma: 14
Posts: 629
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged


Pages: [1] 2   Go Up
Jump to: