The TP4056 battery charger module is one of the most essential components for any battery-powered electronics project. Costing under ₹30, this tiny module safely charges single-cell lithium-ion (18650) and lithium-polymer (LiPo) batteries with proper CC/CV (Constant Current/Constant Voltage) charging profiles. This guide covers everything about using the TP4056 for LiPo and 18650 charging in your Arduino, ESP32, and IoT projects.
Table of Contents
- What Is the TP4056 Module?
- Module Variants: With and Without Protection
- Basic Wiring and Connections
- Charging Profile and LED Indicators
- Solar Panel Charging Setup
- Project Examples with TP4056
- Safety Precautions for Lithium Batteries
- Frequently Asked Questions
- Conclusion
What Is the TP4056 Module?
The TP4056 is a complete linear charger IC for single-cell lithium-ion batteries. The module version adds input protection, LED indicators, and convenient connection points. Key specifications:
- Input voltage: 4.5V – 5.5V (USB micro-B or USB-C connector on module)
- Charging voltage: 4.2V (precisely regulated for Li-ion chemistry)
- Charging current: 1A default (adjustable by changing RPROG resistor)
- Charging method: CC/CV (constant current until 4.2V, then constant voltage until current drops to ~100 mA)
- Termination: Automatic when charge current drops below 1/10th of set current
- Temperature protection: Built-in thermal regulation (reduces current if chip overheats)
- Package: Tiny PCB module, ~25mm x 19mm
- Price (India): ₹15-30 per module
Module Variants: With and Without Protection
TP4056 Without Protection (Red Module)
Basic charging only. Charges the battery but provides NO protection against over-discharge, over-current, or short circuit. Only use this if your battery already has a built-in protection circuit (most branded 18650 cells do).
TP4056 With DW01A + FS8205 Protection (Blue Module)
Recommended for most projects. This module includes a DW01A battery protection IC and FS8205 dual MOSFET that provides:
- Overcharge protection: Cuts off at 4.25V
- Over-discharge protection: Cuts off at 2.4V (protects battery from deep discharge)
- Overcurrent protection: Cuts off at ~3A
- Short circuit protection: Instantly disconnects output if shorted
The protected module has OUT+ and OUT- pads for your load, separate from the BAT+ and BAT- pads for the battery. The protection circuit sits between the battery and your load.
Basic Wiring and Connections
TP4056 Module (with protection) Wiring:
USB/Solar Input:
5V source --> IN+ pad (or micro-USB connector)
GND --> IN- pad
Battery Connection:
18650 (+) --> BAT+ pad
18650 (-) --> BAT- pad
Load Connection (Arduino/ESP32):
OUT+ --> Device VCC (or boost converter input)
OUT- --> Device GND
IMPORTANT: Connect load to OUT+/OUT- pads, NOT directly to BAT+/BAT-
The protection circuit only protects through the OUT pads.
Adjusting Charge Current
The default 1A charging current is set by a 1.2K ohm resistor (RPROG). For different currents:
| RPROG Value | Charge Current |
|---|---|
| 10K ohm | 130 mA |
| 5K ohm | 250 mA |
| 2K ohm | 580 mA |
| 1.2K ohm (default) | 1000 mA |
For small LiPo batteries (under 500 mAh), reduce the charge current by replacing RPROG with a higher value resistor. Charging at too high a current can damage small batteries. Rule of thumb: charge at 1C or less (e.g., 500 mA for a 500 mAh battery).
Charging Profile and LED Indicators
The TP4056 uses a standard CC/CV (Constant Current / Constant Voltage) charging algorithm:
- Trickle charge phase: If battery voltage is below 2.9V, charges at ~10% of set current to safely bring deeply discharged cells up.
- Constant current phase: Charges at full set current (1A default) while voltage rises from ~3.0V to 4.2V. This is the longest phase.
- Constant voltage phase: Holds voltage at precisely 4.2V while current gradually decreases.
- Termination: Charging stops when current drops below 1/10th of set current (~100 mA for 1A setting).
LED Status
- Red LED on: Charging in progress
- Blue/Green LED on: Charging complete (standby)
- Both LEDs dim or flickering: No battery connected or faulty connection
Solar Panel Charging Setup
The TP4056 works excellently with small solar panels for off-grid IoT sensor nodes:
Solar Charging Setup:
[5V-6V Solar Panel] --> [TP4056 Module] --> [18650 Battery]
|
[Boost Converter (MT3608)]
|
[ESP32 / Arduino]
Solar Panel Selection
- Voltage: 5V-6V panel (open-circuit voltage should be 5.5-7V to ensure 5V under load)
- Current: Match to desired charge rate. A 5V/1W panel provides ~200 mA, taking ~15 hours to charge a 3,000 mAh 18650. A 5V/3W panel provides ~600 mA for faster charging.
- Schottky diode: Add a Schottky diode (1N5819) between panel and TP4056 to prevent reverse current at night. Some modules have this built-in.
// ESP32 Solar-Powered Weather Station
// TP4056 + 18650 + boost converter + ESP32 deep sleep
#include
#include
#define BATTERY_PIN 34 // Voltage divider from battery
#define SLEEP_TIME 900 // 15 minutes in seconds
void setup() {
// Read sensors
float temperature = readTemperature();
float humidity = readHumidity();
float batteryVoltage = readBatteryVoltage();
// Send data via WiFi
connectWiFi();
sendToCloud(temperature, humidity, batteryVoltage);
// Deep sleep for 15 minutes
esp_sleep_enable_timer_wakeup(SLEEP_TIME * 1000000);
esp_deep_sleep_start();
}
float readBatteryVoltage() {
// Voltage divider: 100K + 100K
// Battery voltage = ADC reading * 2 * 3.3 / 4095
int raw = analogRead(BATTERY_PIN);
return raw * 2.0 * 3.3 / 4095.0;
}
void loop() {} // Never reached (deep sleep resets)
Project Examples with TP4056
1. Portable Arduino Power Bank
TP4056 + 18650 cell + MT3608 boost to 5V = rechargeable power bank for Arduino. Add a voltage divider and ADC pin for battery level monitoring.
2. Solar-Powered Weather Station
Small solar panel charges 18650 via TP4056. ESP32 wakes periodically, reads sensors, transmits data, and returns to deep sleep. Can run indefinitely with adequate sun.
3. Wireless Sensor Nodes
Each node uses TP4056 + 18650 + ESP32 in deep sleep mode. At 10 uA sleep current, a 3,000 mAh battery lasts months between charges.
4. LED Flashlight/Lamp
TP4056 charges the battery via USB-C. High-power LED driver circuit uses the battery directly. Simple, practical, and makes a great beginner project.
Safety Precautions for Lithium Batteries
Lithium batteries can be dangerous if mishandled. Follow these rules strictly:
- Never charge below 0°C or above 45°C. Charging cold lithium cells causes internal lithium plating, which can lead to internal short circuits and thermal runaway.
- Never over-discharge below 2.5V. Deep discharge causes permanent capacity loss and can make the cell unstable on recharging. The DW01A protection on the blue TP4056 module prevents this.
- Use cells with protection circuits (most branded 18650 cells have them built-in). Bare cells from battery packs may lack protection.
- Do not puncture, crush, or incinerate lithium cells. They contain flammable electrolyte.
- Store at ~50% charge if not using for extended periods. Storing fully charged or fully discharged degrades battery life faster.
- Use fireproof charging bags for unattended charging of LiPo batteries (especially soft-pouch types).
Frequently Asked Questions
Can I use TP4056 to charge 2 cells in series (7.4V)?
No. The TP4056 is designed for single-cell (3.7V nominal, 4.2V full) charging only. For multi-cell packs, use dedicated multi-cell BMS (Battery Management System) modules with balanced charging. Connecting two TP4056 modules for two cells in series is possible but requires careful isolation of the USB power inputs.
Can I use the device while it is charging?
Yes, but with caveats. The TP4056 may not correctly terminate charging if the load draws current during charging. The charge current splits between the battery and the load. For reliable charge termination, disconnect the load during charging, or use a load-sharing circuit with a MOSFET.
What happens if I connect a 12V source to the TP4056?
The TP4056 IC will be damaged immediately. Maximum input is 8V (datasheet), and practically, keep input between 4.5V-5.5V. If using a solar panel with higher open-circuit voltage, add an LDO regulator or buck converter before the TP4056.
How long does it take to charge an 18650 battery?
A typical 3,000 mAh 18650 takes approximately 3-4 hours at 1A charge rate. A 500 mAh LiPo takes about 30-40 minutes at 1A (but you should reduce charge current to 500 mA for this small cell). The CC phase takes ~70% of the time, the CV phase takes ~30%.
Can I charge lithium iron phosphate (LiFePO4) cells with TP4056?
No. LiFePO4 cells require 3.6V charging voltage vs 4.2V for Li-ion. The TP4056 charges to 4.2V, which will overcharge and damage LiFePO4 cells. Use a dedicated LiFePO4 charger IC like CN3058 for iron phosphate chemistry.
Conclusion
The TP4056 module is an indispensable component for battery-powered projects. At under ₹30 for the protected version, there is no reason not to include proper battery charging and protection in every portable project you build. Combined with an 18650 cell and a boost converter, it creates a complete rechargeable power system for Arduino, ESP32, and any other microcontroller project.
Always use the protected (blue) module variant, match the charge current to your battery capacity, and follow lithium battery safety guidelines. Your projects will run longer, charge safely, and last for years.
Find TP4056 modules, 18650 batteries, boost converters, and all power management components at Zbotic’s online store.
Add comment