1.7 mAA0CPUI/OWDTATmega328P010101pin 21void loop() {2 measure();3 armWakeups();4 sleep_mode();5}ActiveIdlePwr-savePwr-downz z zIRQLOWA0
Back: the node's board (microcontroller with its clock lamps, battery, sensor, button)Front: the firmware card and the ladder of sleep modesLamp on = that clock is ticking; tokens: interrupts and a sensor readingA battery sensor node: an ATmega328P with its three clocks shown as lamps (CPU, I/O, watchdog), a battery that reads the current, a sensor and a button, the firmware's loop() and a ladder of sleep modes. Each deeper mode stops more clocks: 1.7 mA awake, 0.3 mA in Idle, 4.2 µA in Power-down with the watchdog on (0.1 µA with it off). The watchdog's interrupt after about 8 s, or a LOW level from the button, wakes the chip, which carries on after the SLEEP instruction. Awake 2 ms every 8 s averages about 4.6 µA.

Sleep modes

  1. At 4 MHz and 3 V an awake ATmega328P draws about 1.7 mA. Three clocks tick: the CPU clock, the I/O clock for timers and serial, and the watchdog's own oscillator. Every tick costs a little charge, even inside delay().

Sleeping and waking

The catch and the payoff

What happens

;; step 1/9 · awake
chip     ATmega328P, 4 MHz, 3 V  (datasheet Table 29-8, typical)
active   1.7 mA
clocks   CPU on · I/O on · WDT on
delay()  waits awake: the clocks keep ticking

All currents are typical values from the ATmega328P datasheet (DS40002061B, Table 29-8) at 25 °C and 3 V, with Active and Idle at 4 MHz. They are for the bare chip with unused modules switched off. A whole Arduino Uno board draws far more, because its regulator, USB chip and power LED stay on, so low-power nodes use a bare chip or a stripped-down board. The 2 ms awake time is an assumption for the example, not a measurement. The year figures assume the pattern repeats all year at 25 °C; how long a real battery lasts is the subject of the lesson "Power budgets and battery life".