Question:
Is it possible to use a timer to wake an Arduino once every 5 minutes, regardless of how long the code takes to run? I know I can do this with a hardware interrupt and 555 timer set to pulse once every 5 minutes, but I would rather not add extra hardware.
What I have:
Execute code → Sleep 5m = 5m + execution time for each cycle
What I would like:
Start 5m timer, Execute code and go to sleep, sleep until the 5m timer expires = 5m for each cycle, regardless of execution time
The setup:
I have an Arduino Fio (V2) attached to N number of DS18S20 temperature sensors. The Fio is solar/battery powered and transmits data back home via XBee. The Fio/XBee are set to deep sleep for about 5 minutes between reads. I would like new data every 5 minutes (+/- a few seconds). With the addition of each DS18S20 the sampling time goes up. I am using the Arduino Narcoleptic http://code.google.com/p/narcoleptic/ code to put my Fio to sleep. My current watt draw when asleep is less then any meter I own can read.
My current sleep code is rather dumb
//28 = about 5min including code execution time
for (int i=0; i < 27; i++)
{
Narcoleptic.delay(10000);
}
Any ideas on how to do this with out adding hardware?