12V 5A Lead Acid Battery Charger with Charging Indicator - Page 1
Forum section: electronics / projects

author: fatalelieberi
author_rank: Contributor
timestamp: September 18, 2020, 11:38:57 am
content: Hi,I want to share about my project I'm building. It's almost finished but I think by sharing I can get better idea or tips from you guys.Just as how the title says, I'm building a lead acid battery charger with 12V 5A output. It includes 3 LEDs, a yellow for indicating it's on, a red one for indicating it's charging, and a green one for indicating it's full charged. The voltage regulator uses LM338T and for the indicators I use LM358 and LM393. The voltage regulator isn't complex but the most interesting part is the indicator.From researching online, I find that when charging, the current curve will start flat at the maximum current of the charger (constant current mode) and then slowly ramps down (constant voltage mode). Based on this behavior, I design a crude indicator that when it reaches a certain threshold level, it will indicate the battery is full, else it will indicate that it's charging. Also, I don't want the full charge LED to turn on when it's not connected to a battery, so I need to give another threshold of minimum current when it should turn on. Below this level, no LED turns on, except for the standby LED (yellow one). I decide to put 200mA as fully charged threshold and 50mA as the minimum current.For the technical concept, I use LM358 to sense the current from two 0.1 ohm resistors in parallel. It is set in difference amplifier configuration with a voltage gain of 40V/V, combined with the current, it achieves 2V/A current-voltage gain. I don't make any offset cancelling feature since my aim is to have a simple and cheap design.The output of the LM358 is fed into LM393 comparator. It uses the input to turn on the red LED when the current is above 250mA and turn it off when it is under 200mA (hysteresis is used). For green LED, it is turned on when the current is between 100mA and 250mA when ramping up, and between 200mA and 50mA when ramping down (combination of window comparator and hysteresis). The circuit can be seen below.After designing, making the prototype is another challenge that I will continue in the next post.

author: fatalelieberi
author_rank: Contributor
timestamp: September 18, 2020, 12:05:22 pm
content: When testing it on a perfboard, the circuit performs as expected. Since it performs well, I make a custom PCB for it. Here is the design.However, to my surprise it does not perform as good as the perfboard version. When the current ramps down, at certain level about 50mA, the circuit begins to oscillate as you can see at the waveform of the output of LM358 below and getting worse as it goes down.This oscillation causes the full charge LED cannot be turned off at lower threshold. Fortunately, when probing the circuit at the inverting input of LM393, I notice that sometimes the LED works as intended. So, out of curiosity, I put a 150pF capacitor between the inverting input of LM393 and ground. It's between R17 and R19 in the schematic. As a result, there's no more oscillation. Then, I experiment with lower cap value and find that 10pF is enough to prevent any oscillation.This makes me wonder: what is causing the problem? Is there something wrong with my PCB design? If you guys can give any input, it is much appreciated.