Hi there toddh!!
Great job you did for the community with this code. I have been using it quite a lot without problems. :D
But recently, I have been working on a remote water pressure measuring device that needs battery life optimisation. It uses a MPX2010DP differential pressure transducer and a 12V 1.2 Ah battery and it only lasts about 5 days :( .
I have implemented a circuit to monitor the data aquisition, battery voltage as well as a solar panel voltage generation with your code.
I need to log data roughly every 1, 10, 60 min and 24 hrs in some cases.
Looking into the code and the debugging in the serial I found out what seems to be the problem.
When setting up the
- Code: Select all | TOGGLE FULL SIZE
const int StepTime = 60;
Say logging every 1 min the result in the serial/file debugging looks like this
- Code: Select all | TOGGLE FULL SIZE
Logging to: LOGGER18.CSV
Date/time, MPX, Solar-Panel, Batt
1311819062,Sleep for,0.50 ***
"2011/7/28 2:11:3",592.00,627.00,682.00
1311819063,Sleep for,8.00 ***
1311819071,Sleep for,8.00 ***
1311819079,Sleep for,8.00 ***
1311819088,Sleep for,8.00 ***
1311819096,Sleep for,8.00 ***
1311819105,Sleep for,8.00 ***
1311819113,Sleep for,8.00 ***
1311819121,Sleep for,1.00 ***
1311819122,Sleep for,0.50 ***
"2011/7/28 2:12:3",592.00,627.00,682.00
So from this I get that the longest sleep time is actually 8 secs. Then when setting logging times to say 1 hr (3600 sec) the code makes the Arduino wake up about 450 times without any need of it.
Checking out the last part of the code namely the:
- Code: Select all | TOGGLE FULL SIZE
// GoToSleep //
// SetupWatchdog //
// ISR //
// GetSleepTimeIndex //
and
- Code: Select all | TOGGLE FULL SIZE
// GetSleepTime //
parts I see these are the ones control sleep timing and watchdog waking up.
I understand that the
- Code: Select all | TOGGLE FULL SIZE
// SetupWatchdog //
and
- Code: Select all | TOGGLE FULL SIZE
// GetSleepTimeIndex //
code portions control the TimeIndex.
But have not been able to succesfully modify the code according to my needs.
What do I need to change in order to extend the actual sleeping times of the Arduino. Say 1, 10, 30, 60 min and 24 hrs??
Thanks in advance.
:wink: