Li-ion Battery Charging




About: I love electronics and all about DIY.

Lithium based batteries are a versatile way of storing energy; they have one of the highest energy density and specific energy(360 to 900 kJ/kg) among rechargeable batteries.

The downside is that, unlike capacitors or other kinds of batteries, they can not be charged by a regular power supply. They need to be charged up to a specific voltage and with limited current, otherwise they turn into potential incendiary bombs.

And that's no joke, storing such a high amount of energy in a small and normally tight packaged device can be really dangerous.

But they're really useful in electronics due to their relatively high cell voltage; high energy density; their shape, size and capacity variety, and their charge/discharge efficiency. And that's why they're in almost every consumer electronics product.

As they are the best choice for small and medium sized portable devices, they're very popular among the DIY community. But charging is still a common problem to face when using them if you don't want to buy a specific charger.

Through this instructable you'll learn how to make a proper li-ion battery charger with widely available components and parts. And what's more important, you'll learn how does it work.

If you want to skip the theory, and actually build the charger, jump to step 6.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: A Bit of Theory

There are a lot of different types of lithium based batteries, but they're only different in the materials used and architecture. Scientists prefer to name batteries by their chemical name and the material used, and unless you are a chemist, these terms might get confusing. The table above offers clarity by listing these batteries by their full name, chemical definition, abbreviations and short form.

Different types of batteries have different characters and limitations, for more detail, i recomend you to visit this page.

The good thing is that most batteries are charged in the same way, at least the common ones you would usually find and/or use for a battery-powered project.

First of all, you need to know what's the "C-rate", because it's the basis of battery usage.

Most batteries are labaled with a nominal capacity, measured in amp-hour (Ah) or in milliamp-hour (mAh). That is basically the discharge current they can supply for an hour before being completely drained.

For example, you have a big battery labeled as 2400mAh or 2.4Ah, that means that it can push 2.4A trough your circuit, and discharge in an hour-long period of time. That would be a 1C discharge rate, discharging your battery at the rated capacity current.

If your battery supplies 1200mA to a circuit, it would be a 0.5C discharge rate, and it should last for two hours.

Some batteries allow higher discharge rates than 1C, and if you could discharge your battery at 4.8A (2C), it would last for 30 minutes. Some batteries used in RC systems allow very high discharge rates, as 10 or 20C, but this batteries are usually designed to fail rather than leave your plane unpowered in mid-flight, so they're not the safest ones.

When charging, it's basically the same, charging a 2400mAh battery at a maximum current of 1200mA would be a 0.5C charge rate. For safety reasons, most batteries should be charged at between 0.5C and 0.7C.

Most lithium-ion batteries are charged to 4.2v per cell, higher voltages could increase capacity, but reduce service life. And lower ones can increase battery charge cycles at the cost of less run time. (See the third graph)

A Charge cycle involves two main stages; constant current or CC and voltage source or CV, but some chargers skip or add more stages. (See graphs 1&2)

  • Most batteries are considered overdischarged or dead when their cell voltage is under 2.8-3v, but even in this situation, cells can be charged again and be reused. To save them, an "aconditioning" stage is done before charging, in this stage, the battery is charged with a 0.1C current limit until it reaches 3v

  • CC stage. This is the stage all the chargers use, and the only for most fast chargers. During the constant current stage, the battery is basically connected to a current-limited power supply, usually limited to 0.5-0.7 times the nominal battery capacity (that's from 0.5 to 0.7C) it lasts until the cell voltage reaches 4.2v. At the end of this stage, the battery charge is around 70-80%.

  • CV stage or saturation charge. When the battery reaches 4.2v per cell, the charger acts as a voltage limited power supply, The battery voltage remains at 4.2v while the charge current drops gradually. When the charge current is between 3 and 10% of the labeled capacity, the battery is considered fully charged.

  • Topping charge. Depending on the charger and the self-discharge of the battery, a topping charge may be implemented once every 500 hours or 20 days. Typically, the charge kicks in when the open terminal voltage drops to 4.05V/cell and turns off when it reaches 4.20V/cell again.

Usually, only stages 2 and 3 are used, and a full charge can take from 2 to 4 hours depending on the charge rate.

Li-ion does not need to be fully charged, as is the case with lead acid, nor is it desirable to do so. In fact, it is better not to fully charge, because high voltages stresses the battery. Choosing a lower voltage threshold, or eliminating the saturation charge altogether, prolongs battery life but this reduces the runtime. Since the consumer market promotes maximum runtime, these chargers go for maximum capacity rather than extended service life.

For more information you can visit this page.

Step 2: Designing the Charger Circuit

Around a year ago i began to work with operational amplifiers, and i decided to design a proper li-ion battery charger to learn to use them. I've learnt a lot about op-amps along the way designing this circuit and i wanted to share it, so people can make their own chargers instead of buying them.

The circuit uses the popular LM324 op-amp to create a current and voltage limited power supply. In this case, the current is adjustable with a potentiometer from about 160 to 1600mA, making it able to charge batteries with a wide range of capacities. The voltaje limit is 4.2v, so you don't damage your batteries.

It has a charge indicator LED that will lit up while the battery is charging and shut off when done.

I designed this circuit so it uses widely available and cheap through-hole components so anyone can build it.

Almost any general purpose op-amp can be used, no rail to rail operation needed, no high frequency or precision.

The tip122 transistors can be replaced with any pin-compatible transistor with a minimum DC current gain (Hfe) over 100 and a maximum collector current (Ic) over 2A.

The circuit is designed so anyone with basic soldering skills can easily build it.

Step 3: The Power Supply

The whole battery charger is powered by a 12v 2A charger, but since the LM324 is not a rail to rail op-amp, i need a second voltage rail to allow the op-amp sense voltages near GND (little voltages for little currents) and output low enough voltages to not turn on the darlington transistors when they shouldn't be.

If you look at the general schematic in the previous step, you can see that the transistor that controls the current flow and voltage across the battery is connected to a voltage rail and not to ground. That's because the LM324 output voltage cannot reach It's negative supply voltage, it can only go around 1.5-2v over it. At that voltage, the darlington transistor wouldn't be able to switch off and wouldn't limit voltage and current properly.

That's why i used one of the four op-amps (IC1a) and a transistor to create a virtual 2.5v rail over GND that sinks the current that flows through the charger part of the circuit.

R2 and R3 are a voltage divider with an output voltage of around 2.5v depending in the resistor tolerances, the op-amp drives the transistor in such a way that independently of the current flow, 2.5v will always drop across it.

The four op-amps and the LED indicators are powered directly from the 12v power supply, but the rest of the circuit is powered with 9.5v; between the 12v and the 2.5v rails.

If you use this design, but you want to make it more efficient, you can use rail to rail op-amps and a lower voltage power supply so you don't need to create an extra rail wasting power in an extra transistor.

The power LED indicates when the charger is on, and C2 smooths out the voltage from the charger.

Step 4: The Actual Charger

This is the important part of the charger, this is what takes care of limiting the current and voltage across the battery. In this case, the charge current can be selected with the 10k potentiometer, but the limit voltage will be a fixed 4.2v reference, regardless of the power supply voltage variations.

(You can see that in the general schematic, the potentiometer and R8 and R9 values are an order of magnitude higher, that's because the only pot i had was a 100K one, but the recommended value is 10K and for R8&9 the ones in the schematic above)

The op-amp in the left (IC1c) takes care of limiting the current to a maximum set with the potentiometer.Since the sense resistor is 1 ohm, the voltage across it will be the same as the current flowing through it.

The potentiometer ison top of a 1k resistor, across the resistor there's a 160mV drop, so the minimum output voltage of the potentiometer is 0.16v, in that case, the circuit would limit a maximum current of 160mA, ideal for charging a 300mAh battery.

The voltage drop across the potentiometer is around 1.6v So the maximum current limit will be slightly above 1.6A. Adjusting the potentiometer you can get any voltage output between 0.16 to 1.6v, meaning a maximum current limit anywhere between 160 and 1600mA.

The op-amp will drive the transistor in such a way that the voltage across the sense resistor is the same as the potentiometer output. And thanks to the 2.5v rail , the op-amp will be able to output a voltage low enough to almost switch off the transistor and set a low current limit.

At the end of the constant current stage, the battery voltage gets near a 4.2v limit, beyond which the battery would be damaged, at that moment, the voltage limitter part of the circuit kicks in and the constant voltage stage begins.

The 4.7v zener diode along with R10&11 voltage divider creates a 4.2v reference below VCC (~12v). When the voltage across the battery reaches 4.2v, the second op-amp (IC1d) starts to pump voltage into the inverting input of the first op-amp, this makes it to lower the output voltage to the transistor so current flowing trough the battery starts to drop to keep 4.2v across it.

As the battery gets charged and it's internal resistance increases, less current is needed to keep 4.2v across it, so current will drop slowly. When the current flowing through the battery gets below 3-10% of the nominal capacity, the battery is considered 100% charged.

Step 5: The Charge Indicator

Fully charging a battery can take from 2 to 4 hours depending of the charge rate (which i recommend to keep between 0.5 and 0.7C). When the current flowing into the battery is less than 3-10% of the nominal capacity, the battery is 100% charged, and the circuit above is what will tell us when this happens.

The fourth op-amp (IC1b) is used as a comparator; at the non-inverting input, it takes the voltage across the sense resistor (over the 2.5v rail) which will drop during the constant voltage or saturation charge stage and compares it to a fraction of the voltage set by the potentiometer.

R15&16 voltage divider outputs a 9% of the set voltage and feeds the reference into the inverting imput of the op-amp.

when the voltage across the sense resistor (which is the same as the current flowing through the battery) drops below the reference set by the divider, the voltage at in- is greater than the one at in+, so the op-amp output drops to GND and switches off the LED.

With this configuration, the LED is on while charging, and off when the battery is fully charged. If you want it to turn on when charge is finished, just swap the op-amp input pins.

Step 6: Build the Charger

Now we're done with theory, let's actually build the charger!

First of all, you need the PCB, you can order it online or DIY. When you have your PCB ready with all the holes and the tinned pads, it's time to start populating the board.

With the design i made, all the components are through-hole, so anyone can make it, but if you prefer a smaller version of the board, you can download the .brd file and edit all the components to SMD.

Most of the resistors i used are 1% tolerance, that's because i had them on hand, you can use the common 5% ones.

Solder the resistors and the wire jumpers, then the capacitors and the diodes, be careful with the polarity!

If you haven't got a potentiometer with the same package as mine, you could solder a external one with some wires, or just edit the footprint.

The sense resistor i used is a 4W 1ohm resistor, you can use a different one, but not under 3W.

The transistors are two TIP122 darlington pairs, it's not necessary to use darlington ones, any BJT with a gain over 100 and with 2A current capability should work, but check the base resistors to match your transistors!

Also, you can use almost any other quad op-amp, be sure to choose a pin-compatible one.

I made the board with two outputs, one with a screw terminal and other with a DSI battery connector, they're connected in parallel, but you should charge just one battery at a time. Remember that this charger is designed to charge a single cell battery, not two in parallel nor two in series.

When you've finished soldering, screw a heat sink to your transistors, they're going to dissipate a fair amount of power! The one i'm using is rather small, maybe a bigger one should be used, but i think that it doesnt get over 70ºC so that's fine for now.

Now add a little stanoffs to your board and it's ready to work.

Step 7: Test #1

As a first test, i'm goung to charge a 600mAh battery, i'm goung to charge it at 0.5C to be safe.

First of all, connect your multimeter to the output and set the dial to current in the 10A range. Plug the charger and turn the potentiometer until the output current is half the nominal capacity of the battery, in my case, 0.3A.

Then, connect the battery to the charger, and be careful with the polarity, in my circuit design, the positive pin is on the right of the connectors.

I tested the 4.2v reference below VCC, and as you can se in the pictures, it's a perfect 4.2v reference.

When i began to charge the battery, it had an open circuit voltage of 3.1v, so pretty empty. About an hour and a half later, the battery had a voltage of 4.09v, it was about to enter in the constant voltage stage.

An hour and a half later, i saw the LED was dimming out, so i checked the current via the voltage drop across the sense resistor, the current was about 24mA, which is less than 9% of the initial 300mA. At that point the battery was completely charged.

This charger works great, i've tested it with that 600mAh battery, a 840mAh DSI battery, a little 200mAh watch battery and a 4000mAh tablet battery. They all took around 3 hours to fully charge, the 4Ah one took a bit longer, but just because the charger is limited to 1.6A, and that's a 0.4C charge rate.

I hope this instructable is useful for all the makers out there beginning to use li-ion batteries, good luch with all your projects!

If you didn't understand something or you need more detailed information, feel free to ask me, i will answer everything i can.

If you find this instructable useful, please vote it for the Epilog Challenge, Green Design and Battery-Powered contests.

Battery Powered Contest

Participated in the
Battery Powered Contest

Epilog Challenge VI

Participated in the
Epilog Challenge VI

Green Design Contest

Participated in the
Green Design Contest

2 People Made This Project!


  • Made with Math Contest

    Made with Math Contest
  • Multi-Discipline Contest

    Multi-Discipline Contest
  • Robotics Contest

    Robotics Contest

119 Discussions


2 days ago

Hi could you please share the source code link.


5 months ago

Really good tutorial ! Pleased to have you on Instructables.


Question 12 months ago on Step 1

Can I replace Z1 and R10 and R11 to achieve a higher charging voltage ?


Question 1 year ago on Step 7

Hi, I want to use a GSM modem that works on 3.7 volt li battery and has inbuilt 3.7V li-ion battery charger. Though ampere hour capacity not mentioned, the seller states that it's 1100mAh battery. But if I decide to use a 3.7v ,5600 mAh battery then will the charger work properly and safely ? I don't worry about charging time. I want the system to be work longer on battery. Kindly guide.

luiz gusmao

Question 1 year ago on Step 7

Liked very much your ingenious circuit, and intend to adapt it for charging a single cell 5000mAh lithium-ion battery with a 3 to 4 Amp current. Do you think I can get this by simply using a MOS FET (instead of BJT TIP122) and adjusting the value of R5?


Question 1 year ago on Introduction


I have a question regarding the maximum safe charging current ~(A) for a lithium bicycle battery.

Here is what I know about the battery:

Lithium-ion, fully loaded at 8.8Ah

36V (max is 41.6V) (I assume each cell is 3.6V but I do not know)

It says on the battery to charge at maximum 2.35A. (output max is 18A) The pluggin charges says it uses 2A and this takes about 3.5 hours to charge.

BUT, I need a faster charging time. Why? because I am entering a solar bicycle trip where we are not allowed to use the pluggin charger. This creates a problem: no matter what size solar panel I install, the battery can never have more than 2.35A input (around 3 hours). I have an adjustable limiter for the current but I need more input amps since I will deplete the battery in less than 3 hours going uphill.

Now, according to your article a battery can be charged at around 0.5C which in this case is 4,4A (the battery is a 8.8Ah). Is this correct? Can I safely set the maximum charging current to 4.4A even though it says 2.35A, probably as a safety feature.

Eagerly awaiting your reply so as to buy an appropriate solar panel.



1 year ago

Great Article. The circuit design is beautiful. Thanks a lot!


1 year ago

Great 'ible with good info! Working on building a new charging system/battery packs for an ancient electric car, and very new to batteries in general, so I was glad to find this!


Question 1 year ago on Step 6

Can we use this circuit for 12v battery


Question 1 year ago

how much time does it take to charge a 12v 1.3 AH/20Hr Li Ion battery which is at 11.32V?


Question 1 year ago

Hello dear,

How much current is required to charge a li-ion rechargeable battery 3300mAh 7.4 volt ? I need to charge a Tronsmart Mega speaker which is not used for one month and think the battery is already discharged.


Question 1 year ago

My lithium ion batteries which i got from my old laptop, is working fine. the main problem is whenever i connect it with 12 volt , 1 amp solar charger, it is charging with 500mA even if solar panel producing 1 Amps.
Battery already passed 100 charge-discharge cycle.
basically, lithium-ion battery is not able to charge with 1 amps. what could be the problem?


1 year ago

Good information. I have a question about a smaller system. I have a 5volt input board going to a 5v relay going to a 5v to 12v booster. How would I connect the lithium batteries in the charger system? Connect (4) 1.5v batteries in series ? Will a 6volt solar panel charge this ?


2 years ago

I need a charger to charge 3 in series.


2 years ago

hey I want to make lithium ion charger for two 3.7 volt battery connected in series so what are the necessary changes I need to do in your design ?

1 reply

2 years ago

I would also like to see a parts list for this circuit. Also, I have tried to locate, without success, the schematic symbols labeled X1 and B-1,B-2 and J1,J2 and J3. This is an excellent tutorial, if a little above my current abilities. I am building a solar charging circuit to charge a 3.7V 10000mAh Lithium Ion battery. Any comments would be appreciated.

Thanks so much


2 years ago

Is there a specs for minimum charging current for a rechargeable Li-ion battery?

i.e: if i use a 3.6Ah Li-ion rechargeable battery and wish to charge it with only 5mA, will the battery charge( neglecting the time duration for charging the battery).

If Yes, how much lesser can the charging current be?

If No, how can one know how much is the minimum charging current for any Li-ion battery.


2 years ago

I am building a lightsaber based on the teensy 3.6 board and I am researching the feasibility of putting the charging circuitry inside the lightsaber hilt so I can use a power supply instead of an external li-ion charger. The issue I have is that I am using a 2s2p 18650 or 4 cell pack. 8.4v max 12A(6sx2) max current 3400Mah batteries. I currently have a PCB protection circuit on it That is rated as 7.4v 11A
I am a noob and learning as I go. With all that said I have a couple questions.
What kind of modifications would I need to make to change your design to work with 2s2pconfiguration?
Would the charger be too hot to have in next to the batteries?
Is it possible to combine the PCB protection and balance circuit together with the charging circuit? Would that be a good idea?
Can I use a commercial power supply brick like a 9v or a 12v or do I need to use a special designed one like the one you have?
Thoughts?, comments? questions? Any help is appreciated above and beyond your instructable here that is more educational than any other article I have seen so far on the topic.