Easy Basics: Project 082a Lithum battery charger TP4056

of Acoptex.com in UNO

Basics: Project 082a

Project name: Lithum battery charger TP4056

Tags: charger module with TP4056 controller, Lithum battery charger with protection TP4056, TypeC USB, DW01A, FS8205, MicroUSB, TP4056 1A, charge Li-Ion batteries, TP4056 module, TP4056, Micro USB 5V 1A, Mini USB USB 5V 1A, Lithium battery charger with protection, Lithium battery charging module, Lithium battery charger and protection module, 1A standalone linear Li-lon battery charger with thermal, 18650 battery cell

Attachments: none

NOTE: Due to the nature and characteristics of lithium-ion batteries Acooptex.com is not responsible or liable for any damages, malfunction, injuries, fire, burns, or any other consequences or results that may occur with incorrect or correct use of this module or any battery, device, or item this module is used with, including following or using any instructions, guidance, or direction of any kind from Acoptex.com or others. 

In this project, you needed these parts (Dear visitors. You can support our project buy clicking on the links of parts and buying them or donate us to keep this website alive. Thank you):

1.  Lithum battery charger TP4056 1pc

2. AC to DC Micro USB or Mini USB Power adapter 5V DC 1A 1pc

3. 18650 battery holder with 18650 Li-Ion batteries or 3.7V Li-Ion accumulator.



We will learn about Lithum battery charger TP4056 and how to use it with Li-Ion batteries.

Understanding the Lithum battery charger TP4056

There are two types of Lithum battery charger TP4056: without protection IC and with protection IC.

The TP4056 is a complete constant-current/constant-voltage linear charger for single celllithium-ion 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. No blocking diode is required due to the internal PMOSFET architecture and have prevent to negative Charge Current Circuit. Thermal feedback regulates the charge current to limit the die temperature during high power operation or high ambient temperature. The charge voltage is fixed at 4.2V, and the charge current can be programmed externally with a single resistor. The TP4056 automatically terminates the charge cycle when the charge current drops to 1/10th the programmed value after the final float voltage is reached.TP4056 Other features include current monitor, under voltage lockout, automatic recharge and two status pin to indicate charge termination and the presence of an input voltage.

This tiny module is perfect for charging single cell 3.7V 1 Ah or higher LiPo cells such as 16550s that don't have their own protection circuit. Based around the TP4056 charger IC and DW01 battery protection IC this module will offer 1A charge current then cut off when finished.

Futhermore when the battery voltage drops below 2.4V the protection IC will switch the load off to protect the cell from running at too low of a voltage - and also protects against over-voltage and reverse polarity connection (it will usually destroy itself instead of the battery) however please check you have it connected correctly the first time.

This module is made for charging rechargeable lithium batteries using the constant-current/constant-voltage (CC/CV) charging method. In addition to safely charging a lithium battery the module also provides necessary protection required by lithium batteries. 

This module uses the TP4056 Li-Ion charge controller IC and a separate protection IC. There are other types of modules on the market that use the TP4056 but lack any protection circuits or ICs to provide the necessary protection needed with lithium batteries. This module uses both the TP4056 and the DW01A Li-Ion battery protection IC, which together in combination provide the following protection features:

  • Manage the constant current to constant voltage charging of a connected lithium battery
  • Over-discharge protection - keeps your battery from being discharged below 2.4V, a healthy minimum voltage level for your battery.
  • If a connected battery has been discharged below 2.4V the module will cut output power from the battery until the battery voltage has been re-charged above 3.0V (the over-discharge release voltage), which at that time the module will again allow discharge of power from the battery to a connected load. Although the module cuts output power from the battery during an over-discharge situation, it still allows charging of the battery to occur through the parasitic diode of the discharge control MOSFET (FS8205A Dual MOSFET).
  • Overcharge protection - the module will safely charge your battery to 4.2V.
  • Overcurrent and short-circuit protection - the module will cut the output from the battery if the discharge rate exceeds 3A or if a short-circuit condition occurs.
  • Soft-start protection limits inrush current.
  • Trickle charge (battery reconditioning) - if the voltage level of the connected battery is less than 2.9V, the module will use a trickle charge current of 130mA until the battery voltage reaches 2.9V, at which point the charge current will be linearly increased to the configured charge current.

Can be powered, for charging, from a micro USB cable or the + and - connections. The power source needs to be able to provide at least 1A for the charger to correctly charge a connected battery. Most modern phone/USB chargers can provide 1A or more; refer to the label on your phone charger to verify. If you use the micro USB connection, be sure to use a USB cable that is made to carry at least 1A.

The charge current can be configured externally with the Rprog resistor. The datasheet for the TP4056 includes a table and equation for what resistor values to use for configuring different charge currents.

The module uses a very small amount of current (in the micro amps) whenever it is connected to a battery. It is fine to leave it connected to a battery for long periods, but if you plan to not charge the battery within four months then we recommend disconnecting the module from the battery.


  • Programmable Charge Current Up to 1000mA
  • No MOSFET, Sense Resistor or Blocking Diode Required
  • Complete Linear Charger in SOP-8 Package for Single Cell Lithium-Ion Batteries
  • Constant-Current/Constant-Voltage
  • Charges Single Cell Li-Ion Batteries Directly from USB Port
  • Preset 4.2V Charge Voltage with 1.5% Accuracy
  • Automatic Recharge
  • two Charge Status Output Pins
  • C/10 Charge Termination
  • 2.9V Trickle Charge Threshold (TP4056)
  • Soft-Start Limits Inrush Current
  • Available Radiator in 8-Lead SOP Package, the Radiator need connect GND or impending


  • Charge Controller: TP4056
  • Protection IC: DW01A or DW01P
  • Charge Method: Constant-Current/Constant-Voltage (CC/CV)
  • Charge/Discharge Control MOSFET: FS8205A
  • The input voltage via microUSB or miniUSB: 5V
  • Input voltage via solder pads on left-hand side of module: 4.5V~5.5V
  • Charging current: 1A by default. However you can change this by changing the 1k2 resistor next to the "IN-" pad the bottom-left of the board. See the Rprog table on page three of the TP4056 data sheet for different values and matching charging currents. The "current resistor" can be replaced for other (lower) charge currents, because it is a 0603 size smd resistor (i.e. very small) it can be difficult to replace it. With the mounted resistor the charger can handle larger batteries, but changing the resistor makes it possible to charge smaller batteries.
  • Charging indicator: Red LED, green or blue LED
  • Interface: Mini USB or Micro USB
  • Charge Complete (Float) Voltage 4.2 V ±1.5%
  • Overcharge Detection Voltage 4.3 V ±50 mV
  • Overcharge Release Voltage 4.1 V ±50 mV
  • Over-Discharge Detection Voltage 2.4 V ±100 mV
  • Over-Discharge Release Voltage 3.0 V ±100 mV
  • Overcurrent Protection Threshold 3 A
  • Overcurrent Cutout Delay 10~20 ms
  • Short-Circuit Cutout Delay 5~50 µs
  • Trickle Charge (Battery Reconditioning)
  • Trickle Charge Threshold Voltage 2.9 V ±0.1 V
  • Trickle Charge Current 130 mA ±10 mA
  • Cellular Telephones, PDAs, GPS;
  • Charging Docks and Cradles;
  • Digital Still Cameras, Portable Devices;
  • USB Bus-Powered Chargers,Chargers.

Status lights:

Red LED (D1) means that battery is charging and green (blue) LED (D2) - it is full charged. The red led will be on when charging and it will be flashing when no battery is connected.The green (blue) led will be on when charging is done or no battery is connected.

The charger has a good CC/CV profile and can be adapted for many different charge configurations, for multichannel operation it is easy to use multiple board, for smaller batteries the resistor can be replaced. When used at 1A it might be a good idea to mount it on a small heatsink (Remember isolation), to avoid any slowdown in charging and keep the temperature down.

I do not like that it is using a mini usb connector, a micro usb connector would have been better (That is the same as used on phones).

The Lithum battery charger TP4056 can be adapted for many different charge configurations, for multichannel operation it is easy to use multiple board, for smaller batteries the resistor can be replaced. When used at 1A it might be a good idea to mount it on a small heatsink (remember isolation), to avoid any slowdown in charging and keep the temperature down. A mini USB connector is not a good selection but micro USB connector is better solution as it is the same as used for smartphones.

You can connect two lithium battery cells in parallel to form an equivalent single cell battery with a total capacity of twice that of the individual single cells, but we do not recommend connecting more than two cells at a time to this module. 

You can find DW01A datasheet here, DW01P datasheet here, TP4056 datasheet here, FS8205A datasheet here

Understanding the 18650 batteries

An 18650 battery is a cell that’s 18mm x 65mm in size. The name, 18650, refers exclusively to the size of the lithium-ion battery cell, but there can be minor variations even here. The 18650 has become the new gold standard for replaceable and rechargeable batteries.

18650 batteries are used for powering everything from laptop batteries to electric vehicles. It is a standardized type of lithium-ion battery, cylindrical in shape and measuring 18mm in diameter by 65mm in length (give or take a few 1/10s of a millimeter).

In the world of rechargeable batteries, the lithium ion type last longer than most. Most 18650 cells are rated for between 300 and 500 cycles. That means your cell can charge up to 4.2 volts, and discharge down to 2.5 - 2.8 volts, a maximum of 300 to 500 times without too much much loss in performance.

The highest capacity for an 18650 battery is the NCR18650G which clocks in at 3600mAh. A high capacity cell that is readily available is the 3500mAh LG MJ1.

All 18650 batteries researched need a storage range of between -20 ~ +50°C (-4°F ~ + 122°F) or they will degrade, so this is a good rule of thumb to use. Also keep in mind the maximum temperature for storage should never exceed +60°C (140°F).

Charge time should be consistent. Longer charge times are usually the first sign you should consider replacing a battery. It generally takes about 4 hours to charge an 18650 mod battery using a separate charger.

The 18650 cells can not be used in place of standard AA batteries, rechargeable or otherwise: The nominal voltage of the 18650 is significantly different from the 1.5x3=4.5V of the three AA cells, assuming those are connected in series.

The 18650 is a type of rechargeable lithium-ion battery. Lithium-ion batteries have revolutionized portable devices. They’re in everything, from our smartphones and cameras to baby monitors, fitness gadgets, and flashlights.

The 18650 cell offers the best performance of any consumer-grade rechargeable battery. They’re not susceptible to damage from charging before being fully discharged (as was the case with the old nickel cadmium cells), though they’ll degrade at about the same rate as your smartphone battery.

You can’t simply buy a 18650 battery off the shelf by looking at the capacity (measured in milliamp hours or mAh) alone. The right battery depends entirely on what you’re using it for.

The 18650 isn’t a standardized cell. They’re not all built equally, or with the same task in mind. The most important trait to consider when looking at 18650 batteries is the continuous discharge rating (CDR), also known as amperage capacity.

The CDR is the rate at which current - measured in amps (A) -can be pulled from the battery without it overheating. In order to find out which battery is right for you, you’ll need to match the CDR of the battery with the power draw associated with your device.

If you pick the wrong battery, the cells will get too hot. Heat will damage the battery, reducing its overall lifespan. Overheating may even cause the cells to explode, leak, or damage your device.

Fortunately there’s a direct relation between CDR (A) and battery capacity (mAh). The higher the capacity, the lower the CDR. That means devices that draw less power can take advantage of higher-capacity cells. Hungrier devices will need to use lower-capacity cells in order to safely draw more current.

When shopping for 18650 batteries, you will have a choice between protected and unprotected cells. Protected cells have a small electronic circuit integrated into the battery packaging. This is located one end of the battery, and is indistinguishable from the cell itself. This circuit protects the battery against dangers like excessive charging and discharging, short circuiting, and extreme temperatures. This is designed to protect the devices you use them in, and to prevent damage from explosion or leaking.

Many protected batteries also have a valve which disables the cell permanently if the pressure becomes too high inside the cell. This is commonly what happens when batteries swell, at which point they’re more susceptible to igniting.

Unprotected batteries lack this circuitry. They’re cheaper as a result, and also more prone to the problems that such protections are designed to avoid. If you choose an unprotected cell (and many of the best cells are unprotected), you should take extra care when choosing and using your batteries.

Pay special attention to the discharge rating (CDR) to ensure you’re not drawing excessive power from a cell, or it may overheat. You also need to keep the contacts covered, ideally in a plastic case so the batteries don’t short in your bag or pocket. You’ll also need to make sure you don’t leave your batteries in the charger too long.

To really demonstrate how non-standardized the 18650 battery is, there are two slight variations in size: flat top and button top. This relates to the contacts, specifically the positive contact. Button top batteries will protrude slightly, whereas flat top batteries sit perfectly flush. These extra few millimeters can be the difference between a battery that fits and a battery that doesn’t. If in doubt, look at the existing batteries that came with your device, consult a manual, or contact the manufacturer. For spring-loaded batteries, like flashlights, it shouldn’t make a huge difference.

Like any branded product, you’ve got to beware of the fakes. It’s common for many vendors to buy up cheap cells, rewrap them as name brands, and sell them through Amazon or eBay as genuine items. It’s potentially dangerous. If you buy a battery for a high-powered device believing it to have an adequately safe CDR, you could injure yourself or damage your device when the battery turns out to have an entirely different rating.Battery scammers are good at what they do. A genuine battery and a fake are incredibly difficult to tell apart. From the wrapping, to the branding, to the online listings -they look like the real deal. The only way you can tell a fake from a genuine battery is by weight. Most brands have made the weight of their genuine batteries available somewhere. You should cross-reference any batteries you buy online with the manufacturer’s specification. To check a particular cell, try searching the internet for its name followed by word "datasheet". This will list the battery weight, capacity and maximum CDR.

The best batteries are generally produced by Sony, Samsung, LG, Panasonic/Sanyo. That doesn’t mean all other maker brands are untrustworthy, but these brands provide reliable and trustworthy CDR ratings and enough information for you to spot fakes.

Battery charging

Replacing the standard 1.2 kohm resistor with a 2.157 kohm reduces the charge current to 470mA.

The resistor is a 0603 SMD resistor, i.e. it is 1.6 x 0.8 mm. Here a 0603 resistor is placed next to an old style quarter watt resistor. 

Below 2.85 V the charger will charge with about 80 mA in 1A configuration (blue led is on).

Above 2.85 V the charger is applying regular charge current. When charger is disconnected from power, but with a battery in, it will draw below 1uA from the battery.

When the charge current goes below the termination current the charging is stopped and it will charge with around 4 uA.

The charger will restart charging when the cell drops to 4V. The charger will not restart after a power loss or battery insertion, except if the battery voltage is below 4V.

This chip uses 1/10 of the charge current as termination current.

Reducing the supply voltage to 4.5 V, increases the charge time and reduces the temperature, but the final voltage is slightly lower. Increasing the voltage does increase the temperature, but also reduces the current. When the chip gets to hot, it reduces the current.

We have added a heatsink to keep the temperature down (Remember electric isolation between PCB and heatsink). It works very well, the temperature is lower than with 5V supply.

A 16340 battery is a more reasonable size to charge with 0.5A. Replacing the standard 1.2 KOhm resistor with a 4.726 KOhm reduces the charge current to 210 mA.

Signals and connections of the Lithum battery charger TP4056

 Please note that if you connect the battery backwards it gives smoke and Lithum battery charger TP4056 will die.

B+ and B– (or BAT+ and BAT-) - pads to connect the Li-Ion battery;

IN+ and IN- ( or + and -) - alternative power supply connected to these pads

TEMP - pad used for battery temperature detection

OUT+ and OUT- - A load (something for the Li-Ion battery to power) can be connected to the pads on the right-hand side


NOTE: Due to the nature and characteristics of lithium-ion batteries Acooptex.com is not responsible or liable for any damages, malfunction, injuries, fire, burns, or any other consequences or results that may occur with incorrect or correct use of this module or any battery, device, or item this module is used with, including following or using any instructions, guidance, or direction of any kind from Acoptex.com or others. 

Step by Step instruction

  1. Connect micro USB or mini USB cable for power or 5V DC to pads marked IN+ and IN- on left-hand side of the module.
  2. Connect battery/cell used for charge to B+/B- pads on right-hand side of module
  3. A load (something for the battery to power) can be connected to the OUT+/OUT- pads on the right-hand side. Please note that a load should be disconnected when charging. Never charge your battery at a rate greater than 1C.
  4. Caution must be used when connecting two cells in parallel. Both cells must be at the same voltage level otherwise if one cell has a lower voltage than the companion cell the higher voltage cell will discharge into the lower voltage cell in an attempt to bring the two cells to the same voltage, which will eventually balance out, but if the voltages of the two cells differ enough the resulting current through both cells can be high enough to cause the cells to overheat or worse. 
  5. When charging two parallel cells connected to this charge module the charge current through each cell will be half of the total charge current from the charge module, that is if each of the cells have equivalent voltage levels.


We learnt about Lithum battery charger TP4056 and how to use it with Li-Ion batteries.


  • No libraries required

Project resources:

  • No attachments

Other projects of Acoptex.com
Easy Basics: Project 083d Sipeed Maixduino Kit for RISC-V AI and IoT of Acoptex.com in ESP8266 ESP-32 16-06-2019
Easy Basics: Project 076f ESP32 Development board - How to use GPIO pins of Acoptex.com in ESP8266 ESP-32 03-06-2019

« Go back to category
Is this project fake? Report it!   
Recommend to a friend
Published at 01-06-2019
Viewed: 103 times