Home / Learn / Electronics basics

Batteries for electronics projects: AA, Li-ion, LiPo and coin cells

New to this? Read from the top. Already know the basics? Jump to Going deeper for intermediate and advanced detail.

Common batteries for electronics: a 1.5 volt AA alkaline, a 1.2 volt NiMH AA, a 3.6 volt 18650 lithium-ion cell, a 3.7 volt LiPo pouch and a 3 volt CR2032 coin cell
Beginner

Picking a battery means answering three questions: what voltage does the circuit need, how much current does it draw, and how long must it run? This guide explains the numbers on the label, compares the common types, and covers the safety rules for lithium cells.

The numbers on a battery

  • Nominal voltage: the typical voltage during discharge. A cell starts higher and ends lower.
  • Capacity in mAh: how many milliamp-hours it can deliver. In theory, 2,000 mAh runs 20 mA for 100 hours. In practice the real figure depends on the current, the temperature and the voltage at which your circuit stops working.
  • Energy in Wh: voltage × amp-hours. This is the fair way to compare different chemistries. A 3.6 V, 3,000 mAh lithium-ion cell holds 3.6 × 3.0 = 10.8 Wh.
  • C-rate: current as a multiple of capacity. For a 2,000 mAh cell, 1C is 2 A and 0.5C is 1 A. Datasheets give the maximum continuous and charging C-rates.

The common types compared

TypeNominal voltageRechargeable?Good forWatch out for
Alkaline AA / AAA1.5 VNoLow-current gadgets, remote sensors, anything that sits for monthsCapacity falls sharply at high current; can leak when flat
NiMH AA / AAA1.2 VYesToys, motors, anything that eats alkalinesLower voltage per cell; choose low self-discharge types
Lithium-ion (e.g. 18650)3.6 to 3.7 V (4.2 V full)YesHigh energy in a small space; ESP32 and Pico projectsNeeds a proper charger and protection
LiPo pouch3.7 V (4.2 V full)YesThin, light builds; dronesEasily punctured; swells when abused
LiFePO43.2 V (3.6 V full)YesLong cycle life, more tolerant of abuseNeeds a LiFePO4-specific charger
CR2032 coin cell3 VNoTiny, very low-current circuits, real-time clocksCan only supply small currents; around 220 to 240 mAh, depending on the maker
9 V PP3 (alkaline)9 VNoMultimeters, guitar pedalsOnly a few hundred mAh: a poor choice to run an Arduino

Why the capacity on the label isn't what you get

Capacity is measured under specific test conditions, usually a light load. Draw more current and the battery's internal resistance wastes more energy and the voltage sags sooner. Energizer's alkaline handbook shows the delivered capacity falling sharply as the load increases. Lithium-ion holds its voltage much better under load, which is one reason it's used for motors and radios.

The other limit is your circuit. If your board stops working below 3.0 V, any charge left below that is wasted. Our battery internal resistance lab shows the voltage sag in action.

How long will it last?

Divide the usable capacity by the average current: 2,000 mAh at an average of 20 mA gives about 100 hours. Then knock off a safety margin of 20 to 30% for ageing, temperature and the end-of-life voltage. For projects that sleep most of the time, work out the average from the awake and asleep currents. Our battery life calculator does exactly this.

Matching battery voltage to your board

  • A Raspberry Pi Pico accepts 1.8 to 5.5 V on its VSYS pin, so two or three AA cells, or one lithium-ion cell, can run it directly.
  • An ESP32 board usually has a 3.3 V regulator; a single lithium-ion cell works, but the regulator may drop out near the end of discharge. See voltage regulators explained.
  • An Arduino Uno's barrel jack wants 7 to 12 V, so batteries feeding it through the on-board linear regulator waste a lot as heat. A USB power bank on the USB socket is often simpler.

One catch with power banks: many switch themselves off when the current is very low, assuming nothing is connected. A sleeping project can be cut off by its own power bank.

Lithium safety

Lithium cells store a lot of energy and can catch fire if shorted, punctured, overcharged or over-discharged. Follow these rules:

  • Charge lithium-ion and LiPo with a charger designed for them, which charges at a constant current and then holds 4.2 V (constant voltage). Popular TP4056-based modules do this; choose one with a protection chip for over-discharge and short circuit.
  • Use cells with built-in protection, or add a protection circuit, especially for bare 18650s.
  • Never charge a swollen, dented or damaged cell, and don't leave cells charging unattended on something flammable.
  • Insulate the terminals of loose cells: a cell rolling against keys or coins in a pocket can short.
  • Buy from reputable suppliers. Counterfeit cells often have far less capacity than claimed and may lack protection.

Disposal in the UK

Don't put batteries in your household bin, where lithium cells can start fires in bin lorries and recycling plants. Shops that sell batteries generally have to take used portable batteries back for free, and most councils and recycling centres collect them too. Tape over the terminals of lithium cells before you drop them off.

Intermediate and advanced

Going deeper

Peukert's effect and internal resistance

Delivered capacity falls as the current rises, an effect described for lead-acid batteries by Peukert's law and seen in all chemistries to some degree. A simpler model that works well in practice: treat the battery as an ideal voltage source in series with an internal resistance Ri. The terminal voltage is Vopen − I × Ri, and I² × Ri is wasted as heat inside the cell. As a cell ages and gets cold, Ri rises, so the voltage sags sooner under load, even with capacity left.

Cells in series and parallel

Series cells add voltage, parallel cells add capacity. Lithium cells in series need a battery management system (BMS) to balance them, because the weakest cell otherwise gets over-discharged first. Only connect lithium cells in parallel when they're at the same voltage: a full cell connected to a flat one pushes a large current between them.

Charge termination

Lithium-ion chargers switch from constant current to constant voltage at 4.20 V (for most cells) and finish when the current falls to a fraction of the charge rate, often C/10. Charging to a lower voltage, such as 4.1 V, gives up some capacity but noticeably extends cycle life, which is why some devices offer a "battery care" setting. LiFePO4 uses a lower charge voltage, typically 3.6 to 3.65 V per cell, so a lithium-ion charger must not be used on it.

Self-discharge

Alkaline cells lose only a small percentage of their capacity per year at room temperature, which suits devices that sit for a long time. Standard NiMH can lose a noticeable fraction per month; low self-discharge NiMH holds charge for well over a year. Lithium-ion loses a few percent per month, plus whatever the protection circuit and your project draw.

Sources

The main references behind this guide. Numbers we worked out ourselves, such as the code outputs, come from running the code.