← Math
Math

Power, energy, and duty cycles

Can the trackers report every five minutes?

Combine time-weighted load power with usable battery energy to budget report intervals.

Outcome

Average power over a duty cycle, convert mAh to watt-hours with voltage and regulator losses, and work out the shortest report interval a battery can sustain.

Terminology (5)Terms used in this lesson

Term on the front, definition on the back. Paste with tabs between fields and a new line between cards, or import the download in Anki as Basic.

Power and energy
Power is a rate (watts); energy is power over time (joules, or watt-hours).
Watt-hour
One watt for one hour, 3,600 joules; battery Wh = mAh × volts / 1000.
Duty cycle
The fraction of each period a device spends active.
Voltage
Power = voltage × current, so the same mA at a lower voltage is less power.
Battery budget
The average power a battery can supply to last a target time.

Why this matters

Battery-powered devices, from trackers to phones, spend most of their time asleep and most of their energy in short bursts. Settings that change how often they wake, which are often controlled from a backend, decide their battery life. The arithmetic needs units kept straight: charge, energy and power are different quantities.

This lesson assumes rates, unit conversion and weighted averages.

Charge, energy and average power

Power is the rate of energy use, so energy is power multiplied by time. Battery charge in milliamp-hours becomes energy only when combined with voltage. Regulator efficiency then relates the power delivered to the electronics to the larger draw from the battery.

A duty cycle is the fraction of a repeating period spent in an active mode. Recall the weighted average: multiply each mode’s power by its time, add the contributions and divide by the whole period. Combining that average with usable energy estimates lifetime; the report interval must also allow sequential activities to finish.

01Average over the whole cycle

Average over the whole cycle

Your company’s shipment trackers report their location once an hour and last about five months on one charge. Product wants a report every five minutes. The first estimate said the battery would still last for months; trackers in the pilot went flat in under two weeks.

To isolate time weighting, first use a reduced single-current model at a fixed supply: each hourly report is active for 20 s at 120 mA; the rest of the hour it sleeps at 0.05 mA. The average is (120 × 20 + 0.05 × 3,580) / 3,600 = 0.716 mA, and a 2600 mAh cell lasts 151 days. Leaving out the sleep current gives 0.667 mA and 162 days: a tiny current, running 179 times longer than the burst, costs 11 days.

A fleet console in Node.js can compute the expected life for each proposed interval before pushing the setting to devices.

02mAh is charge, Wh is energy

mAh is charge, Wh is energy

Predict both lines.

main.ts
Follow appearance
GitHub Light
GitHub Dark
Rosé Pine
Catppuccin Mocha
VS Code Dark+
// The same 2600 mAh rating on a 3.6 V lithium cell and a 1.2 V NiMH cell, powering the hourly tracker.
const draw = (100 * 30 + 500 * 10 + 0.1 * (3600 - 40)) / 3600 / 0.9; // average mW from the battery

for (const volts of [3.6, 1.2]) {
  const wh = (2600 * volts) / 1000;

  console.log(
    `${volts} V: ${wh.toFixed(2)} Wh, ${((wh * 1000) / draw / 24).toFixed(1)} days`
  );
}

A milliamp-hour rating counts charge. Energy is charge times voltage: 2600 mAh at 3.6 V is 9.36 Wh, at 1.2 V only 3.12 Wh. That current-only probe does not describe the full 40 s reporting sequence below. To compare different cells and regulator losses, use the measured mode powers instead. Device datasheets often give power in mW for each mode, so convert the battery to mWh before dividing; dividing mAh by mW is off by the voltage.

03The regulator takes its share

The regulator takes its share

The tracker at different report intervals (3.6 V, 2600 mAh, 90% regulator)
Report everyFrom batteryLife
60 min2.579 mW151.2 days
5 min29.726 mW13.1 days

The electronics run from a regulated supply, and the regulator wastes part of what it draws as heat. At 90% efficiency the battery supplies the load divided by 0.9. A GPS fix at 100 mW for 30 s and an LTE-M upload at 500 mW for 10 s cost 8,000 mW·s per report; twelve reports an hour instead of one is most of the difference.

04How often can it report?

How often can it report?

Turn the question around. With 80% of the capacity usable, 90 days allows an average of 7,488 mWh / 2,160 h = 3.467 mW from the battery. The load can use 0.9 ×3.4667 =3.12 mW of that. Its 0.1 mW sleep baseline runs all the time, leaving 3.02 mW at the load for extra activity. The modes replace 40 s of sleep, so extra energy per report is(100 −0.1) ×30 +(500 −0.1) ×10 = 7996 mW·s. For period T, load average is0.1 +7996/T; requiring this ≤3.12 gives T ≥ 7996/3.02 ≈ 2647.7 s, about 44 minutes. Reports run sequentially, so T must also be at least 30 + 10 = 40 s; a looser energy budget cannot make a report overlap itself.

Sleep power rises so sleep alone needs more than the available load budget. What is the shortest interval?

05What the budget leaves out

What the budget leaves out

06Set the report interval

Set the report interval

Check the reduced current budget, then price the full report’s energy through its regulator. The fleet setting needs an interval that meets the usable-energy target and still leaves enough time to finish each report.

In the frontend An interval picker with expected life in Next.js and Svelte Optional

The fleet console can show the expected battery life next to the interval, so the trade-off is visible before the setting reaches devices.

Estimate.tsx
Follow appearance
GitHub Light
GitHub Dark
Rosé Pine
Catppuccin Mocha
VS Code Dark+
// The fleet console: show the expected battery life before an operator changes the report interval.
type Tracker = {
  wh: number;
  eff: number;
  sleepMw: number;
  reportMj: number;
  reportSeconds: number;
}; // reportMj: extra energy per report, mW·s

export function IntervalPicker({
  t,
  minutes,
  onChange
}: {
  t: Tracker;
  minutes: number;
  onChange: (m: number) => void;
}) {
  const period = minutes * 60;
  const valid = Number.isFinite(minutes) && minutes > 0 && period >= t.reportSeconds;
  const drawMw = (t.sleepMw + t.reportMj / period) / t.eff;
  const days = (t.wh * 1000) / drawMw / 24;

  return (
    <label>
      Report every{" "}
      <input
        type="number"
        min={1}
        value={minutes}
        onChange={(e) => onChange(Number(e.target.value))}
      />{" "}
      min
      <output>
        {valid
          ? `about ${Math.floor(days)} days per charge`
          : `Choose an interval of at least ${t.reportSeconds} seconds.`}
      </output>
    </label>
  );
}

Check this idea later
How many watt-hours is a 5000 mAh, 3.7 V phone battery?
A device is active 1% of the time at 100 mW and sleeps at 1 mW. What is its average power?
Sources

Values above were run in Node 22, Go 1.27, Rust 1.99 and Apple clang 17. The tracker and its figures are a worked model.

Sign in to keep your read marks on every device. Sign in

Was this helpful?

Report a problem in this lesson

For typos, mistakes and things that don’t work. We read every report and fix what’s wrong, but we don’t reply here, so a question won’t get an answer.