How to Build a LiPo Battery Charger with the TP4056: Circuits, Safety, and BMS Integration
Introduction
LiPo (Lithium Polymer) and 18650 Li-ion cells power everything from RC drones to portable LED projects, but charging them incorrectly is dangerous — swollen packs, venting with flame, or outright explosions are real risks. The TP4056 is a tiny, cheap ($0.50) single-cell lithium charger IC that handles constant-current and constant-voltage charging safely with minimal external components. This guide walks through building a TP4056 charger from scratch, adding a protection circuit (DW01A + FS8205A), integrating a Battery Management System (BMS) for multi-cell packs, and understanding the critical safety rules every maker must follow when working with lithium batteries.
What You Need
- TP4056 module or bare IC with supporting components
- DW01A protection IC and FS8205A dual MOSFET (for protection board)
- 18650 cell holder or JST-PH 2.0 connector for LiPo packs
- Micro-USB or USB-C connector for 5V input
- 10k NTC thermistor (optional, for temperature monitoring)
- Multimeter and breadboard for testing
Understanding Lithium Battery Charging
Lithium cells charge in two phases:
- Constant Current (CC): The charger supplies a steady current (typically 0.5C-1C) until the cell voltage reaches 4.2V. For a 2000mAh cell, 1C = 2A.
- Constant Voltage (CV): Once the cell hits 4.2V, the charger holds that voltage while current naturally tapers down. When current drops below ~10% of the initial charge rate, charging terminates.
Never exceed 4.2V per cell. Never charge below 0°C or above 45°C. Never leave charging lithium unattended.
Step 1: Basic TP4056 Charger Circuit
The TP4056 needs only two external components to work:
- PROG resistor (R3): Sets charge current. Formula: Icharge = 1200 / Rprog (kΩ). A 1.2kΩ resistor gives 1A. A 2.4kΩ resistor gives 500mA.
- Battery connection: BAT+ and BAT- directly to the cell terminals
The TP4056 module (common on Amazon/AliExpress) includes both the IC and the programming resistor on a small PCB with USB input and battery output pads. These modules work out of the box but lack protection circuitry.
Step 2: Add Protection with DW01A + FS8205A
Standalone TP4056 modules do not protect against over-discharge, short circuits, or over-current. A proper protection circuit is mandatory.
DW01A Protection IC Functions
- Over-charge protection: Disconnects load if cell exceeds 4.3V
- Over-discharge protection: Disconnects load if cell drops below 2.4V
- Over-current protection: Disconnects load if discharge current exceeds threshold (typically 3A)
- Short-circuit protection: Instant shutdown on shorted output
FS8205A Dual MOSFET
The DW01A controls this dual N-channel MOSFET which acts as a switch between the battery and the output. The MOSFET turns on during normal operation and off when a fault is detected.
Protection Circuit Wiring
- Connect DW01A VCC to BAT+, GND to BAT-
- Connect DW01A OD and OC pins to FS8205A gate inputs
- Connect FS8205A source to BAT-, drain to output negative
- Output positive connects directly to BAT+
- Add 100nF capacitor between VCC and GND near the DW01A
Most commercially available "TP4056 with protection" modules include both chips on one board.
Step 3: Multi-Cell BMS (2S, 3S, 4S)
For projects needing more than 3.7V, cells are connected in series. A BMS balances and protects the pack.
2S BMS (7.4V)
- Two cells in series
- BMS monitors each cell individually
- Charge voltage: 8.4V (4.2V x 2)
- HX-2S-JH20 or 2S 5A BMS boards are common
3S BMS (11.1V)
- Three cells in series
- Charge voltage: 12.6V
- Standard for RC cars and portable power tools
4S BMS (14.8V)
- Four cells in series
- Charge voltage: 16.8V
- Common for FPV drones and higher-power projects
BMS Wiring
- Connect B- to battery negative (first cell)
- Connect B1 to junction between cell 1 and cell 2
- Connect B2 to junction between cell 2 and cell 3 (for 3S)
- Connect B+ to battery positive (last cell)
- Connect P- and P+ to your load
- Connect C- and C+ to your charger
Always connect balance leads first, then main leads. Verify with a multimeter before powering anything.
Working out the right voltage, capacity, and expected runtime for a custom pack before you build it? The Battery Pack Designer tool handles the series/parallel math for you.
Step 4: Charge Current Selection
Cell Capacity0.5C Rate (Safe)1C Rate (Max)Rprog Value 1000mAh500mA1000mA2.4kΩ / 1.2kΩ 2000mAh1000mA2000mA1.2kΩ / 600Ω 3000mAh1500mA3000mA800Ω / 400Ω 5000mAh2500mA5000mA480Ω / 240ΩFor longevity, charge at 0.5C or less. USB power supplies typically provide 1-2A, which limits practical charge rates.
Step 5: Building a Complete Charger Module
Schematic
USB 5V ──┬── TP4056 VCC ├── USB+ input └── 10μF capacitor to GND TP4056 BAT+ ──┬── Cell positive └── DW01A VCC TP4056 BAT- ──┬── Cell negative ├── DW01A GND └── FS8205A source DW01A OD/OC ── FS8205A gates FS8205A drain ─ Output negative Cell positive ─ Output positive (fused)PCB Layout Tips
- Keep high-current traces short and wide (1oz copper minimum)
- Place decoupling capacitors close to IC power pins
- Include test points for voltage monitoring
- Add a fuse between battery positive and output
- LED indicators: RED = charging, GREEN = fully charged
Step 6: USB-C PD Charging (Advanced)
For faster charging, USB-C Power Delivery can provide 9V or 12V:
- Use a PD trigger board (ZY12PDS or similar) to negotiate 9V from a USB-C PD supply
- Feed 9V into a buck converter to step down to 5V for the TP4056
- Or use a dedicated 1S/2S charging IC that accepts higher input voltages (IP2312, TP5100)
Safety Rules (Non-Negotiable)
- Never charge unattended. LiPo fires happen during charging, not discharge.
- Always use a protection circuit. Bare TP4056 modules are not safe for end-use.
- Charge in a fireproof container. A LiPo safe bag or steel ammo can contains fires.
- Never puncture or crush cells. Internal short = thermal runaway.
- Inspect cells before charging. Puffy, dented, or damaged cells go in salt water, not the charger.
- Use the correct charger voltage. A 4.2V charger on a 2S pack will not charge fully and is a fire risk.
- Balance charge multi-cell packs. Unbalanced cells overcharge/overdischarge and fail catastrophically.
- Store at 3.7-3.8V (50% charge). Never store fully charged or fully depleted.
Troubleshooting
- LED not lighting: Check USB power, verify TP4056 is getting 5V
- Not charging: Check PROG resistor, verify cell voltage is above 2.5V (deeply discharged cells must be trickle-charged)
- Getting hot: Reduce charge current with larger Rprog, add heatsink to TP4056
- BMS cutting out: Check for short circuit, verify cell voltages are balanced
Pro Tips
- Buy name-brand cells (Samsung, LG, Panasonic) — cheap cells have inflated capacity ratings and poor safety
- Add a voltage display module ($1) to monitor cell voltage in real-time
- Use JST-PH 2.0 connectors for LiPo packs — the standard connector in RC and maker communities
- For solar charging, add a 5V solar panel + TP4056 in parallel with a diode
- Document your pack configuration on the enclosure: voltage, capacity, charge date
Conclusion
Building your own lithium battery charger is both empowering and dangerous — the TP4056 makes the circuit simple, but understanding protection, current limits, and safe handling is what separates a working project from a fire hazard. Always include a DW01A+FS8205A protection circuit, size your charge current appropriately, follow the safety rules religiously, and never cut corners on lithium battery projects. Done right, you will have a reliable, reusable power system for hundreds of projects.
Related Guides
- How to Build a LiPo Battery Charger with the TP4056: Circuits, Safety, and BMS Integration
- Multi-Cell Li-ion Battery Packs: BMS Selection, Balancing, and Spot-Welding Tabs
- Battery Fuel Gauge ICs for Lithium Projects: MAX17048, BQ27441, and Coulomb Counting Explained
- LiPo Battery Storage Voltages
- How to Build a Class-D Audio Amplifier: TPA3116, Power Supply, and Speaker Matching
- How to Do Reflow Soldering with a Hot Plate: SMD Assembly for Makers
- How to Order PCBs from JLCPCB: From KiCad Upload to Delivery
- How to Design PCBs with KiCad: From Schematic to Gerber Export