Não foi um tuturial feito por mim, mas penso que está seja a melhor categoria para a informação.Watchdog and Sleep functionsThis example shows how to make use of the Watchdog and Sleep functions provided by the ATMEGA 168 chip . These functions are useful if you want to build low power consuming devices operated by battery or solar power.
The reduced power consumption is achieved by through a intermittent operation of the system .In case of Arduino your main loop will be executed once before the system is put into the sleep mode. After a few seconds t the watchdog wakes the system up and the main loop is executed again. The ratio between main loop execution time and watchdog time determines the amount of power that will be saved.
When we assume that the time to measure a sensor and making some decisions will take 10 millisecond and the watchdog is set to 8 seconds the on/off ratio is 800 which extends the battery live time by this factor.
Battery live time calculationNow we want to know long we can operate our device with standard alkaline AA Cells. These Cells even the cheap ones provide between 2000 ad 3000 milliamps per hour (mA/h). We assume our system takes 20 mA when operating and 0.05 mA when sleeping.
In normal operation with a current of 20mA the battery will last 2000/20 =
100 hours or about 4 days.
In intermittent operation with a factor of 800 the operating current is reduced to 20mA/800 = 0.025mA plus the current that is drawn in sleep mode 0.05mA.
Now with 2000/(0,025+0,05)
we come to 27000 hours lifetime which is about 3 years.
Basicamente o codigo mete o arduino em sleep por 8segundos ao fim de cada execução do loop, permitindo um aumento signficativo na duração na duração da bateria, claro que tambem vai depender de projecto para projecto.
Ainda não vi o codigo todo, mas penso que seja possivel mudar o valor dos 8seg para mais. Já que no ficheiro pde de exemplo os 8seg é o valor maximo.
E ainda têm no site, o esquema do mini-Arduino usado pelo autor.
Com o Arduino "normal" já não vale muito usar estas funções porque o regulador de tensão que vem nas board's usa cerca de 10mA em idle.
Site:
Lab3 - Laboratory for Experimental Computer ScienceArduino.cc