Hello everyone, happy new year. In this post I’m going to show you how to make your own Universal Battery Charger Circuit from scratch by using which you can charge almost any electronic device or battery in your home.
At very first let me tell you why I had a need for Universal DC Charger. My motorcycle was not starting and it doesn’t have a kick start. That means it can be started only using self-start and for self-motor, the battery must be charged well. But my battery was down. My bike has a Exide XPTZ4 12 volt, 3Ah VRLA maintenance free dry cell battery which should be charged if it’s voltage (with no load) dropped below 12.4 Volts. I also have six Samsung ICR18650-22F batteries with pretty good conditions which I got from my laptop’s old battery pack and I needed to charge them and use them for a Universal Power Bank – I’ll talk about it in a different post, separately.
I’m a programmer and before starting the actual electronic stuffs, allow me to tell you a funny quote which I have seen somewhere on the internet.
“The second most dangerous thing in the world is a software guy with a soldering iron. The most dangerous thing in the world is a manager who thinks he can code.”
Disclaimer: I’m not responsible if any kind of damage happens to you or your electronics by reading and implementing the concepts and circuits described in this post.
Now, here we go.
Part 1: Typical 12 volt battery charger circuit found on the Internet
If you were searching for a automatic battery charger circuit on the Google, then I guess you’ve seen the circuit below in many websites. If you haven’t, then you may skip to Part 2 of this post as this circuit is not recommended for practical use and in Part 2, you’ll get a much better circuit.
and so on…
The above circuit will not work for you, you will get hardly 50mA output current which is useless as you are not going to charge wrist watch batteries.
This is a very old circuit and I found a discussion about it here which worth reading if you have tried/trying this circuit: https://www.electro-tech-online.com/threads/lm317-battery-charger.149746/
This circuit has a green charging LED which should glow only when load is present. And it has a red LED which should glow when battery gets fully charged.
BUT, in reality – the green LED is always on even there is no load attached with the circuit. And the red LED slowly glows up when battery voltage reaches to 13.3 volts, but we need 14.1 volt to fully charge a typical 12 volt battery. For a higher mAh battery, seeing the red LED glowing with full brightness is one of the luckiest thing in this world as charging rate is less than 50 mA. Along with, this circuit does not have decoupling capacitors with LM317T.
At the first time when I implemented this circuit I had not enough idea about LM317T, Zener Diode, Transistors, and voltage & current control, hence I failed badly. Then I studied about these from my previous diploma 3rd semester book Principles of Electronics By VK MEHTA, read datasheets, watching few YouTube videos and reading some articles, question-answers from various websites (you can check at the end of this post for the resources). Then I have analysed the circuit and modified it according to my need.
My modified version of this circuit: Fixed 12 volt battery charger
- 12-0-12 CT (center tapped), 1.5 Amp transformer (I used 12-6-0-6-12 CT, 3 Amp transformer – got it from my old 4440 audio amplifier) (TR1)
- 1N4007 Diode ×5 — D1, D2, D3, D7, D8
- 11 V, 1 watt zener diode ×1 — D6
- RED LED 2.0V 20mA ×1 — D3
- GREEN LED 2.0V 20mA ×1 — D4
- 470 μf, 25V capacitor ×1 — C1
- LM317T voltage regulator ×1 — U1
- BD139 NPN transistor ×1 — Q1
- 10k ohm POT Preset ×1 — RV1
- 1K ohm, 1/4 watt resistor ×2 — R1, R4
- 2.2K ohm, 1/4 watt resistor ×1 — R3
- 220 ohm, 1/2 watt resistor ×1 — R2
- 100 ohm, 1/2 watt resistor × 1 — R5
List of modifications I have made:
- Removed R1 from POT terminal to the ground. It is completely unnecessary in my opinion.
- Added a resistor of value 1K ohm between emitter of BD139 transistor and anode of red LED. During an experiment, the red LED was gone, hence a 1K ohm resistor needed i.e. R1.
- Removed R5 from positive output terminal and placed it in between cathode of diode D5 and cathode of zener diode D6. It was causing the low current issue.
- Added D7 between output and input pin, D8 between adjustment and output pin of LM317 for over protection.
In this modified version, R5 is not causing any low current issue. I’ve tested and getting 1.5 A current at max for regular loads. But for batteries, output current is still low. I think the reason is 11 volt zener diode. I’ll try with 14.1 volt zener diode in future and post the result here. A 12 volt battery always has voltage greater than 12 volts and this 12 volt is greater than the breakdown voltage of that 11 volt zener diode. That’s why it causing flow of current between base and emitter of BD139 transistor, hence collector and emitter is sorted – so output voltage of LM317T will be lowered and current will be less. After all – this circuit is OK to try out for the sake of curiosity but not recommended for any practical use.
Part 2: DIY Universal Battery Charger Circuit with Variable Auto Cut-off
After the previous automatic battery charger circuit, I was not satisfied. I have studied required things, gathered information, I get to know how these electronics components works practically. Then I ended up making this circuit below. All my efforts during past 1 week is not wasted – it was a great success in the end; and I cam make many things like this one. I’ll post my upcoming projects here, stay tuned.
What this circuit can do:
- Has variable voltage range i.e. it can charge 1.5 V to 25 V batteries
- Can charge at maximum 1.5 Amp
- Has variable auto cut off wide voltage range
- Can be used as regulated power supply.
What this circuit cannot do:
- LM317T is a linear voltage regulator, hence low efficiency
- LM317T cannot provide more than 1.5 Amp. You may use LM338 for 3Amp or some other alternative.
- There is no current control. I’ll add current control in next version.
Veroboard design using LochMaster 4.0: https://goo.gl/92FJqX
- 12-0 1.5 A transformer (I used 12-6-0-6-12 CT 3 A) ×1 — T1
- LM317T IC ×1 — U1
- BD139 ×1 — Q1
- BC547 ×1 — Q2
- 1N5408 ×5 — D1, D2, D3, D4, D10
- 1n4007 ×5 — D5, D6, D7, D8, D9
- 20 mA 3 mm GREEN LED ×1 — D11
- 20 mA 3 mm RED LED ×1 — D12
- 3300 µf, 25/35 v electrolytic capacitor ×1 — C1
- 220 nf capacitor ×2 (optional) — C2, C3
- 10 µF, 25/63 v ×2 (recommended) electrolytic capacitor — C4, C5
- 47 µF, 25/63 v ×1 (recommended) electrolytic capacitor — C6
- 4.7k ohm resistor ×2 — R3, R6
- 1k ohm ×2 — R4, R5
- 220 ohm ×1 — R1
- 100 ohm ×1 — R2
- 10k ohm preset TRIM POT (code 103) ×2 — RV1, RV2
- 1k ohm preset TRIM POT (code 102) ×2 — RV3
- 12V DC Relay ×1 — K1
- Push button switch with self-lock ×1 — S1
- Fuse 5×20 mm holder with 3 Amp fuse (optional) ×1 — F1
- DIP 1×2 female connector (optional) — P1
- Multimeter for checking voltage of course.
- You can use breadboard to test it. Use veroboard (11×29 would be enough) for final implementation., or you can make your own PCB.
- Alligator/Crocodile clip ×2 (optional)
- Heat sink for LM317T IC ×1
This DIY Universal Battery Charger Circuit has three different units:
- Rectifier unit (AC to DC)
- Voltage regulator unit
- Variable auto cut off unit
- Rectifier unit (AC to DC)
- How the rectifier unit does works can be understood by reading this article: https://w3epic.com/full-bridge-rectifier-and-choosing-diodes-and-capacitors-for-it/
- Voltage regulator unit
- In voltage regulator unit, C2 and C3 capacitors are optional, they are added as decoupling capacitors.
- C4 is recommended, particularly if the regulator is not in close proximity to the power-supply filter capacitors. A 0.1-µF or 1-µF ceramic or tantalum capacitor provides sufficient bypassing for most applications, especially when adjustment and output capacitors are used.
- C5 is recommended to improve ripple rejection. It prevents amplification of the ripple as the output voltage is adjusted higher. C5 helps to stabilize the voltage at the adjustment pin, which also helps reject noise.
- C6 improves transient response, but is not needed for stability
- Protection diode D1 is recommended if C6 is used. The diode provides a low-impedance discharge path to
prevent the capacitor from discharging into the output of the regulator. It also protects the regulator from when a battery is already connected transformer is off.
- Protection diode D2 is recommended if C5 is used. The diode provides a low-impedance discharge path to prevent the capacitor from discharging into the output of the regulator.
- You can find more information on LM317T datasheet.
- Voltage level can be adjusted using RV1 and RV3 Trim POT (preset).
- Variable auto cut off unit
- This unit is mainly based on two transistors in Darlington configuration (Q1, Q2), a relay (K1).
- This unit has a variable resistor RV2 by adjusting it you can set the threshold of auto cut off voltage.
- The Red LED indicates charging status and the Green LED indicates full charge status i.e. when the output voltage reached to auto cut off threshold.
- This unit has a push button switch which is used to turn on/off the relay K1.
Main logic behind:
- The rectifier unit converts 230 V AC to 21 V DC (if 15 V transformer is used)
- Then the output voltage is regulated and stabilized by the voltage regulator unit.
- After setting the output voltage, the cut off voltage threshold is set. In that point, connection is cut from the terminals where loads to be connected.
- Then we turn off the relay switch hence connection is again connected to those output terminals.
- Now we connect the load to the output terminals. Because of this, output voltage will be dropped which is less than the cut off voltage. At this time, if we turn on the relay switch – the connection will not be cut by the relay until the output voltage reaches to the cut off threshold again i.e. battery get fully charged.
How to operate the Universal Battery Charger Circuit?
- Step 1: Turn on the switch S1 and rotate the wiper of RV2 (preset) in clockwise direction till the end.
- Step 2: If you want to charge a 12 V battery, then set the charging voltage to 14.1 + 0.7 = 14.8 V (as diode D10 drops around 0.7 V approximately) by rotating wiper of RV1 (preset) in clockwise direction very slowly until the output voltage reaches to near 14.8 V. Adjust RV3 in same way to set the voltage to exactly 14.8 V (RV3 adds better precision).
- Step 3: After setting the output voltage, rotate wiper of RV2 in anti-clockwise direction very slowly until the Red LED goes off and the Green LED started glowing.
- Step 4: Now turn off the relay K1 using the push button S1 and and connect the output P1 to the battery terminals.
- Step 5: When the battery gets fully charged, the power supply will be automatically cut off from the fully charged battery.
Webpages I’ve read and bookmarked during this project:
- http://www.falstad.com/circuit/ (online circuit simulator)
Youtube videos I’ve seen:
Book I read:
- Principles of Electronics By VK MEHTA – I reopened this book after long time especially to read about zener diodes and transistors.
- LM317T Linear Voltage Regulator – http://www.ti.com/lit/ds/symlink/lm317.pdf
- BD139 Transistor – http://www.redrok.com/NPN_BD135_45V_1.5A_12.5W_Hfe40_TO-126.pdf
- BC547 Transistor – https://www.sparkfun.com/datasheets/Components/BC546.pdf
- POT Preset – http://www.dipmicro.com/?datasheet=RM065.pdf
- 12V DC Relay –
- 1N5408 Diode – https://www.diodes.com/assets/Datasheets/ds28007.pdf
- 1N4007 Diode – http://www.mouser.com/ds/2/149/1N4007-888322.pdf
If you have any query or suggestion, please comment below.