Learn / Power / Batteries

Batteries: Voltage, Capacity and Runtime

ReviewedBeginnerFreeAbout 6 min
LM2596
In short

Batteries: Voltage, Capacity and Runtime: the short answer

A battery's voltage depends on its chemistry. 0 V as it empties. Example: About 900 hours, or roughly five weeks. Many dev boards draw several mA in sleep because of their USB chip and power LED, so measure your own board before trusting the number.

Level
Beginner
Time
About 6 min
Topic
Power
You will learn to

Choose a battery for a project and estimate how long it will run.

Before this: Voltage, Current & Resistance

A battery's voltage depends on its chemistry. An alkaline AA starts at about 1.5 V and falls towards 1.0 V as it empties. A lithium-ion cell such as an 18650 is 4.2 V when full, about 3.7 V for most of its life (the nominal voltage) and should not go below about 3.0 V. A 9 V battery is small but holds little energy, so it is a poor choice for anything that runs for long.

Capacity is given in milliamp-hours (mAh). In theory a 2,000 mAh battery supplies 100 mA for 20 hours. In practice you get less: the voltage regulator wastes some energy, capacity drops at high current and in the cold, and you should not drain a lithium cell to zero. A safe planning rule is to use about 70 to 80 % of the rated capacity.

For runtime, work out the average current. A board that draws 80 mA while sending Wi-Fi for 2 seconds and 10 mA the other 58 seconds averages (80 × 2 + 10 × 58) ÷ 60 ≈ 12 mA. Sleep modes and switching off LEDs usually make the biggest difference.

Chemistry decides the voltage and the behaviour

Alkaline cells sag steadily as they empty, so a device that needs 3 V from two AAs stops working while the cells still hold energy. NiMH cells are 1.2 V, hold their voltage almost flat and are rechargeable, but self-discharge noticeably unless they are low-self-discharge types. Lithium-ion and LiPo cells are 3.7 V nominal and 4.2 V full, with a flat curve until near the end.

A single lithium cell is awkward for 3.3 V electronics: at 4.2 V it is too high for a bare 3.3 V part, and below about 3.5 V a standard regulator no longer has headroom. A low-dropout or buck-boost regulator solves this.

Capacity is not the whole story

Capacity in mAh is quoted at a gentle discharge. Draw it faster and you get less. Cold also costs capacity: a lithium cell at 0 °C can deliver 20 to 30 % less. Cheap cells often carry exaggerated ratings, so an 18650 that says 9,900 mAh is not telling the truth; a genuine one is about 2,000 to 3,500 mAh.

Energy in watt-hours (V × Ah) is the fair way to compare chemistry: a 2,500 mAh Li-ion cell at 3.7 V is 9.25 Wh; the same mAh in a 1.5 V alkaline is only 3.75 Wh.

Runtime, honestly estimated

Runtime ≈ usable capacity ÷ average current. Take 70 to 80 % of the rating for usable capacity. Include the regulator: a linear regulator draws as much from the battery as the load takes, plus its own quiescent current, whatever the voltage drop. A buck converter at 85 to 90 % efficiency turns a smaller current from a higher voltage, so the battery current can even be lower than the load current.

For an ESP32 that wakes every minute for two seconds, the sleep current often decides everything. A dev board with a power LED and a USB chip can draw 10 mA while asleep, which empties a 2,000 mAh cell in about 8 days. The bare chip in deep sleep takes about 10 µA.

Lithium safety

Never short, puncture, crush or charge a lithium cell without a proper charger with protection. Use cells with a protection circuit, or add a protection board. Charge on a non-flammable surface and not unattended, stop using any cell that is swollen or hot, and never leave a LiPo pouch charging on a pillow.

Do not mix old and new cells in a pack, and do not connect cells of different charge in parallel. Storing a cell at about 3.8 V and at room temperature keeps it healthy for months.

Common mistakes
  • Quoting runtime from the raw mAh rating without the usable fraction and the regulator losses.
  • Powering a board through its 5 V pin from a lithium cell and being surprised when it dies at 3.6 V.
  • Charging lithium cells with a plain power supply.
Key formulas
hours ≈ mAh ÷ mA
run time, before margin
Wh = V × Ah
energy in a battery
Try it: How long will the battery last?

Run time against average current

10 h100 h1 kh10 kh100 µA1 mA10 mA100 mAAverage current40 h

Halving the average current doubles the run time. Sleep modes are how low-power projects last months.

40 h (1.67 days), about 32 h with 20 % margin

Run time against average current. Hours ≈ capacity ÷ current, before allowing about 20 % margin.

Work it with your own numbers: Battery run time

Worked example

How long does a 2,600 mAh 18650 run an ESP32 sensor?

  1. Awake for 5 s every 5 minutes at 120 mA; deep sleep the other 295 s at 0.15 mA (board-dependent).
  2. Average = (120 × 5 + 0.15 × 295) ÷ 300 = (600 + 44) ÷ 300 ≈ 2.15 mA.
  3. Usable capacity: 2,600 × 0.75 ≈ 1,950 mAh.
  4. Runtime = 1,950 ÷ 2.15 ≈ 900 hours.

Result. About 900 hours, or roughly five weeks. Many dev boards draw several mA in sleep because of their USB chip and power LED, so measure your own board before trusting the number.

Try it

Measure your board's current with a multimeter in series (or an INA219) in normal running and, if your code has one, in sleep. Use the average-current formula to estimate how long a 2,000 mAh 18650 would last.

Check yourself

3 quick questions

  1. What is the nominal voltage of a Li-ion cell?

  2. A project averages 50 mA from a 2,000 mAh battery. Using 75 % of capacity, how long does it run?

  3. Why is a 9 V battery a poor choice for an always-on ESP32?

Common questions

What will I learn in "Batteries: Voltage, Capacity and Runtime"?

Choose a battery for a project and estimate how long it will run.

How long does a 2,600 mAh 18650 run an ESP32 sensor?

Awake for 5 s every 5 minutes at 120 mA; deep sleep the other 295 s at 0.15 mA (board-dependent). Average = (120 × 5 + 0.15 × 295) ÷ 300 = (600 + 44) ÷ 300 ≈ 2.15 mA. Usable capacity: 2,600 × 0.75 ≈ 1,950 mAh. Runtime = 1,950 ÷ 2.15 ≈ 900 hours. About 900 hours, or roughly five weeks. Many dev boards draw several mA in sleep because of their USB chip and power LED, so measure your own board before trusting the number.

What is the nominal voltage of a Li-ion cell?

3.7 V. Li-ion cells are about 3.7 V nominal, 4.2 V full and around 3.0 V empty.

A project averages 50 mA from a 2,000 mAh battery. Using 75 % of capacity, how long does it run?

30 hours. 2,000 × 0.75 = 1,500 mAh; 1,500 ÷ 50 = 30 hours.

Why is a 9 V battery a poor choice for an always-on ESP32?

It holds little energy and most of the voltage is wasted in a regulator. A 9 V battery has only a few hundred mAh, and a linear regulator dropping 9 V to 3.3 V wastes most of the energy as heat.