Sleep modes
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().
A sleep mode switches clocks off. Idle stops only the CPU clock. Timers, serial and the ADC (the voltage reader) keep running, so almost any interrupt wakes it: a signal that pulls the CPU into a short routine. About 0.3 mA.
Power-down stops every clock but the watchdog's: 4.2 µA, about 400 times less than awake. With the watchdog off too: 0.1 µA. Power-save keeps only Timer2 on its 32 kHz crystal, watchdog off: 0.9 µA. Fewer clocks, fewer ways to wake.
Sleeping and waking
setup() chose SLEEP_MODE_PWR_DOWN. sleep_mode() sets the sleep-enable bit and runs the SLEEP instruction. The clocks stop and the CPU halts right on this line. SRAM and registers keep their values; no code runs at all.
armWakeups() set the watchdog to interrupt mode. It counts its own 128 kHz oscillator: after 1,048,576 ticks, about 8 seconds, it raises an interrupt, and the interrupt wakes the chip.
The chip waits for its clock to settle, plus four cycles, then runs the interrupt routine, ISR(WDT_vect). Then it carries on after the SLEEP instruction: sleep_mode() returns, loop() starts again and measure() reads the sensor.
A button on pin 2 also wakes it. In Power-down a pin can wake the chip only with a LOW level on pin 2 or 3, or a pin change: not a rising or falling edge. The token is that LOW level.
The catch and the payoff
In Power-down the I/O clock is off, and so is Timer0, which counts millis(). Each 8 s sleep is missing from millis(). Serial data cannot wake the chip either: bytes that arrive while it sleeps are lost.
Say measure() takes 2 ms, then it sleeps 8 s. The average is about 4.6 µA, 370 times less than staying awake: about 41 mAh a year instead of 14,892. The watchdog's 4.2 µA is now most of the bill.
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".