

The TP4056 is a lithium-ion battery charger IC manufactured by Direncnet, with the part ID ESP32. It is specifically designed for charging single-cell lithium-ion batteries using a constant current/constant voltage (CC/CV) charging profile. This component is widely used due to its simplicity, efficiency, and built-in safety features such as thermal regulation and over-voltage protection.
The TP4056 is a versatile and reliable charging IC. Below are its key technical specifications:
| Parameter | Value |
|---|---|
| Input Voltage Range | 4.0V to 8.0V |
| Charging Voltage | 4.2V ± 1% |
| Maximum Charging Current | 1A (adjustable via external resistor) |
| Charging Method | Constant Current / Constant Voltage (CC/CV) |
| Operating Temperature | -40°C to +85°C |
| Standby Current | < 55µA |
| Thermal Regulation | Automatically reduces current to prevent overheating |
| Protection Features | Over-voltage, over-temperature, and reverse polarity protection |
The TP4056 IC typically comes in a 6-pin SOP package. Below is the pin configuration:
| Pin Name | Pin Number | Description |
|---|---|---|
| VCC | 1 | Input power supply (4.0V to 8.0V). Connect to a regulated DC source. |
| GND | 2 | Ground pin. Connect to the system ground. |
| BAT | 3 | Battery connection pin. Connect directly to the positive terminal of the battery. |
| PROG | 4 | Charging current programming pin. Connect a resistor to set the charging current. |
| STAT1 | 5 | Status indicator pin 1. Used to indicate charging status (e.g., charging or complete). |
| STAT2 | 6 | Status indicator pin 2. Used to indicate charging errors or other states. |
The TP4056 can be used to charge a battery that powers an Arduino UNO. Below is an example of monitoring the charging status using the Arduino:
// TP4056 Status Monitoring with Arduino UNO
// Connect STAT1 to Arduino pin 2 and STAT2 to pin 3
const int stat1Pin = 2; // STAT1 pin connected to Arduino digital pin 2
const int stat2Pin = 3; // STAT2 pin connected to Arduino digital pin 3
void setup() {
pinMode(stat1Pin, INPUT); // Set STAT1 as input
pinMode(stat2Pin, INPUT); // Set STAT2 as input
Serial.begin(9600); // Initialize serial communication
}
void loop() {
int stat1 = digitalRead(stat1Pin); // Read STAT1 pin state
int stat2 = digitalRead(stat2Pin); // Read STAT2 pin state
if (stat1 == HIGH && stat2 == LOW) {
Serial.println("Charging in progress...");
} else if (stat1 == LOW && stat2 == HIGH) {
Serial.println("Charging complete.");
} else {
Serial.println("No battery or standby mode.");
}
delay(1000); // Wait for 1 second before checking again
}
Battery Not Charging
Overheating
Status LEDs Not Working
Charging Current Too Low
Q1: Can the TP4056 charge multiple batteries in series?
A1: No, the TP4056 is designed for single-cell lithium-ion batteries only. Charging multiple cells in series requires a specialized multi-cell charger.
Q2: What happens if the input voltage exceeds 8.0V?
A2: Exceeding the maximum input voltage can damage the IC. Always use a regulated power source within the specified range.
Q3: Can I use the TP4056 to power a device while charging the battery?
A3: Yes, but it is recommended to use a load-sharing circuit to prevent overloading the IC and ensure stable operation.
Q4: How do I adjust the charging voltage?
A4: The charging voltage is fixed at 4.2V and cannot be adjusted. For other voltages, consider using a different charger IC.