Energy budget and battery life#

A budget balances how much of something is available against how it is spent. For a battery-powered product, the battery supplies a fixed amount of charge or energy, and every mode of the product spends some of it. The budget tells you, before you have hardware, whether the design can meet its battery life target and which parts of it matter most.

The budget has two sides:

Consumption

The average current or power that the product draws, built up from its operating modes and its components.

Supply

The charge or energy that the battery can actually deliver in your product, after derating.

Budget charge if your product runs from the battery directly or through a linear regulator, and energy if it uses a switching regulator. See Design for energy or for charge?. The steps are the same either way: use current and amp-hours (Ah) for a charge budget, and power and watt-hours (Wh) for an energy budget. The example on this page is a charge budget.

Consumption#

Build the consumption side in four steps:

  1. List the operating modes, such as sleep, sensing and radio communication. See Operating modes.

  2. Estimate the current or power of each component in each mode, from datasheets at first and from measurements once you have hardware.

  3. Estimate how long each mode lasts and how often it occurs.

  4. Combine them into the average current or power of the product.

The average current is the sum, over all modes, of each mode’s current weighted by the fraction of time spent in it, the duty cycle:

\[I_{AVG} = \sum_{m} I_m \, D_m, \qquad D_m = \frac{t_m \, n_m}{T}\]

where Im is the current in mode m, tm is the duration of one occurrence, nm is the number of occurrences in the period T, and the duty cycles of all modes add up to one. For an energy budget, replace current with power.

An average current in µA is also a charge rate in µC/s, so the average current times the battery life gives the total charge consumed.

Example#

Consider a small Internet of Things (IoT) sensor with a microcontroller, a radio and motion sensors, powered from its battery through a low-dropout regulator (LDO). Because of the LDO, this is a charge budget. The sensor has three modes:

Detect

The product wakes and checks its sensors, for example because someone picked it up, or on a periodic timer. Each detection takes 0.2 s, and the budget assumes 10 per hour.

Active/RF

The product senses, interacts and reports over the radio. This takes 5 s. One detection in five leads to a report, so it happens 2 times per hour.

Sleep

The product waits for the next event.

The first table estimates each component’s current in each mode:

Component

Detect (µA)

Active/RF (µA)

Sleep (µA)

Microcontroller

20000

25000

10

Radio

10

20000

10

Accelerometer

500

500

20

Gyroscope

5000

5000

1.5

ISR pull-up

18

18

0

LDO

1.5

1.5

1.5

LED

10000

10000

0

Total

35529.5

60519.5

43

This table estimates current in each mode, but it says nothing about battery life on its own. Active/RF draws 1400 times the sleep current, yet the product is almost always asleep. The budget needs time.

The second table adds time. The duty cycle of Detect is 0.2 s × 10 / 3600 s = 0.0556%, and Sleep takes what remains:

Detect

Active/RF

Sleep

Duration per event

0.2 s

5 s

Events per hour

10

2

Duty cycle

0.0556%

0.2778%

99.6667%

Average current

19.7 µA

168.1 µA

42.9 µA

The average current of the product is 19.7 + 168.1 + 42.9 = 230.7 µA. Fig. 13 shows how it divides between the modes.

Bar chart of average current by mode: Detect 19.7 µA, Active/RF 168.1 µA, Sleep 42.9 µA

Fig. 13 Average current by mode for the example. Active/RF, which runs for less than 0.3% of the time, consumes 73% of the charge.#

Plot the budget this way, by mode or by component, whenever you build one. It shows where the charge goes at a glance, and it often contradicts intuition. Here, the mode that runs 0.3% of the time dominates the battery, which suggests two changes:

  • Shorten Active/RF. Five seconds is long. If the product only needs to relay its data, reducing the radio time to a half or a quarter of a second would change the budget dramatically.

  • Use a switching regulator instead of the LDO. Most of the charge goes to a high-current mode, so converting the battery voltage efficiently in that mode matters more than the LDO’s low quiescent current in sleep.

Supply#

A battery’s rated capacity is measured under conditions chosen by its manufacturer, usually a light, constant load at room temperature. Your product will see something different. Derate the stated capacity for:

Load

The faster you draw charge from a battery, the less total charge it delivers. Pulsed loads, such as a radio transmitting, also cause voltage drops through the battery’s internal resistance. Check the capacity curves in the battery datasheet for your load current and pulse current.

Temperature

Cold batteries deliver less capacity and have higher internal resistance. Use the capacity at the coldest temperature the product must work at.

Age and self-discharge

Batteries lose charge on the shelf and in the product, and rechargeable batteries lose capacity with each charge cycle. Include the shelf time before the customer installs the battery.

Cutoff voltage

The product stops working when the battery voltage falls below the minimum that its circuits need, often before the battery is empty. Use the capacity down to your product’s cutoff voltage, not the battery’s.

Chemistry

Different chemistries have different discharge curves. A lithium coin cell, an alkaline cell and a lithium-ion cell behave very differently under the same load. Nickel chemistries, NiCd and NiMH, also have memory effects.

Early in a design, a single derating factor is a reasonable placeholder. For an accurate battery life estimate, replace it with the behavior of the battery chemistry you chose, under your load and temperature. A product that must run three years on one battery needs enough charge left at the end of the third year, after self-discharge and aging, not just at the start.

Battery life#

Divide the derated capacity by the average consumption:

\[t_{LIFE} = \frac{C_{Ah}}{I_{AVG}} \quad \text{(charge)}, \qquad t_{LIFE} = \frac{E_{Wh}}{P_{AVG}} \quad \text{(energy)}\]

For the example, with a 1000 mAh battery and a 180-day target:

\[t_{LIFE} = \frac{1000\ \text{mAh}}{0.2307\ \text{mA}} = 4335\ \text{h} = 180.6\ \text{days}\]

The estimate meets the target by 0.6 days, but only with the full rated capacity. Derate the battery to 80% and the estimate falls to 144.5 days, which misses the target. This product needs changes before it has hardware, which is exactly when changes are cheapest. See Optimize what matters for how this example decides which change is worth making.

Spreadsheet#

Download the example budget spreadsheet, which contains the tables on this page. Replace the components, modes and times with your own. Add rows for every component, including the ones that seem too small to matter, such as pull-up resistors, voltage dividers and regulator quiescent current.

From estimate to measurement#

A budget is an estimate until you measure. Once you have hardware, measure the current in each mode and the time and frequency of each mode, and replace the estimates in the budget with the measured values. See Measuring energy consumption.

The Joulescope UI Event Analyzer, at Tools → Event Analyzer, does much of this from a capture. It finds the wake-up events above the sleep current, measures the duration, charge and energy of each one, groups repeated events into types by their waveform shape, and accounts for all of the charge in the capture, including the sleep current. Given the battery capacity, it also estimates battery life. The same analysis is available as the joulescope_event_analyzer Python package, which can compare two captures, such as two firmware versions.

Keep the budget up to date as the design changes. A measured budget that differs from the estimate tells you which assumption was wrong, and an updated budget tells you whether a change helped.