Introduction: DIY Lithium-ion Battery Charger

Batteries play an important role in any battery operated project/products. Rechargeable batteries are expensive, as we need to buy battery charger along with batteries (until now) compared to use and throw batteries, but are great value for money. Rechargeable batteries use several different combinations of electrode materials and electrolytes for example, lead-acid, nickel cadmium (NiCd), nickel metal hydride (NiMH), lithium ion (Li-ion), and lithium ion polymer (Li-ion polymer).

I used Li-ion battery in one of my projects and decided to build charger instead of buying an expensive one so, Lets get started.

Step 1: Quick Video

Here is a quick video, which will take you through all steps in few minutes.

Click here to watch it on youtube

Step 2: List of Electronics Components

Step 3: List of Tools

Here is the list of tools used in this Li-ion battery charger.

Now that all tools and components are in place, let's take a closure look at our TP4056 module, which is an integral part of our battery charger.

Step 4: TP4056 Based Lithium Ion Battery Charger Module

Lets get into details of this module. There are two version of this TP4056 based Li-ion charger breakout board available in market; with and without battery protection circuitry. We will be using one with battery protection circuitry.

Breakout board that contains battery protection circuitry, provides protection using DW01A (battery protection IC) and FS8205A (Dual N-Channel Enhancement Mode Power MOSFET) ICs. Hence breakout board with battery protection contains 3 ICs (TP4056+DW01A+FS8205A), whereas the one without battery protection contains only 1 IC (TP4056).

TP4056 is a complete constant-current/constant-voltage linear charger module for single cell lithium-ion batteries. Its SOP package and low external component count makes TP4056 ideal for DIY applications. It can work with USB as well as wall adapters. I have attached an image of pin diagram of TP4056 (Image No.2) along with image of a charge cycle (Image No.3) showing constant-current and constant voltage charging. Two LEDs on this breakout board shows various operating status like charging, charge termination etc (Image No.4).

For safe charging of a 3.7 V Lithium-ion batteries they should be charged at constant-current of 0.2 to 0.7 times their capacity, till their terminal voltage reach 4.2 V, later they should be charged in constant-voltage mode till charging current drops to 10% of initial charging rate. We can't terminate charging at 4.2 V because capacity reached at 4.2 V is only about 40-70 % of full capacity. All this is taken care by TP4056. Now one important thing, charging current is determined by resistor connected to PROG pin, modules available in market generally comes with 1.2 KOhm connected to this pin, which corresponds to 1 Ampere charging current(Image No.5). You can play with this resistor to get desired charging current.

Link to datasheet of TP4056

DW01A is a battery protection IC, Image No 6 shows the typical application circuitry. MOSFETS M1 and M2 are connected externally through FS8205A IC.

Link to datasheet of DW01A

Link to datasheet of FS8205A

All these things are assembled on TP4056 Li-ion battery charger breakout board whose link is mentioned in step No-2. We need to do only two things, give a voltage in the range of 4.0 to 8.0 V at input terminals and connect a battery at B+ and B- terminals of TP4056.

Next, we will build our rest of the battery charger circuitry.

Step 5: Circuit

Now, let's connect electrical components using soldering iron and solder wire, to complete the circuitry. I have attached images of Fritzing schematic and my version of the physical circuitry, have a look at it. Following is description of the same.

  1. '+' terminal of DC jack connects to one terminal of switch and '-' terminal of DC jack connects to GND pin of 7805 regulator.
  2. Other pin of switch is connected to Vin pin of 7805 regulator.
  3. Connect three 100 nF capacitors in parallel between Vin and GND pin of voltage regulator. (Use General purpose circuit board for this purpose)
  4. Connect a 100 nF capacitor between Vout and GND pin of voltage regulator. (Use General purpose circuit board for this purpose)
  5. Connect Vout pin of 7805 voltage regulator with IN+ pin of TP4056 module.
  6. Connect GND pin of 7805 voltage regulator with IN- pin of TP4056 module.
  7. Connect '+' terminal of battery holder to B+ pin and '-' terminal of battery holder to B- pin of TP4056 module.


Note:- if you are using 5 V wall adapter you can skip 7805 regulator part (including capacitors) and directly connect '+' terminal and '-' terminal of wall adapter to IN+ and IN- pins of TP4056 respectively.

Note:- While using 12V adapter, 7805 will get hot when it carries 1A, Heat sink can come handy.

Next, we will assemble every thing in the casing.

Step 6: Assembly: Part 1- Modifying the Enclosure

Follow these steps to modify enclosure in order to fit in the electronics circuitry.

  1. Mark the dimensions of battery holder on the enclosure using a blade knife.(Image No-1)
  2. Use hot-blade to cut through the enclosure as per the marking of battery holder.(Image No-2 and 3)
  3. After making cut using hot-blade enclosure should resemble Image No-4.
  4. Make markings of USB port of TP4056 on enclosure. (Image No-5 and 6)
  5. Use hot-blade to cut through the enclosure as per the marking of USB port. (Image No-7)
  6. Take dimension and make markings of TP4056's LEDs on the enclosure. (Image No-8 and 9)
  7. Use hot-blade to cut through the enclosure as per the marking of LEDs. (Image No-10)
  8. Follow similar steps to make mounting holes for DC jack and switch.(Image No-11 and 12)

After modifying the enclosure, lets fit in the electronics.

Step 7: Assembly: Part 2- Putting Electronics Inside the Enclosure

Follow these steps to put electronics inside the enclosure.

  1. Insert battery holder such that mounting points are outside the enclosure; use glue gun to make a firm joint.(Image No-1)
  2. Place TP4056 module, such that LEDs and USB port are accessible form outside the enclosure, no need to worry if proper measurements were made in previous step, things will fall in place automatically, finally use glue gun to make firm joint.(Image No-2)
  3. Place 7805 voltage regulator circuit; use glue gun to make a firm joint. (Image No-3)
  4. Place DC jack and Switch at their corresponding locations and again use glue gun to make a firm joint. (Image No-4)
  5. Finally after assembly it should look something like Image No-5 inside the enclosure.
  6. Use some spare screws and screw driver to close the back lid.(Image No-6)
  7. Later I even used some black insulating tape to cover up undesirable projections resulted from cutting through hot blade. (filing is also a good option)

Finished Lithium-ion charger looks as shown in Image No-7. Now let's test the charger.

Step 8: Trial Run

Insert a discharged lithium-ion battery inside the charger, connect a 12 V DC input or a USB input. Charger should flash RED led indicating charging is in progress.

After a while, once battery gets charged, charger should flash BLUE led.

I have attached images of my charger performing battery charging and terminating the charging process.

So. Finally we are done.

Thanks for your time. Don't forget to check put my other instructables.


HavasJ (author)2017-07-18


Quick question, so I ordered some of those TP4056 moduls, but my real question is how can I charge high current18650 battery? I'm using Sony VTC6.

Flyboyron (author)2016-05-14

Not sure I understand the point. If you have to purchase a "battery charging module", why not just purchase a "battery charger"?

I've bought numerous different types and brands of Li-ion batteries (always buy protected ones, BTW) and usually they come with an inexpensive charger that works with all the other batteries. If not, I think I paid $3 for a package of two bare chargers recently on either eBay or Amazon.

I suppose there are still places where one can't buy from them, but can one buy the "battery charging module" there?

victoryking (author)Flyboyron2016-05-14

Why buy, when you can make; at similar cost.

csherrit (author)victoryking2016-05-16

why make when you can buy for same price?

JerryBerry (author)csherrit2017-07-02

BECAUSE this place is for those of us that actual MAKE things. If you'd rather buy, why are you even here? We enjoy making things. If I can get a battery charger for $10, but I can build one for $12, I'll build it every time. Simply because, I can.

Flyboyron (author)JerryBerry2017-07-03

Jerry, I get that. My point was, you're not really making it if you're purchasing the biggest part of the device. Not a criticism, just a question. I love to build things, so I get it, for sure. I've built dozens of computers, and am about to finish building a flyable airplane. It just seems like it's only repackaging.
But hey, whatever blows your skirt up, right?

JerryBerry (author)Flyboyron2017-07-03

Okay. So you're talking about th TP4056 itself. Now I understand.

Whatnot (author)Flyboyron2016-05-16

Actually Lion chargers are tuned to the capacity of the battery they come with or are designed for, and it's not a good plan to use them for other capacities, unless you replace a few components to adjust the output for the type you want to charge.

rojascan (author)2016-05-13

This is great! but I've got a question, what happens when the battery has a capacity of 8800 mAh? the constant current to charge the battery should be more than 1 A right? How could I achieve this?

JerryBerry (author)rojascan2017-07-02

ONE TO ONE. A tp4056 can't do more than 1amp.

If you have that many cells, (probably 8) spend the money and build a correct charger.

richfiddler11 (author)rojascan2016-05-15

if the current is lower, the battery will charge at a slower (and safer) rate. Charging a battery at too high a current can cause over heating, fire, explosion, etc so you're better off not pushing the upper limit IMHO.


what if i strung six cells in parrallel off a single one of these tp4056 boards? given that they're 2200mAh (2.2Ah) each so that'll amount to 13200mAh or 13.2Ah, that means that even on the full 1A charge rate that'd take 13hours and 12 minutes to charge the bank right ?

victoryking (author)wenden_jason2017-01-02

I am not sure. I think connecting low impedance batteries in parallel should be done with care. This might work, you may consider connecting blocking diodes while connecting batteries in parallel for protection.


Diodes will waste a lot of power (0.7V * 1A= 700mW per cell, for example). This article suggests that parallel connection is not a problem per se, but sometimes large parallel packs will have fuses in line with each cell in case one develops a bad short:


looks good. You can give it a try.

victoryking (author)rojascan2016-05-13

TP4056 can source up to only 1A, not more than that.

You can have a look at this EEVblog's video-

let me know if the video was useful.

rojascan (author)victoryking2016-05-14

Thank you very much for the video!

SanjuT3 (author)2017-01-30

Can we have two 3.7 v li-ion batteries charging simultaneously from the TP 4056 module

JerryBerry (author)SanjuT32017-07-02

No. one to one

victoryking (author)SanjuT32017-01-31

I won't be able to comment on this as I haven't tried it.

lanikiwi (author)2017-02-05

Hi Everyone.

Q. 1. Why do you have to "discharge" the batteries?

Q. 2. At what stage do you have to "discharge" the batteries?

Q. 3. With brand new batteries, do I have to "discharge" them first before I charge them?

Q.4. How often do I discharge the batteries?

Thank you in advance :)

JerryBerry (author)lanikiwi2017-07-02

There is a big discussion about "discharging" batteries. I say, if they are new, don't bother. And, if they are old, they are probably already discharged. You don't want to go below 2.5 volts on any of them. So, New batteries? Put them in the charger and top them all off. Old batteries, check the voltage. Anything below 2volts, belong in the trash. Otherwise, charge on!

lanikiwi (author)2017-02-05

Hi Everyone,

I'm new to this whole "charging 18650 batteries" using the PT4056 Module. I've just bought 10x PT4056's and soldered them to 10x single 18650 battery holders.

I have seen posts saying I can use a mobile phone charger at 5v/1Amp, to power the PT4056 Module.

The questions I have are:

1. Is there a formula to work out how many amps I need to charge more than 1x PT4056 Module joined in parallel?

2. If I joined say 5x PT4056 Modules together in Parallel, would I need a power supply of 5V with 5amps output?

Please advise what I need to do. I look forward to your help.

Kind Regards,


JerryBerry (author)lanikiwi2017-07-02

You need 1 AMP per tp4056.

Do the math. :)

lanikiwi made it! (author)2017-02-06

Please see diagram below:

If I had 1x 5V/5A Ph Charger or Power Supply connected to just 1x PT4056 Module, but had all 5x PT4056 Modules wired in Parallel,

Q.1. Would each PT4056 Module get 1A or 5A each?

Q.2. If say 3x PT4056 Modules fully charge the 18650 batteries, will the remaining 2x 18650 batteries get 2.5A each? (1/2 of the 5A ea)

Q.3. If say 4x 18650's are fully charged, will the remaining 1x 18650 battery get the full 5A?

Please help me to understand what happens. Thank you :)

02 5x Battery Setup.jpg
JerryBerry (author)lanikiwi2017-07-02

Q1. The amperage is what 'pushes' the voltage into the batteries. Each needs 1amp to get the job done. The tp4056 chips limit the amperage going in. Each gets 1amp.

Q2. makes no difference. the TP4056s handle that for you.

Q3. See Q2. Same Answer

JohnM1314 (author)2017-04-02

wont thw voltage of 4.2 destroy your 3.7 V battery?

msims13 (author)JohnM13142017-05-14

The whole "3.7V" label on these batterys is a bit deceiving as they actually do charge to 4.2 Volts ... dont ask me why this is the way it is, it just is what it is... :-)

Yonatan24 (author)msims132017-06-25

When fully charged, my 18650s can be even a bit more than 4.2V

msims13 (author)2017-05-14

Does this charger have protection against inserting the battery backwards? The single TP4056 charger lets the smoke out if you connect the battery backwards.

lanikiwi (author)2017-02-12

Ummm, are my questions too hard or am I doing something wrong? No one has replied to any of my questions. Please advise me if I'm doing something wrong on this forum.

Kind Regards.

victoryking (author)lanikiwi2017-02-12

These questions are hard to answer unless you have tried these configurations yourself, specially in case of batteries many things can go wrong.
One thing I can say for sure that tp4056 is safe to be used only with one battery.
parallel or series combinations, I have some clues but can never be certain unless I try them.

lanikiwi (author)victoryking2017-02-12

Hi Victoryking,
greetings from down under, New Zealand.

Thank you so much for your reply.
I have seen so many videos of almost every configuration; parallel and series etc etc and some people connecting 1x 5V power supply to many PT4056 connected in parallel etc. It's quite confusing and scary actually, of what could happen!
I've finally come to the conclusion after coming across a website last night, dealing with this whole subject, that yes, the PT4056 is safest (and as you stated) and meant for 1x battery only.
So I've gone and bought a bunch of 5V/1A Wall power supply units to connect to each PT4056 individually.
I feel confident and good about this whole area now. I should've just done that in the first place lol I was trying to find a way of getting out of buying a power source for every PT4056 lol
Thank you again for your reply....I really appreciated it.

Kind Regards,

lanikiwi made it! (author)2017-02-05

Hi Everyone,

sorry, I just drew this image in the hope it will explain my lack of knowledge in this whole area. I'm confident you guys can teach this 'newbee' what I need to know hehe

Thank you in advance :)

5x Battery Setup.jpg
lmoro3 (author)2016-07-08

Hello, Victor
Is it possible to set the charge voltage to LiFePo cells?
I have a 20Ah A123 pouch cell and I would like to charge it, but its recommended maximum charge voltage is 3.6V.
At 1A, it will take hours to charge, but that's not a problem to me.
Any thoughts?

victoryking (author)lmoro32016-07-24

Sorry for delayed response.
This circuits constant voltage charging can go up to 4.2V. This might be a problem.

hareeshgs (author)2016-05-19

Nice DIY.

I have a query, What are those Out+ and Out- terminals of the PCB?

victoryking (author)hareeshgs2016-05-19

you can directly connect your circuit, that is being powered by this battery. this facilitates in system charging.

maniacse (author)2016-05-17

I have a total n00b question: what are those three capacitors for? I always put electrolitic+ceramic one in front of regulator and one ceramic after regulator. Am I doing it wrong?

Also, I used this charging circuit for charging of PMR radios - one unit I put on drop-in charger, and one directly inside of PMR battery pack, so I can use standard phone wall (or any other) charger with micro USB to charge my radio wherever I go. Very useful circuit!

Epicuros (author)2016-05-16

I would like to build a Li-Ion charger, but I need a schematic to start with. The video is all very good, but, with all due respect, the strong accent of our friend has prevented me from understanding the instructions. How about a text?

victoryking (author)Epicuros2016-05-16

Text in instructable should be enough to build this device, for designing charging breakout board like TP4056, you can refer to

SoLongSidekick (author)2016-05-16

Really? Did you read his comment at all? "...if you search '18650 USB power pack' on eBay".

DangerousTim (author)2016-05-16

Why don't you power from 5v instead? It'll save energy! :) Also how to charge batteries in series?

GitarGr8 (author)2016-05-16

There's a couple subreddits that have good posts on powerbanks; both /r/Flashlight and /r/18650MasterRace discuss this all the time. To save you some trouble, here's a good comparison for powerbanks that accept a micro USB input.

RaymondR6 (author)2016-05-16

Very good reference and advice about buying the correct TP4056 version, as I have the "wrong" version at home. I also wish to point out that the two protection ICs (DW01A and FS8205A) are chips that exist inside many commercial cells for smartphones, cameras, and other devices. I have taken apart these cells and find a small plastic cap with a PCB (same protection chips mounted on it) and the raw li-ion cell electrodes wired to the board. Your project will work only on raw cells, not the commercial cells which do need the full 5V DCV (usually supplied bu a USB input) to pass through the ICs inside to charge the cell. And these commercial cells have three contacts, where the center is a thermal signal for warning the smart device when the cell has overheated.

richfiddler11 (author)2016-05-15

Good instructable. I hate to say it, but if you search '18650 USB power pack' on eBay you'll find a lot of gadgets that hold between 2 and 6 18650 batteries, which not only charge the batteries but function as a USB power bank as well. The cost is around $2-5 USD. I'm a big DIY fan, but sometimes I choose to buy (unless I can't find a feature or form factor I need).

pinheadBE (author)2016-05-15

Those little modules are always useful.

there's something I don't understand: if you use a 12VDC supply,
regulate that down to 5V with the 7805, and use the maximal charging
current of 1A, the 7805 will dissipate (12-5)V*1A = 7 Watts in heat.

resistance for a TO220 case, from chip to air, is about 50°C/W. So,
without a heat sink, the 7805 will heat up to 7*50 = 350°C in a matter
of seconds....

That is something the 7805 will never be able to
sustain without a HUGE heatsink. And even with that, I am not sure that
it will last long before it simply fries.

IMHO, those charging
modules should only be used directly with a mains isolated 5VDC wall
adapter. Using a discarded phone charger laying around is the cheapest
and easiest way to go.

I like the idea of using a hot blade to cut a plastic case. Never read of this before today. Just beware of the fumes: those are really nasty....

victoryking (author)pinheadBE2016-05-15

That is true, I had this in mind. I don't know how I missed to mention it. It's great that you brought this up.

LarryF29 (author)2016-05-14

Please don't misunderstand, could just be my side , great instructions, good job.

RtyQ (author)2016-05-12

Nice explanation of the charging circuit, I have used those a lot of times without knowing how they actually work xD.