Capstone · #19 of 20
Power Budget + Measurement
Calculating Battery Lifetime
Why it matters
Power budget tells you if your design will work. Without it, you’re guessing how long the battery will last.
The idea
What Is a Power Budget?
A power budget calculates total energy consumption:- Active mode: Current × time
- Sleep mode: Current × time
- Total: Sum of all modes
- Battery capacity: Total energy available
<h3>Typical Values</h3>
ESP32 power consumption:
<ul>
<li><strong>Active (Wi‑Fi off)</strong>: ~40mA</li>
<li><strong>Active (Wi‑Fi on)</strong>: ~80mA</li>
<li><strong>Deep sleep</strong>: ~10µA</li>
<li><strong>Wi‑Fi transmit</strong>: ~170mA</li>
</ul>
<h3>Calculation</h3>
For 5-minute cycle:
<ul>
<li>Active: 80mA × 3s = 240mAs</li>
<li>Sleep: 10µA × 297s = 2.97mAs</li>
<li>Total: ~243mAs per cycle</li>
</ul>
<h3>Battery Lifetime</h3>
For 2000mAh battery:
<ul>
<li>Capacity: 2000mAh × 3600s/h = 7,200,000mAs</li>
<li>Cycles: 7,200,000 / 243 ≈ 29,600 cycles</li>
<li>Lifetime: 29,600 × 5min ≈ 103 days</li>
</ul>
<h3>Measurement</h3>
Use multimeter in current mode:
<ul>
<li>Break circuit (series measurement)</li>
<li>Measure active current</li>
<li>Measure sleep current (may need µA range)</li>
<li>Verify calculations</li>
</ul>
Demo
Adjust Active Current, Active Time, Sleep Current, and
Sleep Time to see how battery lifetime changes.
Watch for:
- Total energy per cycle — lower is better
- Battery lifetime — days/months/years
- Impact of active time — reducing active time dramatically improves lifetime
Key takeaways
- Power budget = sum of (current × time) for all modes
- Deep sleep is essential — 10µA vs 80mA active
- Minimize active time to maximize battery lifetime
- Measure actual current consumption to verify calculations
Going deeper
Real-world power consumption varies with temperature, battery age, and component tolerances. Always add a 20–30% safety margin. For production, use a power profiler (like Nordic Power Profiler) to measure actual consumption. Consider battery self-discharge (~5% per month for LiPo).
Math details
Power budget formula:
E_cycle = (I_active × t_active) + (I_sleep × t_sleep)
Where:
E_cycle = energy per cycle (mAs)
I_active = active current (mA)
t_active = active time (s)
I_sleep = sleep current (µA, convert to mA)
t_sleep = sleep time (s)
Battery lifetime:
Cycles = Battery_capacity (mAs) / E_cycle
Lifetime = Cycles × Cycle_time
Example:
I_active = 80mA, t_active = 3s → 240mAs
I_sleep = 10µA = 0.01mA, t_sleep = 297s → 2.97mAs
E_cycle = 243mAs
Battery: 2000mAh = 7,200,000mAs
Cycles = 7,200,000 / 243 = 29,600
Lifetime = 29,600 × 5min = 148,000min = 103 days