School/✦ Research Engineer/Week 24
Energy budgets and duty cycling
A soil sensor must run for two years on two AA batteries. It can only be awake about one second in every hundred. How do you design for that?
About 45 min · 3 goals · Checked by automated tests
1.Why should I care?
Most deployed sensors, wearables and remote robots are energy-limited, not speed-limited. Duty cycling (sleep almost always, wake briefly) is the most powerful technique there is, and simple arithmetic tells you where every microjoule goes.
- ◇ Compute average power of a duty-cycled device from active and sleep power.
- ◇ Estimate battery life and identify which state dominates the energy budget.
- ◇ Compare energy per operation across computing choices and design a schedule that meets a lifetime target.
2.Predict
A node draws 10 mW for 10 ms every second and 5 µW asleep. What dominates its average power?
Guess first. Being wrong here is how the surprise works.
3.Understand
Energy, not power
Batteries store energy (joules, or watt-hours). A task's cost is power × time, so a fast, power-hungry processor that finishes quickly and sleeps can use less energy than a slow, frugal one. Always compare energy per task.
Know your states
Real nodes have more than two states: deep sleep, wake-up (oscillator start, can be costly), sensing, computing, and radio transmit (often the most expensive per second). Measure or look up each, build a timeline, and add up the energy. The biggest slice is where design effort should go.
Computing less, or locally
Sending raw data by radio can cost far more energy than processing it locally and sending a short result. This is a key argument for embedded ML: a tiny on-device classifier that transmits only 'event detected' can extend battery life enormously, provided its own energy and false alarms are counted.
Explain it another way
A lighthouse that flashes for a moment every ten seconds uses far less than a lamp left on, yet ships still see it. Most of the time, being off is the job.
Microcontrollers offer several low-power modes trading wake-up latency against sleep current; real-time clocks and wake-up interrupts schedule activity. Peripherals and pull-up resistors left on are common hidden drains.
P_avg = D·P_on + (1 − D)·P_sleep. Sensitivity: ∂P_avg/∂D = P_on − P_sleep ≈ P_on. Halving t_on halves the active contribution; halving P_sleep matters only when (1 − D)·P_sleep is comparable.
Wildlife trackers and environmental monitors are commonly designed to run for months to years on small batteries by sleeping almost always and waking briefly to sense and transmit.
Derivation: Average power and battery life
Over one period T, the node is active for t_on and asleep for T − t_on. Duty cycle D = t_on / T.
Energy per period E = P_on·t_on + P_sleep·(T − t_on). Average power P_avg = E / T = D·P_on + (1 − D)·P_sleep.
Battery energy ≈ capacity (Ah) × voltage (V) × 3600 J. Lifetime ≈ E_battery / P_avg (ignoring self-discharge and temperature).
As T grows, D → 0 and P_avg → P_sleep: sleep power sets the ceiling on lifetime.
Example: P_on = 15 mW, t_on = 20 ms, T = 10 s, P_sleep = 3 µW: D = 0.002, P_avg = 30 + 3 ≈ 33 µW. Two AA cells (about 2.5 Ah at 3 V ≈ 27 kJ) last about 26 years by this ideal sum; self-discharge will end them much sooner.
Worked example 1
A node wakes every 30 s for 50 ms at 24 mW and sleeps at 4 µW. Average power and life on a 1,000 mAh, 3.6 V cell?
D = 0.05/30 = 0.00167. Active: 24 mW × 0.00167 = 40 µW. Sleep: 4 µW × 0.998 ≈ 4 µW. P_avg ≈ 44 µW. Energy = 1 Ah × 3.6 V × 3600 = 12,960 J. Life ≈ 12,960/44×10⁻⁶ s ≈ 2.95×10⁸ s ≈ 9.3 years (ideal).
Common mix-ups
- The lowest-power processor gives the longest battery life.
✓ Energy per task decides it: a faster chip that sleeps sooner can win. - Battery life = capacity ÷ active current.
✓ Use average current over the whole duty cycle, and allow for self-discharge, temperature and ageing.
4.Discover
In the Code Lab, model a sensor node as a list of states (sleep, wake-up, sense, compute, transmit) each with a power and a duration. Compute energy per cycle, average power and battery life. Then vary the wake interval from 1 s to 10 min and plot battery life. Where does the curve flatten, and why?
Can't use the interactive? Read a description instead
The derivation shows P_avg = D·P_on + (1 − D)·P_sleep. A node waking every 30 s for 50 ms at 24 mW and sleeping at 4 µW averages about 44 µW and would last about 9 years on a 1,000 mAh, 3.6 V cell in this ideal model.
5.Checkpoint: guided practice
Check what you just discovered before going on. Hints appear after a wrong answer.
Practice 1 · a fresh version every time
A sensor node wakes every 5 s, runs for 2 ms at 30 mW, and sleeps the rest of the time at 10 µW. What is its average power in microwatts (µW)?
6.Practice on your own
Practice, not a test. Wrong answers get a hint and another try.
Practice 2 · a fresh version every time
A sensor node wakes every 2 s, runs for 50 ms at 5 mW, and sleeps the rest of the time at 1 µW. What is its average power in microwatts (µW)?
Practice 3
A device averages 50 µW from a battery storing 10,000 J. Ignoring self-discharge, how many days will it last?
Practice 4
A node's average is 200 µW active + 3 µW sleep. Which change helps most?
Practice 5
Core A runs a task in 2 ms at 30 mW; core B takes 10 ms at 8 mW. Both sleep afterwards at the same power. Which uses less energy for the task?
7.Apply it
Design a duty-cycle schedule for a gesture-detecting wristband that must last 14 days on a 150 mAh, 3.7 V cell. Use the inference energy you estimated in week 23, add sensing and a radio message per detected gesture, and show the budget table with every assumption labelled.
8.Reflect
Concepts: Electrical power and energy budgets · Real-time computing on robots · Embedded machine learning