Sub topic 11
Estimating battery runtime realistically
This chapter assumes you can build a current budget (the previous chapter), read mAh and nominal voltage ratings, and know the difference between a linear and a switching regulator. Here you turn those pieces into a runtime figure you can trust to within a reasonable margin.
Why the simple formula is only a start
The textbook formula is runtime in hours = capacity in mAh ÷ current in mA. A 2000 mAh battery driving a 50 mA load "lasts 40 hours". Real projects rarely reach that number, for these reasons:
- The rated capacity was measured under specific conditions, usually a light load, room temperature, and a low cutoff voltage.
- Your load is not constant. Radios, motors, and LEDs draw bursts of current.
- The regulator wastes some energy as heat.
- Voltage sags as the battery discharges, and your project stops working before the cell is truly empty.
- Cells age, and cold weather reduces the usable capacity.
A realistic estimate starts from the simple formula and corrects for each of these, one step at a time.
Step 1: Find the average load current
Take the current budget from the previous chapter and reduce it to a time-weighted average. If the project cycles through states, the average is the sum of each state's current times its duration, divided by the total cycle time.
Example: a sensor node wakes once a minute. It draws 80 mA for 1 s while measuring and transmitting, then 5 mA for 59 s while sleeping.
- Charge per cycle: 80 × 1 + 5 × 59 = 375 mA·s
- Average current: 375 ÷ 60 = 6.25 mA
The 80 mA burst lasts only 1 s of every 60, so the 5 mA sleep current dominates the result. This is why a "sleeping" board that still draws 5 mA (a power LED, a USB-serial chip, a regulator's quiescent current) can ruin an otherwise efficient design.
Step 2: Account for the regulator
The battery does not supply your load current directly. It supplies whatever the regulator needs. How you account for that depends on the regulator type.
Linear regulators
A linear regulator passes the load current through and burns the voltage difference as heat. The battery current is the load current plus the regulator's own quiescent current (Iq, the current it uses just to operate):
- Ibattery = Iload + I_q
Efficiency is roughly Vout ÷ Vin. A 9 V battery feeding a 5 V linear regulator is about 55% efficient. At 100 mA, the regulator dissipates (9 − 5) × 0.1 = 0.4 W. However, the battery current is still only 100 mA plus Iq. For runtime in mAh terms, a linear regulator costs you nothing extra beyond Iq. Its inefficiency shows up as lost energy (Wh), because you are paying for 9 V of battery voltage to deliver 5 V.
Switching regulators
A switching regulator conserves power, not current. Input power is output power divided by efficiency, and the battery current follows from that:
- Ibattery = (Vout × Iload) ÷ (Vbattery × efficiency)
Example: a 3.7 V, 2000 mAh LiPo feeds a boost converter that makes 5 V for a 200 mA load, at 85% efficiency.
- Output power: 5 × 0.2 = 1.0 W
- Input power: 1.0 ÷ 0.85 ≈ 1.18 W
- Battery current at 3.7 V: 1.18 ÷ 3.7 ≈ 318 mA
The battery supplies about 318 mA, not 200 mA. A boost converter raises the current drawn from the battery, so ignoring that step overestimates runtime by about 60% in this case.
Converter efficiency also varies with load. Many converters are efficient (85–95%) near their design current but poor at very light loads, where their own switching overhead dominates. Check the efficiency curve in the datasheet at your actual average and sleep currents, not only at the peak.
Step 3: Derate the capacity
The usable capacity is lower than the label. Apply a derating factor between 0 and 1:
| Factor | Typical effect |
|---|---|
| High discharge rate | Alkaline cells can deliver well under their rated capacity at high drain. Lithium-ion cells lose little at moderate rates. |
| Cold temperature | Capacity drops noticeably below about 0 °C, and alkaline cells suffer most. |
| Cutoff voltage | Your regulator or board stops working before the cell is empty. |
| Aging | Rechargeable cells lose capacity over hundreds of cycles. |
| Self-discharge | NiMH and alkaline cells lose charge while idle, which matters for projects that run for months. |
For a first estimate, use 0.7 as a general factor. Use 0.8 to 0.9 for a fresh lithium cell at a moderate rate in a warm room. Use 0.5 or less for alkaline cells at high drain or in cold weather. These are rules of thumb, not measurements. Where possible, read the manufacturer's discharge curve at your load.
Putting it together in code
This script combines the average, regulator, and derating steps.
def average_current_ma(phases):
"""Time-weighted average of (current_ma, seconds) phases."""
total_charge = sum(i * t for i, t in phases)
total_time = sum(t for _, t in phases)
return total_charge / total_time
def battery_current_linear_ma(load_ma, quiescent_ma=0.0):
"""A linear regulator passes load current through, plus its own Iq."""
return load_ma + quiescent_ma
def battery_current_switching_ma(v_out, load_ma, v_batt, efficiency):
"""A switching regulator conserves power, not current."""
return v_out * load_ma / (v_batt * efficiency)
def runtime_hours(capacity_mah, avg_current_ma, derate=0.7):
"""Rough runtime, derating the rated capacity for real-world losses."""
return capacity_mah * derate / avg_current_ma
# Sensor node: 80 mA for 1 s, then 5 mA for 59 s
avg = average_current_ma([(80, 1), (5, 59)])
print(round(avg, 2)) # 6.25 mA
# 2000 mAh pack on that average load
hours = runtime_hours(2000, avg)
print(round(hours, 1), "hours") # about 224 hours
print(round(hours / 24, 1), "days") # about 9.3 days
# 3.7 V LiPo boosting to 5 V at 200 mA, 85 % efficient
i_batt = battery_current_switching_ma(5.0, 200, 3.7, 0.85)
print(round(i_batt)) # about 318 mA
print(round(runtime_hours(2000, i_batt), 1), "hours") # about 4.4 hoursNotice that the boost example gives 4.4 hours, while the naive formula (2000 ÷ 200) gives 10 hours. The estimate is less than half the naive one.
The estimation process at a glance
Step 4: Add a safety margin and verify
Treat your result as a central estimate and design for less. A margin of 20 to 30% is common. If your estimate says 9 days and the project must run for a week, you have little room for error.
Then measure. Put a multimeter in series with the battery (current mode), or use a small shunt resistor and read the voltage across it. Remember these points when measuring:
- A multimeter averages poorly over short bursts. A 1 s transmit burst may be missed or smoothed. Measure each state separately and combine them with the averaging method above.
- A meter's series resistance (burden voltage) can cause the board to brown out during bursts. Use a higher current range if the board resets.
- Run at least one real discharge test, from full to the cutoff voltage, and log voltage over time. The data tells you the real derating factor for your cell and load.
The voltage divider sketch from the later chapter on battery monitoring lets the board log its own battery voltage during that test.
Common mistakes
- Using peak current instead of average current, which underestimates runtime, or ignoring bursts entirely, which overestimates it.
- Forgetting that a boost converter draws more current from the battery than the load draws.
- Ignoring sleep current from always-on parts such as power LEDs and USB-serial chips.
- Using the rated mAh of a cell at a discharge rate far above the rating's test conditions.
- Comparing mAh across different voltages. A 3.7 V cell with 2000 mAh stores 7.4 Wh, while a 1.5 V cell with 2000 mAh stores only 3 Wh. When the two feed a switching regulator, compare watt-hours, not milliamp-hours.
Exercises
Exercise
A project has two states: 120 mA for 2 s, then 3 mA for 28 s, repeating. It runs from a 1500 mAh battery through a linear regulator with 0.1 mA quiescent current. Using a derating factor of 0.8, estimate the runtime in hours.
Show answer
Average load = (120 × 2 + 3 × 28) ÷ 30 = (240 + 84) ÷ 30 = 10.8 mA. Battery current = 10.8 + 0.1 = 10.9 mA. Runtime = 1500 × 0.8 ÷ 10.9 ≈ 110 hours, or about 4.6 days.
Exercise
A 3.7 V, 1000 mAh LiPo feeds a boost converter (90% efficient) that makes 5 V for a 150 mA load. Using a derating factor of 0.8, what battery current does the load draw and how long does the project run?
Show answer
Output power = 5 × 0.15 = 0.75 W. Input power = 0.75 ÷ 0.9 ≈ 0.833 W. Battery current = 0.833 ÷ 3.7 ≈ 225 mA. Runtime = 1000 × 0.8 ÷ 225 ≈ 3.6 hours.