I try to use power down mode to extend battery life, but no matter what sleep library I use, the power consumption never goes below 3.4-3.6 mA. I'm using a chinese pro mini board with VCC input (but using the RAW results the same).
avr/power sketch:
#include <avr/power.h>
#include <avr/sleep.h>
void setup()
{
Serial.begin(9600);
byte i;
// Ensure no floating pins
for(i=0; i<20 ; i++)
{
pinMode(i, OUTPUT);
digitalWrite(i, LOW);
}
// Power-down board
set_sleep_mode(SLEEP_MODE_PWR_DOWN);
sleep_enable();
// Disable ADC
ADCSRA &= ~(1 << ADEN);
// Power down functions
PRR = 0xFF;
// Enter sleep mode
sleep_mode();
}
void loop()
{
}
rocketscream/Low-Power sketch:
#include <LowPower.h>
void setup() {
}
void loop() {
LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);
}
-
How are you powering it?Ignacio Vazquez-Abrams– Ignacio Vazquez-Abrams2015年09月12日 08:11:37 +00:00Commented Sep 12, 2015 at 8:11
-
Using a 5V YwRobot breadboard power supply with VCC pin or a 9V battery with the RAW pin. Both are the same.Ilyasviel– Ilyasviel2015年09月12日 08:14:35 +00:00Commented Sep 12, 2015 at 8:14
-
Are you measuring the current before or after the breadboard power supply?Majenko– Majenko2015年09月12日 09:46:44 +00:00Commented Sep 12, 2015 at 9:46
-
1After. Meanwhile I realized that the power led is always on even when the board is sleeping so I guess thats causing the power usage. I'll try to remove it and test again.Ilyasviel– Ilyasviel2015年09月12日 10:23:19 +00:00Commented Sep 12, 2015 at 10:23
-
There is also a voltage regulator on that board, that has some quiescent current.Gerben– Gerben2015年09月12日 12:49:42 +00:00Commented Sep 12, 2015 at 12:49
1 Answer 1
I tried your first sketch on my "bare-bones" board.
With the sketch exactly as written, it used 197 μA.
I wondered why it was that high, so I commented out this line:
Serial.begin(9600);
That reduced consumption to 122 nA.
See Power saving techniques for microprocessors.
You need to get rid of any "power" LEDs, and disconnect any voltage regulators. If you want really low consumption you need to have minimal hardware.
Of course, if you need the voltage regulator, well so be it. But don't expect 100 nA consumption if you use it.