Let your Arduino get enough sleep

The sensor I am building is based on an Arduino Pro Mini (Atmega328p) with ESP8266 wifi module and a sensor. It will run on batteries with a sample rate of 1 sample per hour. With such low sampling rate it is very obvious that I need to make my microcontroller and the wifi module sleep to reduce power consumption. To wake up the Atmega328p MCU from power down sleep I have to use either the Watchdog Timer (WDT) or an external interrupt. The problem with the WDT on that MCU is that the maximum sleep time it supports is 8 seconds. And to make it sleep longer you need to put the sleep statement in a loop that puts it back into sleep until it reaches a certain count value then resume working.

This is an example of such solution:

for (int i = 1; i <= count ; i++) {
    sleep_cpu ();
}

However, in 1 hour of needed sleep the MCU will wake up 450 times!

Continue reading “Let your Arduino get enough sleep”