To reliably power an ESP32 with a battery, use a single-cell (1S) 3.7V Li-ion or LiPo battery paired with a high-efficiency DC-DC buck-boost converter like the TI TPS63020 to deliver a stable 3.3V directly to the 3V3 pin. Avoid feeding raw battery voltage into the VIN pin; the onboard AMS1117 linear dropout (LDO) regulator will waste up to 40% of your capacity as heat and drop out below 4.0V, causing brownouts during WiFi transmission spikes. This guide assumes a standard 25°C ambient environment, copper PCB traces, and a typical ESP32-WROOM-32 module.

System Block Architecture & Component Selection

A robust battery-powered embedded system requires a strict source-to-load pipeline. You cannot simply wire a battery to a microcontroller and expect stable operation across the entire discharge curve. The architecture must include protection, regulation, and conversion.

The Optimal Pipeline:
Battery (1S 18650 Li-ion) → DW01A/8205A Protection Circuit Module (PCM) → TP4056 Charge Controller → TPS63020 Buck-Boost Converter → ESP32 3V3 pin.

The TPS63020 is critical here. A 1S Li-ion cell operates between 4.2V (fully charged) and 3.0V (depleted). Because the ESP32 requires a strict 3.3V, a standard buck converter will fail when the battery drops below 3.5V (accounting for dropout voltage), and a standard boost converter will overvoltage the chip when the battery is full. A buck-boost topology seamlessly transitions between stepping down and stepping up the voltage as the battery drains.

Table 1: Battery Chemistry & Regulator Pairing Matrix
Battery Source Nominal V Regulator Topology Recommended IC Est. Efficiency Best Use Case
1S Li-ion (18650) 3.7V Buck-Boost TI TPS63020 90% - 96% Active WiFi/BLE logging
1S LiPo (Pouch) 3.7V LDO (Low Dropout) Microchip MCP1700 60% - 80% Ultra-low power deep sleep (<10µA)
2S Li-ion (7.4V) 7.4V Synchronous Buck MPS MP2359 85% - 92% Driving 5V peripherals + 3.3V logic
4x AA Alkaline 6.0V Step-Down Buck TI TPS5430 80% - 88% Low-cost, non-rechargeable field nodes

Sizing Math, C-Rates, and Depth of Discharge

Sizing a battery for an ESP32 requires calculating the average current draw, factoring in the regulator's efficiency, and applying the battery's usable Depth of Discharge (DoD). While Peukert's Law dictates that a battery's effective capacity decreases at higher discharge rates, the Peukert exponent ($k$) for lithium-ion is very close to 1.05 (compared to 1.3 for lead-acid). At the low C-rates typical of microcontrollers, the Peukert penalty is negligible (under 1%), so we rely on efficiency and DoD derating.

Worked Sizing Example:
Assume an ESP32-C3 waking up to transmit a sensor payload via WiFi once per minute. The active TX spike is 250mA for 2 seconds, and deep sleep draws 10µA. The time-averaged continuous load is roughly 85mA.

  • Battery: 3000mAh 18650 Li-ion
  • DoD: 85% (We cut off at 3.0V to prevent cell degradation; 15% of capacity is left unused)
  • Regulator Efficiency: 90% (TPS63020 at 85mA load)

Runtime Formula:
Runtime = (Capacity × DoD × Efficiency) / Average Load
Runtime = (3000mAh × 0.85 × 0.90) / 85mA = 27 hours

Charge and Discharge Limits

Lithium-ion cells have strict electrochemical boundaries. Exceeding them causes copper dendrite formation or cathode breakdown.

  • Max Charge Voltage: 4.2V ± 0.05V. Never trickle charge a Li-ion cell once it hits 4.2V.
  • Min Discharge Voltage: 2.5V to 3.0V. Discharging below 2.5V causes irreversible capacity loss.
  • Discharge C-Rate: The ESP32's 250mA WiFi spike on a 3000mAh cell represents a 0.08C draw. Standard 18650 cells support 1C to 3C continuous discharge, so the microcontroller will never stress the cell's internal resistance.

Charger Sizing for the Load

When sizing the charge controller (the DC equivalent of an inverter/charger in AC systems), you must match the charge current to the cell's capacity. The ubiquitous TP4056 module defaults to a 1A charge current (set by a 1.2kΩ PROG resistor). For a 3000mAh cell, 1A is a ~0.33C charge rate, which is perfectly safe and yields a ~3.5 hour charge time. However, if you step down to a 500mAh LiPo pouch cell for a compact wearable, a 1A charge rate (2C) will overheat the cell and trigger the PCM's thermal shutdown. You must swap the TP4056 PROG resistor to 2.0kΩ to set the charge current to 500mA (1C max).

Series vs Parallel Configurations & Safety Limits

When a single cell cannot meet your voltage or runtime requirements, you must configure multiple cells. The electrical consequences are absolute:

  • Series (S): Increases voltage (V), while Amp-hours (Ah) remain constant. A 2S pack yields 7.4V nominal at 3000mAh. This requires a balancing Battery Management System (BMS) to ensure no single cell exceeds 4.2V during charging, and a higher-voltage buck converter (like the MP2359) to step down to 3.3V.
  • Parallel (P): Increases capacity (Ah), while voltage (V) remains constant. A 2P pack yields 3.7V nominal at 6000mAh. This extends runtime but requires careful cell matching.
⚠️ CRITICAL LITHIUM FIRE-SAFETY CALLOUT:
Never wire mismatched cells in parallel. If you connect a fully charged cell (4.2V) to a depleted cell (3.2V), the voltage delta will force a massive, uncontrolled equalization current from the higher cell into the lower cell. This bypasses the BMS, generates extreme internal heat, and can trigger thermal runaway, venting toxic gas and causing a lithium fire. Always use cells of the exact same chemistry, brand, capacity, and age, and ensure they are at the exact same State of Charge (SoC) before paralleling them. For multi-cell projects, use a pre-built pack with an integrated BMS rather than raw holders.

For 95% of ESP32 projects, a 1S (single cell) parallel configuration is vastly superior to series. It avoids the complexity and quiescent current draw (typically 30µA to 100µA) of a multi-cell balancing BMS, which can completely ruin your deep-sleep current budget.

Decision Tree: Choosing Your Battery Topology

Selecting the right power architecture depends on your physical constraints, sleep states, and peripheral requirements. Use the decision matrix below to finalize your bill of materials.

Table 2: ESP32 Power Topology Decision Tree
Project Constraint Recommended Topology Key Component Trade-off / Gotcha
Maximum runtime in a large enclosure (e.g., weather station) 1S Li-ion (18650 or 21700) TPS63020 Buck-Boost Battery holder adds bulk; 21700 requires custom PCB footprint.
Ultra-compact wearable or PCB-integrated 1S LiPo Pouch Cell MCP1700 LDO + MCP73831 LDO wastes heat if active TX is frequent; pouch cells puncture easily.
Must drive 5V relays or 12V MOSFET gates alongside 3.3V logic 2S or 3S Li-ion Pack 2S BMS + Dual-Output Buck BMS quiescent draw (~50µA) limits deep-sleep battery life to a few months.
Disposable / Maintenance-free short-term deployment 3x AA Lithium Primary (Li-FeS2) Direct to VIN (if >4V) or Buck Non-rechargeable; voltage sags heavily under 250mA WiFi spikes.

By bypassing the ESP32's inefficient onboard LDO and properly sizing your DC-DC conversion stage, you can reliably extract weeks or months of runtime from standard lithium cells. Always verify your deep sleep current with a multimeter in series with the battery after the regulator to ensure your firmware is actually shutting down the WiFi and Bluetooth radios before entering sleep.

Sources consulted for power topology and safety parameters:
Espressif ESP32 Datasheet (Power Consumption & Pinout)
Texas Instruments TPS63020 Buck-Boost Converter Datasheet
Adafruit Learning System: Li-Ion and LiPoly Batteries Guide