12V Battery Charger-cum-Variable Power Supply

Fayaz Hassan


The 12v battery charger-cum-variable power supply circuit presented here can charge a 12V lead-acidefy tested58 battery of 50Ah to 80Ah (even up to 100Ah) capacity and can even be used as up to 18V DC variable power supply of maximum 5A capacity, which is useful for a test bench. The circuit can automatically detect the presence of a battery connection and start charging. At that time, it disconnects the output provided as variable power supply. It also detects the wrong/reverse polarity connection of the battery terminals and raises an alarm. The charger initially charges the battery at a higher voltage (about 14.2V), and once it is fully charged, it maintains the battery charge at a constant voltage (about 13.4V).

Battery charger-cum-variable power supply circuit

battery charger-cum-variable power supply
Fig. 1: Circuit of the 12V battery charger-cum-variable power supply

Circuit of the 12V battery charger-cum-variable power supply is shown in Fig. 1. It is built around two LM138 variable voltage regulators (IC1 and IC2), dual op-amp LM358 (IC3), 12V voltage regulator 7812 (IC4), two relays (with normal 12V, 1C/O PCB-mounted and 12V, 1C/O, 10A contact-current rating) and a couple of transistors.

LM138 is a 3-pin, 5A positive-voltage regulator available in TO-220 or TO-3 package. But continuous current flow of 5A generates a high temperature, which shuts down output of LM138 automatically due to its internal thermal protection.

fig 358
Fig. 3: Component layout of the PCB
fig 258
Fig. 2: PCB pattern of the battery charger-cum-variable power supply

This circuit simplifies higher current handling of LM138 by using IC1 and IC2 in parallel, but still output voltage can be regulated by a single variable resistance. Care should be taken for handling the lines carrying 5A current. Two separate relays (RL1 and RL2) are used to reduce the cost of the project.

Circuit operation

Transformer X1 steps down 230V AC to 15V-0-15V AC that is then rectified by diodes D1 and D2 and smoothened by capacitor C1. This voltage, which is around 20V DC, is fed to IC1 and IC2 that are wired in parallel. Their output voltage is regulated either by VR1 (in case of variable power supply) or VR2 (in case of battery charger), which is selected by relay RL2. Output so obtained is available for the variable power supply or battery charger through RL1.
Dual op-amp LM358 (IC3) is used to control the relays and select the type of output, that parts list58is, whether for battery charger or variable power supply. When no battery is connected for charging, no power is given to IC3. RL1 and RL2 are in non-energised state, and potmeter VR1 can be used to get variable voltage output across CON3 fitted on the cabinet.

When a 12V battery under charging (BUC#) is connected properly to terminal CON4 for charging, IC3 gets power supply from the battery through diode D10. If battery voltage is below ‘dead’ voltage (say, 6-9V and at least above 6V), pin 7 of IC3 pulls low and LED6 glows. If the battery is healthy (say, more than 9V), pin 7 of IC3 goes high and switches on LED2 and conducts transistor T2, and RL1 and RL2 energise.

Output voltages of IC1 and IC2 are regulated by VR2 and are available for charging at CON4. Once the battery under charging attains its full charging voltage, pin 1 of IC3 goes high, as indicated by the glowing of LED4, and T1 conducts, which reduces the voltage at pin 1 of IC1 and IC2.

When a 12V battery is connected in reverse polarity, D11 conducts, which, in turn, switches on the piezo buzzer and LED5 glows. This protection is important while charging batteries externally.


  1. Thanks Mr. Fayyaz Hassan. Great work that you have brought through this article. May we discuss further if you are interested to be a part of our upcoming project as virtual guide for technical assistance. Please revert back to Mob. No. 9767720880 or report to [email protected].

  2. Thank You So much for the circuit.
    But I can’t find a position for relay Rl2 on pcb. Its not listed in pcb diagram. Kindly guide through it.

  3. During initial setup of circuit, should the battery be disconnected or connected when setting charge, dead, float voltages etc?

  4. Hello
    I need an 18v auto charger
    If you send an orbit, I will be very grateful
    Is this 12 volt circuit up to a 18 volt charger? Which part should be replaced?
    How should i make it
    Thank you
    I am waiting for your mail

  5. the same as the question asked by our friend Mr. Usama Naveed. During initial setup of circuit, should the battery be disconnected or connected when setting charge, dead, float voltages etc?

  6. Do the transformers available in local market rated 5 Ampere output the full 5 A current or only half the current ?
    As it’s said that no electrical or electronic device can deliver full 100 percent power, so I want to know whether any transformer available has 100 % efficiency or only 50 % ?

  7. Several modifications must be made to the board, capacitor 1 of 4700uf is very close to lm138 ic1 which makes it difficult to install a chlor heatsink in that area, the same happens with lm138 ic2 it has components around it that do not allow installation of heatsink, I am currently assembling the circuit in proteus for its simulation and the creation of the pcb with its corrections.

  8. You need not use big heat-sinks. You can easily install heat-sinks of suitable size for both the ICs in vertical positions. If you want to use your own PCB layout designs, you can give more rooms as per your requirements.


Please enter your comment!
Please enter your name here