Using the TP4056: There's a right way, and a wrong way for safe charging of Lithium Ion batteries with this chip!

TP4056: A LiPo battery charger IC (page 1, page 2 is here).

  • An easy to use battery charger chip.

  • Charging current from 130mA to 1A (default); set by resistor.

  • Learn to use it the correct way.

  • Find out how to correct its operation for Safe In-Circuit Charging.

The TP4056 chip is a lithium Ion battery charger for a single cell battery, protecting the cell from over and under charging. It has two status outputs indicating charging in progress, and charging complete and a programmable charge current of up to 1A.

You can use it to charge batteries directly from a USB port since the working input voltage range is 4V ~ 8V. However, remember the maximum current from a USB port is 500mA.

There are two types of common breakout boards for this chip:

  • One with only the charger chip on board.
  • One with three chips on board.

Here you are looking at the 3 chip breakout board (TP4056 - middle, DW01A - top right, and 8205A dual MOSFET - bottom right).

tp4056 breakout board

What you can learn here:

  • How to use the TP4056 breakout board.
  • How to use the TP4056 safely.
  • How the DW01A works on the TP4056 breakout board.
  • How to set temperature limits using the TP4056 TEMP input.

Note: You need to change the current programming resistor on the breakout board to match the lithium battery you are using - the default is 1.2k which is for a 1Ah (1000mAh) battery.

Note: Follow this link to learn how to use the DW01A correctly.

Lithium batteries can be dangerous if not charged properly and that's why the TP4056 is useful as it stops over voltage and current charging by detecting specific voltage conditions.

Warning

There are a lot of circuits out there that show the use of the TP4056 as both a charger and a load driver - Not Good. If a load is attached to the battery while charging, then the TP4056 may not detect when the charge current has fallen to C/10. So it could continue charging - this could be dangerous.

You should never use the TP4056 as a charger and as a load driver at the same time. When charging the battery, switch off the load, and when loading the battery, switch off the charger. Alternatively use a PMOSFET, a resistor and a Schottky diode (See page 2 on how to do this).

Lithium batteries can not absorb overcharge - the current must be cut off after charging. If not there could be thermal runaway.

TP4056 Features

  • Constant Current / Constant voltage charging method.
  • C/10 Charge termination.
  • 2.9V trickle charge threshold (for deeply discharged batteries).
  • Upper charge stop voltage : 4.2V.
  • Soft start inrush current limit.
  • Automatic recharge (keeps batteries optimally charged when connected to a charger).

TP4056 module Datasheet

Download the TP4056 Datasheet here.

TP4056 Specifications

  Parameter
Value
Voltage Supply (Vs)
4V0 ~ 8V0
Charge Voltage termination (accuracy)4.2V(1.5%)
Supply current (Rprog=1.2k: 1A chrg)
150uA (typ)
Supply current (Chrg ended/ shutdown)55uA (typ)
Ibat (Rprog=1.2k: 1A chrg )1050mA (max)
Ibat (Stand by mode; Vbat = 4.2V)-6uA (max)
Vtrckl(Rprog=1.2k: Vbat:rising)2.9V (typ)
Itrckl (Rprog=1.2k: Vbat<Vtrckl )140mA max)
Vtrhsy(Rprog=1.2k)80mV (typ)
Operating temperature
-40°C ~ 85°C

            [trckl = Trickle charge, trhsy = Trickle Charge Hysteresis]

TP4056 Current Programming Resistor

The programming resistor (R3 or Rprog) is set to a default value of 1k2 which provides 1A programming charge rate or 1C; this is the maximum charging rate for the chip. If your battery is not 1000mAh (1Ah), then you need to remove R3 and replace it with the correct one following the information in the table below.

TP4056 RPROG Current setting resistor

RPROG on the breakout board is R3.

RGRPOG (kΩ)
IBAT (mA)
10
130
5
250
4
300
3
400
2
580
1.66
690
1.5
780
1.33
900
1.2
1000

TP4056 Status indicator LEDs

The table shows the state of LEDs for various charging states:

Charge state
Red LED
CHRG

Green LED STDBY
Charging
Bright
Extinguish
Charge Termination.
ExtinguishBright
Vin too low; temperature of battery too low or too high; No battery.
ExtinguishExtinguish
BAT PIN Connect 10u Capacitance; No Battery.
Green LED bright, Red LED

TP4056 Charger Module Schematic

This is the schematic of the popular breakout board with label 03962A this shows the TP4056 pinout for the breakout board.

TP4056 breakoutboard schematic

[ Source:www.sunrom.com/p/lithum-battery-charger-with-protection-microusb ]

When charging a battery using the above board connect the battery to B+ and B- and disconnect OUT+ and OUT- from your circuit. When using the battery disconnect the 5V input and take the output voltage from OUT+ and OUT- to your circuit.

This should really be thought of as one of those charger packs where:

    "you don't use the charger pack while you are charging it".

TP4056 Connections

The following diagram shows a typical setup (from the datasheet). The block diagram also shows the TP456 pin numbers for the 8 pin SMD device.

Typical circuit for tp4056
Here you can see the two status LEDs (CHRGn, STDBYn), Battery connection (BAT), Current control connection (PROG) and TEMP connection. Some LI batteries have an internal thermistor that you can connect as shown above. In the breakout boards available generally TEMP is not used and connected to Ground.

TP4056 reverse polarity protection

The TP4056 does not give you reverse polarity protection so if you wire up the battery the wrong way round then you'll get smoke!

Actually, there is no TP4056 reverse polarity protection and the DW01A battery protection IC (on the breakout board) is being used in the wrong way (or not in the best way)! If used correctly the DW01A does provide reverse polarity protection for a battery.

Note: Follow this link to learn how to use the DW01A correctly.

The reason is that the DW01A is really designed to beattached directly to the battery and not fitted to the TP4056 breakout board. If this were the case then the DW01A would provide reverse polarity detection and prevention.

DW01A Battery Protector Chip

On some breakout boards there are an extra 2 chips. One is the DW01A and the other is a dual N Channel MOSFET required by the DW01A chip.

This chip provides battery protection but it is not used in quite the right way on this board, so it can not prevent reverse polarity protection and it will not activate for over voltage limits (the DW01A limits are outside the TP4056 limits meaning the TP4056 chip will not allow the voltage to trigger the DW01A voltage limits).

The DW01A here provides over-current and deep discharge prevention (when the TP4056 is not powered). It should provide all of the following:

Charger input protection

The CS pin is connected to the negative terminal of the charger input (via a 1kΩ resistor) and performs the following functions:
  • Short Circuit detector.
  • Over current detector.
  • Charger Detector.
  • Reverse charger detection (overstress high current?).

Battery monitoring

VCC and GND are connected across the battery where two voltages are detected:

  • Overcharge Detector (battery voltage too high).
  • Overdischarge Detector (battery voltage too low).

DW01A and TP4056 breakout Board

When the TP4056 is powered by VCC

On the breakout board, the chip is soldered to the TP4056 so this can never be connected the wrong way round at the "charger input". At the other side the DW01A does not protect from connecting the battery the wrong way round!

This chip will not activate for battery voltage level problems (unless the TP4056 fails) since the TP4056:
  • Stops discharging at voltages below 2.9V; Here trickle charge activates.
         The DW01A threshold is ~ 2.4V; So it will never activate.
  • Stops charging at voltages above 4.2V.
        The DW01A threshold is  ~ 4.3V; So it will never activate.

The only function that will operate is the over current protection and short circuit protection (or fail safe if the TP4056 chip fails - fairly unlikely). These FETs will activate at around 3A when using the 8205A dual Mosfet (depends on the Vgth characteristic).

When the TP4056 is un-powered

This is when there is no supply voltage to Vcc on the TP4056 i.e. no 5V

TP4056 breakoutboard schematic
When the TP4056 is disconnected i.e. you take out the USB connection, then the protection circuits for discharge of the battery (in the TP4056) are inactive.

In this case the DW01A can activate as it measures and uses the battery voltage itself to operate. You can see in the schematic that B- and OUT- are on separate connections (unlike OUT+ and B+). This allows the DW01A to disconnect the TP4056 or your connected circuit, if the voltage drop is to high  - noting that your ground is OUT- (allowing disconnect via the dual FET).

Continued...

This article continues on page 2, where you can find out how to use the TP4056 in the correct way (most circuits are not correct).

There are 3 parts to this discussion

Part1: Introduction to the TP4056.
Part2: How to add a MOSFET for correct usage of the TP4056
Part3: Understanding the DW01A battery protector in the context of the TP4056 breakout board.


Comments

Have your say about what you just read! Leave me a comment in the box below.

Don’t see the comments box? Log in to your Facebook account, give Facebook consent, then return to this page and refresh it.




Privacy Policy | Contact | About Me

Site Map | Terms of Use