The battery you choose determines your project's size and weight, how long it runs, and whether you'll recharge it or replace the battery. And each type has a different cell voltage, which is the first thing you need to know.
A quick comparison
| Type | Cell voltage | Rechargeable? | Use |
|---|---|---|---|
| Alkaline | 1.5 V | No | Remotes, toys and light devices |
| NiMH | 1.2 V | Yes | Replacement for ordinary AA/AAA cells |
| Lithium-ion (18650) | 3.7 V (4.2 charged) | Yes | Projects, power banks and laptops |
| Lithium polymer (LiPo) | 3.7 V | Yes | Drones and slim devices |
| LiFePO4 | 3.2 V | Yes | Solar; safer and longer-lived |
| Lead-acid | 2 V per cell (12 V = 6 cells) | Yes | Cars and UPS units |
Lifetime in charge cycles
| Type | Approx. cycles | Note |
|---|---|---|
| NiMH | 500–1000 | Tolerates neglect better than lithium |
| Lithium-ion | 300–1000 | Depends on quality, depth of discharge and heat |
| LiFePO4 | 2000 and more | The longest-lived, but heavier and lower voltage |
| Lead-acid | 200–500 | Drops sharply if often discharged past half |
These figures are approximate, and a battery is considered "worn out" when its capacity falls to about 80% of new. Every type lasts longer if you don't run it completely flat or charge it in the heat.
What does mAh mean?
That's the capacity: how many milliamps the battery can supply for an hour. 2000 mAh means, in theory, 200 mA for 10 hours. The realistic calculation with margin is in the battery life article.
Lithium: the most popular and the most dangerous
Lithium-ion and polymer batteries are much lighter and stronger than the rest, but they demand respect:
- Don't charge them with just any charger: you need a dedicated charger that stops at 4.2 V per cell (the TP4056 module is the most popular for projects).
- Don't discharge them below about 3 V: it shortens their life and can ruin them. Use cells or modules with a protection circuit (BMS).
- Don't puncture or heat them: a swollen or dented battery can catch fire. Don't charge it, and dispose of it safely.
- Shorts are dangerous: they can deliver a huge current in an instant. Watch the terminals and fit a fuse.
Fake and protected cells
- The marked capacity: a genuine 18650 cell tops out at about 3500 mAh. Ones marked 6000 or 9800 usually have a real capacity below 1500, and they're noticeably light. Buy from a known source, and measure the capacity if you can.
- Protected or not: a protected cell has a small circuit at one end that cuts off on overcharge, deep discharge and short circuit, and it's slightly longer. Cells assembled into a pack are usually unprotected, with the protection in the BMS.
- Discharge current: there are high-capacity cells and high-drain cells. A very high-capacity cell usually won't deliver a large current for a motor or a power screwdriver. The figure is in the datasheet.
Sizes you'll meet
- AA and AAA: alkaline and NiMH. Note that there are lithium cells shaped like AA at 3.7 V (called 14500), and if fitted in place of an ordinary AA they'll destroy the device.
- 18650 and 21700: the number is the size (18 mm diameter and 65 mm long). The 21700 is bigger, with a capacity up to about 5000 mAh.
- CR2032: the 3 V coin cell, about 220 mAh. Excellent for an RTC or a remote drawing microamps, and very poor for anything drawing milliamps, because its voltage collapses immediately.
- The square 9 V battery: small capacity and expensive for its energy. Not suitable for Arduino projects.
Several cells together
- In series: the voltages add up (3 lithium cells = about 11.1 V), and you need a balancing BMS across the cells.
- In parallel: the capacities add up and the voltage stays the same. The cells must be at the same voltage before you connect them together.
How does each type charge?
- Lithium-ion and LiPo: constant current up to 4.2 V, then constant voltage until the current tapers off (CC/CV). The TP4056 module does this for a single cell.
- LiFePO4: the same method but up to 3.65 V per cell. An ordinary lithium charger (4.2 V) will overcharge it.
- Lead-acid: a constant voltage of about 14.4 V for charging, then held at about 13.6–13.8 V (float) if it stays connected.
- NiMH: needs a charger that detects the end of charge, which smart chargers do.
Don't use a charger for one type on another. And charging time is worked out in the battery charge time calculator.
How do you choose?
- A simple device that uses little and needs a new battery rarely: alkaline.
- A portable ESP32 or Arduino project: one lithium cell + charger + a regulator or boost depending on the voltage you need.
- Solar or large storage: LiFePO4 or lead-acid.
The voltage changes
A battery's voltage isn't constant: a lithium cell starts at 4.2 V and falls to 3 V. If the circuit needs a steady voltage, you need a regulator. And you can measure its voltage with the microcontroller through a voltage divider to know how much is left.
In a 12 V lead-acid battery, the resting voltage (no load and no charging for a few hours) tells you roughly the state of charge:
| Voltage | Approx. charge |
|---|---|
| 12.7 V | 100% |
| 12.4 V | 75% |
| 12.2 V | 50% |
| 12.0 V | 25% |
Lithium has a flatter curve in the middle, so the voltage tells you "full" or "nearly empty" more than an exact percentage. Measuring it in code is in the measuring battery voltage article.
Heat
All batteries hate heat. Lithium in particular has its life cut sharply if left in a car in the sun or next to something hot, and charging it in severe cold (below zero) damages it. Lead-acid loses water faster in summer and needs checking. Keep batteries somewhere ventilated and out of the sun, and don't charge a lithium battery while it's hot.
FAQ
What should I do with a swollen battery? Don't charge it and don't puncture it. Put it somewhere it can't start a fire (a metal box or sand) away from anything else, and hand it in at a battery collection point. Don't put it in the ordinary rubbish.
Can I charge NiMH cells in an ordinary battery charger? Ordinary alkaline cells can't be recharged at all. NiMH cells need a NiMH charger.