Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

TP4056

Image of TP4056

TP4056 Lithium Battery Charger Module Documentation

Introduction

The TP4056 is a complete constant-current/constant-voltage linear charger for single-cell lithium-ion and lithium polymer batteries. Its SOP package and low external component count make the TP4056 ideally suited for portable applications. Furthermore, the TP4056 can work within USB and wall adapter power specifications. Common applications include portable devices, like DIY projects, microcontroller boards, and standalone battery chargers.

Technical Specifications

Key Technical Details

  • Charge Voltage: 4.2V ±1%
  • Charge Current: Programmable from 1mA to 1000mA
  • Input Voltage Range: 4.5V to 5.5V
  • Operating Temperature: -10°C to +85°C
  • Battery Overcharge Protection Voltage: 4.2V ±1%
  • Battery Discharge Protection Voltage: 2.4V ±1%
  • Max Charging Current: 1A (adjustable)

Pin Configuration and Descriptions

Pin Number Pin Name Description
1 BAT Battery positive connection
2 GND Ground connection
3 VCC Input power supply (4.5V-5.5V)
4 TEMP Temperature sense (optional)
5 PROG Charge current programming pin
6 STAT Charge status output pin

Usage Instructions

Connecting the TP4056 to a Circuit

  1. Power Supply: Connect a 5V power supply to the VCC and GND pins. Ensure that the power supply can deliver the necessary current for charging.
  2. Battery Connection: Attach the positive terminal of the lithium battery to the BAT pin and the negative terminal to the GND pin.
  3. Setting Charge Current: The default charge current is set to 1A. To adjust the charging current, place a resistor between the PROG pin and GND. The charge current is set by the formula: Icharge = 1200 / Rprog (mA), where Rprog is in ohms.
  4. Charge Status: The STAT pin can be used to indicate the charging status. When charging, the STAT pin will be low. Once charging is complete, it will go high.

Important Considerations and Best Practices

  • Do not exceed the recommended input voltage range (4.5V to 5.5V).
  • Ensure the battery's charge and discharge ratings are compatible with the TP4056.
  • Avoid placing the module in high-temperature environments to prevent overheating.
  • Use a heat sink if charging at currents higher than 500mA.
  • Always double-check wiring before powering up to prevent damage to the module or battery.

Troubleshooting and FAQs

Common Issues

  • LED Indicator Not Lighting Up: Ensure the power supply is correctly connected and within the specified voltage range.
  • Battery Not Charging: Check the battery connections and ensure the battery is not faulty.
  • Module Overheating: Reduce the charging current or attach a heat sink to the TP4056.

Solutions and Tips

  • Adjusting Charge Current: Use a multimeter to measure the current and adjust the PROG resistor accordingly.
  • Improving Heat Dissipation: Attach the module to a metallic surface or use a heat sink.
  • Ensuring Battery Health: Do not leave the battery connected to the charger after charging is complete to avoid over-discharge.

FAQs

  • Q: Can I charge multiple batteries with one TP4056 module? A: No, the TP4056 is designed for single-cell lithium-ion or lithium polymer batteries.

  • Q: What should I do if the TP4056 is getting too hot during charging? A: Ensure that the charging current is not set too high for your application. Consider adding a heat sink or reducing the charge current.

  • Q: Can the TP4056 be used without the temperature sensing pin? A: Yes, the TEMP pin is optional. If not used, it should be left unconnected.

Example Code for Arduino UNO

The following example demonstrates how to read the charge status from the TP4056 using an Arduino UNO.

// Define the STAT pin connected to the Arduino
const int STATpin = 7;

void setup() {
  pinMode(STATpin, INPUT);
  Serial.begin(9600);
}

void loop() {
  // Read the charging status from the STAT pin
  int chargeStatus = digitalRead(STATpin);

  // Check if the battery is still charging
  if (chargeStatus == LOW) {
    Serial.println("Battery is charging...");
  } else {
    Serial.println("Battery is fully charged or no battery connected.");
  }

  // Wait for a second before reading the status again
  delay(1000);
}

This code sets up the Arduino to read the charge status from the TP4056 and print the status to the Serial Monitor. The STATpin should be connected to the STAT pin on the TP4056 module, and the Arduino's ground should be connected to the module's GND pin.

Example Projects

Dive sense
Image of Dive sense: A project utilizing TP4056 in a practical application
This circuit consists of a TP4056 module connected to a 3.7V LiPo battery, providing a charging interface for the battery. The TP4056 manages the charging process by connecting its B+ and B- pins to the battery's positive and ground terminals, respectively.
playbot
Image of playbot: A project utilizing TP4056 in a practical application
This circuit is a battery-powered system featuring an ESP32 microcontroller that controls an OLED display, a motor driver for two hobby motors, an ultrasonic sensor for distance measurement, and a DFPlayer Mini for audio output through a loudspeaker. The TP4056 module manages battery charging, and a step-up boost converter provides a stable 5V supply to the components.
Copy of CanSet v1
Image of Copy of CanSet v1: A project utilizing TP4056 in a practical application
This circuit is a data acquisition and communication system powered by a LiPoly battery and managed by a Raspberry Pi Pico. It includes sensors (BMP280, MPU9250) for environmental data, a GPS module for location tracking, an SD card for data storage, and a WLR089-CanSAT for wireless communication. The TP4056 module handles battery charging, and a toggle switch controls power distribution.
Stimulator
Image of Stimulator: A project utilizing TP4056 in a practical application
This circuit is designed to control the speed of a motor using a PWM motor speed controller powered by a Lithium-Ion battery. The TP4056 module manages battery charging, while a step-up boost converter regulates the voltage supplied to the motor and an Elektro Pad. A rocker switch is included to control the power flow to the motor speed controller.

Example Projects

Image of Dive sense: A project utilizing TP4056 in a practical application
Dive sense
This circuit consists of a TP4056 module connected to a 3.7V LiPo battery, providing a charging interface for the battery. The TP4056 manages the charging process by connecting its B+ and B- pins to the battery's positive and ground terminals, respectively.
Image of playbot: A project utilizing TP4056 in a practical application
playbot
This circuit is a battery-powered system featuring an ESP32 microcontroller that controls an OLED display, a motor driver for two hobby motors, an ultrasonic sensor for distance measurement, and a DFPlayer Mini for audio output through a loudspeaker. The TP4056 module manages battery charging, and a step-up boost converter provides a stable 5V supply to the components.
Image of Copy of CanSet v1: A project utilizing TP4056 in a practical application
Copy of CanSet v1
This circuit is a data acquisition and communication system powered by a LiPoly battery and managed by a Raspberry Pi Pico. It includes sensors (BMP280, MPU9250) for environmental data, a GPS module for location tracking, an SD card for data storage, and a WLR089-CanSAT for wireless communication. The TP4056 module handles battery charging, and a toggle switch controls power distribution.
Image of Stimulator: A project utilizing TP4056 in a practical application
Stimulator
This circuit is designed to control the speed of a motor using a PWM motor speed controller powered by a Lithium-Ion battery. The TP4056 module manages battery charging, while a step-up boost converter regulates the voltage supplied to the motor and an Elektro Pad. A rocker switch is included to control the power flow to the motor speed controller.