Try this in the timer sleep-and-wake cycle lab, where you change the sleep timer in the sketch and see the sleep state and whether a second wake cycle appears in the simulator.
1. Start with the physical story
Current tells us how quickly charge moves. A short, high-current radio burst and a long, tiny sleep current both matter. To compare them fairly, multiply each current by its time. That product is charge. A shunt meter adds a resistor to the supply path, so it also creates a voltage drop that the unmeasured device did not have.
2. Name every algebra move
Find charge in every stateMultiply each state current by its duration: Q=I×t.
Add the chargesQtotal is the sum of boot, warm-up, radio, and sleep charge.
Add the timesTtotal is one complete wake-to-wake cycle.
Divide charge by timeIavg=Qtotal/Ttotal.
Test the measurementVburden=I×Rshunt at both the smallest and largest currents.
Compare the extremes20 log10(Imax/Imin) expresses the current span in decibels.
3. Reproduce the chapter case
T=900.4 s
Iavg=0.02925/900.4=32.5 µA
20 log10(0.120/0.000010)=81.6 dB
At 10 Ω, sleep produces 100 µV, but the radio peak loses 1.20 V. At 1 Ω, the peak burden falls to 120 mV while sleep produces only 10 µV. That is why the chapter changes range between states.
4. Use the result in the design
Choose a safe high-current range first, capture the peak, then use a lower-current range for sleep. Join the records by state and calculate average current from charge, not from a casual screen average.
5. Record the evidence state
Keep the board, firmware, rail voltage, shunt or meter range, state currents, state times, sample rate, and any brownout or reset. A changed range is part of the evidence, not a hidden detail.
6. Check yourself
Why is the cycle 900.4 seconds, not 900?
Why can a larger shunt falsify the result?
Why not average the four current numbers directly?
The arithmetic uses the chapter's named or clearly labelled catalog-typical inputs.
- Catalog currents
- The state currents are example values; measure the actual board.
- Meter bandwidth
- A slow meter may miss a short radio peak even with a safe shunt.
- Battery behaviour
- This ledger does not include cell resistance or regulator loss.
Correct, not complete: the ledger proves the arithmetic and the shunt trade-off, not field battery life.
Battery Bruno guides