In my project i want to powerDown (deep sleep)
the arduino pro mini for 2 hours using LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF).
Meaning that waking up every 2 hours ,
taking some sensors measurements and back to sleep.
I dont care to loose some seconds so i decided to NOT use some RTC
and just powerDown for an estimated time.
2 Hour have 2 * 1000 * 60 * 60 milliseconds =7.200.000 millis
So if we have an arduino that wants about 8500 millis to
a)powerDown(SLEEP_8S, ADC_OFF, BOD_OFF)
b)wake up
c)increase the counter of while..and test the while condition
then we need a while to count
(and power down for 8 seconds using powerDown(SLEEP_8S,,,, ))
for 7.200.000 / 8500 = 847 times.
And remaining some millis that we can make a simple delay.
For this purpose i created the following program
in order to give me the TIMESTAMBED output in Arduino IDE
so that i can statistiacally compute how much time
the LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF)
will take.
#include <LowPower.h>///LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);
void setup() {
pinMode(13,OUTPUT);
Serial.begin(9600);
delay(100);
Serial.println("starting");
delay(100);
showForEstimated();
}
void showForEstimated() {
int i = 0;
while (i < 101) {
Serial.println('O');Serial.flush();
//digitalWrite(13,HIGH);delay(23);digitalWrite(13,LOW);
LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);
++i;
}
Serial.println('K');
}
void loop() {
}
After waiting some time to fill the output i am using onother simple java program
(or can do it manually)
to find exactly the statistics .
Now the problem is that
one of my pro mini has an estimated cycle
of 8 seconds power down = 8793 milliseconds (and lets say that this is good)
8793.064 = millis AVERAGE of 8 seconds power down
31 Samples
Sum : 272585.0
min-max : [ 8759 , 8833 ]
Mostly appeared 8778 for 2 times ..
but ONOTHER of pro mini (3.3 version)
has 9033 millis estimated cycle. (too large)
9033.0 = millis AVERAGE of 8 seconds power down
8 Samples
Sum : 72264.0
min-max : [ 9016 , 9053 ]
Mostly appeared 9033 for 3 times
So the question is.
Does any body knows
a)Why the second pro mini needs so much time (9 seconds) ??
...for a powerDown 8 seconds cycle???
b)Why my times are so big?
I was expecting to not be more than 8200 milliseconds
as per the gammon help project for lowpower
(gammon.com.au/power)
"If you are trying to save power, taking 65 mS to wake up, add 1 to a counter, and go back to sleep, is a lot. "