Choosing the wrong lithium chemistry kills projects: a swollen pouch inside a sealed enclosure, a 3.7V cell that browns out your ESP32, or a charger that overheats a pack it was never meant to charge. Li-ion, LiPo, and LiFePO4 all store energy through lithium-ion movement, but they differ sharply in voltage, safety, cycle life, and charging rules. This guide gives you the specs, charging parameters, wiring, and firmware to pick and use the right cell.
Quick Takeaways
- Li-ion (18650/21700): Best energy density per dollar. Nominal 3.6–3.7V, full charge 4.2V. Ideal for portable and long-runtime builds.
- LiPo (pouch): Thin, flexible shapes and high discharge rates (up to 20C+). Nominal 3.7V, charge to 4.2V. Needs protection against puncture and swelling.
- LiFePO4 (LFP): Safest chemistry with 2,000+ cycles. Nominal 3.2V, full charge 3.6V. Best for outdoor, solar, and always-on IoT nodes.
- Never mix chargers. A 4.2V charger on an LFP cell is an overcharge; a 3.65V LFP charger leaves Li-ion at roughly 0% to 40% capacity.
| Spec | Li-ion (18650) | LiPo | LiFePO4 |
|---|---|---|---|
| Nominal voltage | 3.6–3.7V | 3.7V | 3.2V |
| Full charge voltage | 4.2V | 4.2V | 3.6–3.65V |
| Cutoff voltage | 2.5–3.0V | 3.0V | 2.5V |
| Energy density | 150–270 Wh/kg | 130–200 Wh/kg | 90–160 Wh/kg |
| Cycle life | 500–1,000 | 300–800 | 2,000–5,000 |
| Max discharge | 1–10C (cell dependent) | 5–50C | 1–5C (up to 10C+ high-rate cells) |
| Thermal stability | Moderate | Moderate to low | High |
| Form factor | Cylindrical | Flat pouch | Cylindrical, prismatic |
| Relative cost per Wh | Low | Medium | Medium to high |
How Lithium Chemistries Differ Inside the Cell
All three use lithium ions shuttling between anode and cathode. The cathode material sets the voltage and safety profile.
Li-ion (Lithium Cobalt, NMC, NCA)
Cylindrical cells like the 18650 (18mm x 65mm) and 21700 use a graphite anode and a cobalt-, nickel-, or manganese-based cathode. A typical 18650 holds 2,500–3,500mAh. A 21700 holds 4,000–5,000mAh. These cells give the best runtime per volume and are the default for laptops, power banks, and handheld devices.
LiPo (Lithium Polymer)
LiPo uses the same cathode families as Li-ion, but the electrolyte is a gel or polymer instead of a liquid. That allows thin foil pouches in nearly any shape. Pouch cells have no rigid casing, so they swell when gassing occurs from overcharge, overdischarge, or age. Treat a puffy pouch as dead and dispose of it properly.
LiFePO4 (Lithium Iron Phosphate)
LFP uses an iron-phosphate cathode with a strong phosphorus-oxygen bond. This resists thermal runaway and oxygen release even when abused. The trade-off is lower voltage (3.2V nominal) and lower energy density. LFP also has a very flat discharge curve, which makes state-of-charge estimation by voltage alone unreliable.
Voltage and Discharge Behavior
Voltage defines what your regulator and microcontroller see over the discharge cycle.
| State of charge | Li-ion / LiPo | LiFePO4 |
|---|---|---|
| 100% | 4.20V | 3.60V |
| 75% | ~3.95V | ~3.35V |
| 50% | ~3.75V | ~3.28V |
| 25% | ~3.55V | ~3.20V |
| 0% (cutoff) | 3.0V | 2.5V |
Key design implications:
- A single Li-ion/LiPo cell swings from 4.2V to 3.0V. This is awkward for 3.3V logic. A low-dropout (LDO) regulator such as the MCP1700 or AP2112K-3.3 needs about 200–250mV headroom, so output sags near the bottom of the curve. A buck-boost converter (e.g., TPS63001) holds 3.3V across the full range.
- A single LFP cell at 3.2V nominal can often drive 3.3V logic through a boost converter or, in tolerant designs, directly. Many 3.3V devices run down to about 2.7–3.0V, which fits the LFP plateau well.
- Flat LFP curves mean voltage-based fuel gauging is imprecise. Use a coulomb counter such as the MAX17048 (voltage-based, tuned for Li-ion) or LC709203F. For LFP, prefer coulomb counting like the INA219 or BQ27441 with an LFP profile.
Charging Each Chemistry Correctly
Lithium cells charge with CC/CV (constant current, then constant voltage).
- Constant current: Charge at up to 0.5C–1C until the cell reaches its terminal voltage.
- Constant voltage: Hold the terminal voltage (4.2V or 3.6V) while current tapers.
- Termination: Stop when current falls to about C/10 (e.g., 100mA on a 1000mAh cell).
| Parameter | Li-ion | LiPo | LiFePO4 |
|---|---|---|---|
| CV voltage | 4.20V ±1% | 4.20V ±1% | 3.60–3.65V |
| Standard charge rate | 0.5C | 0.5–1C | 0.5–1C |
| Charge temperature | 0–45°C | 0–45°C | 0–45°C (some −20°C capable) |
| Common charger ICs | TP4056, MCP73831, BQ24074 | MCP73831, BQ24074 | BQ25170, CN3058 |
Warning: The ubiquitous TP4056 module is a 4.2V Li-ion/LiPo charger. Do not use it on LiFePO4. Also, many cheap TP4056 boards lack proper protection unless they include the DW01A + 8205A combination, so check the board.
Never Charge Below 0°C
Charging lithium cells below freezing causes lithium plating on the anode, which permanently reduces capacity and can create internal shorts. Use a charger with an NTC thermistor input, such as the BQ24074 or BQ25895, for outdoor projects.
Protection Circuits: Not Optional
A bare cell is a hazard. Every pack needs a protection circuit module (PCM) or a battery management system (BMS) that covers:
- Overcharge protection: Cuts off at about 4.25–4.30V (Li-ion) or 3.8V (LFP).
- Over-discharge protection: Cuts off at about 2.5–2.8V (Li-ion) or 2.0V (LFP).
- Overcurrent and short-circuit protection: Typically a DW01A controller paired with dual N-channel MOSFETs (FS8205A).
- Cell balancing: Required for any series stack (2S and above).
For multi-cell packs, use a dedicated BMS rated for your series count and chemistry. A 4S Li-ion BMS has 16.8V terminals; a 4S LFP BMS tops out at 14.6V. They are not interchangeable.
Safety Comparison
| Hazard | Li-ion | LiPo | LiFePO4 |
|---|---|---|---|
| Thermal runaway onset | ~150–200°C | ~150°C | ~270°C |
| Swelling risk | Low (rigid can) | High | Low |
| Fire risk when punctured | High | High | Low |
| Tolerance for overcharge | Poor | Poor | Moderate |
| Venting design | Yes (CID/vent cap) | No rigid vent | Yes |
LFP wins on safety. If the device sits near people, flammable materials, or in unattended outdoor enclosures, LFP is the sound choice despite its lower energy density.
Wiring Guide: Single-Cell Li-ion with Protection and 3.3V Regulation
This is a common portable-sensor power chain:
USB 5V ──► [TP4056 + DW01A protection module] ──► Li-ion cell (B+ / B−)
│
OUT+ ──► [Buck-boost 3.3V (e.g., TPS63001)] ──► MCU VCC
OUT− ─────────────────────────────────────────► GND
Wiring notes:
- Connect the cell to B+/B− on a protected charging module.
- Draw load current from OUT+/OUT− so the protection MOSFETs stay in the path.
- Add a 100µF electrolytic and a 0.1µF ceramic capacitor across the regulator output to absorb ESP32 transmit spikes (up to ~500mA bursts).
- Keep battery leads short and use 22–24 AWG wire for currents above 1A.
Firmware: Reading Battery Voltage on an ESP32
Use a 100kΩ / 100kΩ voltage divider from battery positive to an ADC pin. This halves the voltage so a 4.2V cell reads as 2.1V, inside the ESP32 ADC range.
// ESP32 Arduino: Battery voltage and rough state-of-charge for a single Li-ion/LiPo cell
// Divider: BAT+ --[100k]--+--[100k]-- GND ; midpoint to GPIO34 (ADC1_CH6)
const int BAT_PIN = 34; // ADC1 pin (ADC2 conflicts with Wi-Fi)
const float DIVIDER_RATIO = 2.0; // (R1 + R2) / R2 = 200k / 100k
const float ADC_REF = 3.3; // Approximate full-scale reference
const int ADC_MAX = 4095; // 12-bit resolution
float readBatteryVoltage() {
long sum = 0;
for (int i = 0; i < 16; i++) { // Average 16 samples to reduce noise
sum += analogRead(BAT_PIN);
delay(2);
}
float adcAvg = sum / 16.0;
float vPin = (adcAvg / ADC_MAX) * ADC_REF;
return vPin * DIVIDER_RATIO; // Scale back to battery voltage
}
int estimatePercent(float v) {
// Piecewise-linear approximation for Li-ion/LiPo (not valid for LiFePO4)
if (v >= 4.20) return 100;
if (v >= 4.00) return 80 + (v - 4.00) / 0.20 * 20;
if (v >= 3.80) return 55 + (v - 3.80) / 0.20 * 25;
if (v >= 3.60) return 25 + (v - 3.60) / 0.20 * 30;
if (v >= 3.30) return 5 + (v - 3.30) / 0.30 * 20;
if (v >= 3.00) return (v - 3.00) / 0.30 * 5;
return 0;
}
void setup() {
Serial.begin(115200);
analogReadResolution(12); // Set 12-bit ADC
analogSetPinAttenuation(BAT_PIN, ADC_11db); // Extend input range to ~3.1V
}
void loop() {
float v = readBatteryVoltage();
Serial.printf("Battery: %.2f V (~%d%%)\n", v, estimatePercent(v));
delay(5000);
}
Note: The ESP32 ADC is nonlinear and varies per chip. For accurate readings, calibrate against a multimeter or use the esp_adc_cal library. For LiFePO4, replace the table with a curve that reflects the 3.2V plateau, or use a fuel gauge IC.
Choosing the Right Chemistry by Application
| Application | Recommended chemistry | Why |
|---|---|---|
| Wearables, thin gadgets | LiPo | Flat, custom shapes |
| Drones, RC, high-current bursts | LiPo (high C-rating) | Up to 50C discharge |
| Handheld devices, power banks | Li-ion (18650/21700) | Best Wh per dollar |
| Solar IoT nodes, outdoor sensors | LiFePO4 | Cycle life, wide temperature tolerance, safety |
| Always-on indoor sensors | Li-ion or LiFePO4 | Cost vs. longevity trade-off |
| E-bikes, off-grid storage | LiFePO4 (or Li-ion with strong BMS) | Longevity and safety |
| Mobile robots | Li-ion (high-drain cells) | Balance of power and weight |
Real-World Project: Solar-Powered ESP32 Weather Station
Goal: A year-round outdoor node using LiFePO4 for safety and cycle life.
Bill of materials:
- ESP32 development board (deep sleep current ~10µA with a clean build)
- 1× 18650-format LiFePO4 cell, 1,500mAh, 3.2V
- 6V / 1W solar panel
- CN3058 or equivalent LFP-compatible solar charge controller
- BME280 sensor (I2C: SDA=GPIO21, SCL=GPIO22)
- MCP1700-3302 LDO, or a boost converter if the cell sags under 3.0V
Design steps:
- Wire the solar panel to the charge controller input. Confirm the controller’s CV setting is 3.6V.
- Connect the LFP cell to the controller’s battery terminals with a PCM or BMS.
- Feed the load through a 3.3V regulator suited to the 2.5–3.6V input window.
- Put the ESP32 into deep sleep between readings (e.g., a 10-minute wake interval). Average current falls to roughly 0.1–0.3mA, so a 1,500mAh cell can last weeks without sun.
- Keep the cell in a shaded, ventilated enclosure. Avoid charging below 0°C unless the controller supports low-temperature charging.
Common Failure Modes and Diagnostics
| Symptom | Likely cause | Check or fix |
|---|---|---|
| Cell reads 0V, will not charge | Deep discharge, protection latched | Reset by applying charger; discard if below 2.0V for long periods |
| Pack gets hot when charging | Wrong charger, internal short | Stop immediately; verify chemistry and CV voltage |
| Rapid capacity fade | High temperature, deep cycles | Reduce charge voltage, avoid 100% full storage |
| MCU resets under load | Voltage sag, high internal resistance | Add bulk capacitance; measure sag with a scope; check cell C-rating |
| Pouch cell puffy | Gassing from overcharge or age | Retire and recycle safely; do not puncture |
| Charger LED never turns green | Termination current too low, faulty NTC | Check the PROG resistor; verify NTC input |
Storage and Lifespan Tips
- Store Li-ion and LiPo at 3.8V per cell (about 40–60% charge) in a cool, dry place.
- Store LFP at about 3.3V (50% charge).
- Avoid full discharge. Each time a Li-ion cell drops below 3.0V, you shorten its life.
- Heat is the biggest killer. Every 10°C above 25°C roughly halves calendar life.
- Never leave charging cells unattended inside closed, flammable enclosures.
FAQ
Can I charge a LiFePO4 battery with a Li-ion charger?
No. A standard Li-ion charger terminates at 4.2V, which overcharges an LFP cell (max 3.65V) and can damage it or create a hazard. Use a charger designed for LFP, or one with a selectable chemistry setting.
Which is safer: LiPo or LiFePO4?
LiFePO4 is safer. Its thermal runaway onset is around 270°C versus roughly 150°C for LiPo, and the iron-phosphate cathode does not release oxygen when abused. Pouch LiPo cells are also more vulnerable to puncture and swelling.
Can I use a 3.7V Li-ion battery to power a 3.3V microcontroller?
Yes, with a regulator. An LDO like the MCP1700 works until the cell drops near 3.5V. For full-range operation down to 3.0V, use a buck-boost converter such as the TPS63001 that holds a steady 3.3V.
How many cycles does each lithium chemistry last?
Li-ion typically delivers 500–1,000 cycles, LiPo 300–800, and LiFePO4 2,000–5,000 to 80% capacity under moderate conditions. Real life depends on depth of discharge, temperature, and charge rate.




