Switching charger is smaller and lighter alternative to conventional transformer chargers.
It also allows precise adjustment of the target charging voltage. According to its setting it can charge batteries of different types and in various modes.
I described charger for the battery with a rated voltage of 12V, but it can be modified to for example 6V or 24V.
Circuit description: This charger works on the principle of switching supply. It is involved in a similar way as ordinary flyback switching power supply with integrated circuit UC3842 and TL431. The only difference is that the auxiliary power for IO1 is not obtained from the auxiliary winding, but knocked down from the network using power resistor R1. The advantage of such involvement is that the source is reliable in the current mode (does not cycle) and there's no need to use an auxiliary winding. The voltage is stabilized by circuit IO2. Feedback is introduced via optocoupler. Target voltage can be adjusted by trimmer or pot P1 (can be set in the range of about 12 - 16V). Adjust with the voltmeter connected to the output without battery connected. Voltmeter can also be built into the charger. The current is regulated indirectly by the shunt R2 on the primary side. This simpler version is sufficient, because the current setting is not as critical as voltage setting. With values in the diagram the charging current is of about 3.5 A. Charging current can be changed by changing R2 (lower resistance - higher current and vice versa). Beware of stupid current increasing - the whole circuit must be rated to the desired current. Charger on the schematic below is designed for batteries with a rated voltage of 12V. You may modify it to 6V or 24V by transformer transfer change and some components on the secondary side including a voltage divider. For the construction of the charger, I used a wreck of an old switched power supply 15V / 4.5 A. You can of course build on your own PCB. I used the original transformer. The conversion ratio is about 4:1 (fot 500V MOSFET). The charger can use any flyback transformer from SMPS of about 12 - 20V rated for enough current. The 600V MOSFET allows to use the conversion ratio up to 10:1. Care should be taken that the voltage across T1 does not exceed its rating (recommended not to exceed 80% of allowed absolute maximum values). Voltage on Tr1 primary (ratio x output voltage) is added to the input voltage of about 325V. Example: With the transformation ratio 4:1 and 16V output voltage, the T1 sees approx 4 x 16V + 325V = 389V. The transformer Tr1 must have proper winding orientation, denoted by dots (non-compliance would be destructive). The working frequency is about 40kHz. LED1 indicates a transition to the voltage source mode. Transistor T1 is any fast MOSFET with UDS 500-600V and resistance RDSon to about 800mR, eg IRF840 or STP9NK50Z. The diode D1 is any ultrafast diode with reverse voltage at least 200V, current 10A and recovery under 50ns, eg C10P20F (200V, 10A, 35ns). T1 and D1 must be placed on the heatsink. Maximum power input of this charger is 65W. The charging time depends on battery capacity, efficiency of charging process and the initial state of charge. Example: empty battery with 35Ah capacity would theoretically charge 35Ah : 3.5 A = 10h. In practice it may be 15h, because the charging process does not have 100% efficiency, but approximately 2/3, and therefore the time multiplied about 1.5 times. The charger can be used for batteries with capacity of about 7 to 120Ah. Connect the charger to the battery first and then to the mains. Disconnected from the mains first, then from the battery.
Charging conventional (car) batteries: When charging conventional (automotive) flooded lead-acid batteries using relatively small currents compated to its capacity, we do not have to worry about overcharging. If you will be charging up to the gassing phase ("bubbling"), the loss of distilled water is not destructive, because you can refill the water into this type of battery. If we want to charge with no significant gassing and water loss, set the voltage approx 14.4 V. The charger can be set to lower voltage (about 13.6 V) and used to preserve battery (maintenance mode). Deeply discharged battery can be resurrected by appliying increased voltage of 16V (disconnect the battery from the vehicle in this mode!). During normal charging is not necessary in most cases to disconnect the battery.
Charging VRLA batteries and gel batteries: If you charge VRLA batteries (valve-regulated lead-acid) Pb batteries, similar gel batteries (cells) or AGM (Absorbed glass mat) batteries, pay more attention to the charging voltage. In these types of batteries are usually given two charging voltages: 1) standby use whichever is lower. At a charging voltage of the battery such as UPS. This voltage can be connected permanently. This keeps battery always charged. This voltage is in the range of 13.5 to 13.8V for the example battery below. 2) For cycle use, which is higher. The battery is being charged to this voltage when it is used cyclically (charge-discharge). The battery should not be permanently connected to the charger set to this foltage. Fot the battery of our the example, this voltage is 14.4 - 15V. Is it necessary to disconnect the battery afted charging in this mode. It is also necessary to take care not to exceeded the maximum current. Those values are usually written on the battery or in its documentation. These batteries should not be overcharged.