Hands-On Exercise: Calculate Battery Life with Real Power Measurements
Hands-On Exercise: Calculate Battery Life with Real Power Measurements
Objective: Apply integrals (energy budgeting) and exponentials (battery discharge curves) to estimate how long an ESP32 sensor will run on two AA batteries.
Given Data:
- Battery capacity: two AA alkaline = 2,000 mAh at 3V (6,000 mWh total energy)
- ESP32 power states:
- Active (Wi-Fi transmit): 160 mA for 2 seconds
- Light sleep: 0.8 mA for 58 seconds
- Measurement interval: Every 60 seconds
Step 1: Calculate Average Current (from Section A.2, Integrals)
Using the duty cycle formula from Quick Reference:
Where D = duty cycle (fraction of time): - (3.3% of time) - (96.7% of time)
Step 2: Calculate Battery Life
Step 3: Account for Battery Discharge Curve (Section B.1, Exponentials)
Alkaline terminal voltage changes during discharge; its usable capacity depends on load, temperature, and the device cutoff voltage. Assume usable capacity is ~80% at a 1.1V cutoff:
Challenge Extension:
- What if you reduce transmit time to 1 second (faster Wi-Fi)? Recalculate .
- What if you switch to lithium AA (2,500 mAh, flatter discharge curve = 90% usable)? New battery life?
- Use Section B.1 RC time constant: If ESP32 has 100uF decoupling cap, how long to charge from sleep voltage?
Answer: With 1s transmit, drops to 3.44 mA -> 19.3 days (alkaline) or 27 days (lithium).
Why This Matters: Battery life estimation is the #1 requirement for field-deployed IoT. This exercise applies integrals (averaging), exponentials (discharge curves), and real-world engineering judgment (efficiency factors).