# Battery in parallel with supply

I´m working on a project to charge a 24VDC lead-acid battery.

As you see, is not the best way to charge a battery. But it has to be like this (if you have any advices to improve the circuit using this type of charging it would be nice!).

The relay switch is controlled by a circuit that measure the voltage of the battery.

R3 resistance is there because prevents the PIC of powering up via this input.

The problem I´m having is that when I measure signal while charging is a sine mounted in the actual continuous value of the battery. Because of this, when I´m reading it with the ADC, it has shifts and spikes, and triggers comparison between setpoints that are not really reached.

What can I do to improve this measurement and get rid of this sinusoidal component of the reading? Maybe changing the capacitor for a 10 μF one? So forms a low pass filter with a cut-off frequency lower than the frequency of the sinusoidal component?

Edit: The sinusoidal of electrical network is 50Hz, so the output of the bridge rectifier 100Hz. I didn´t measure the magnitude of the sinusoidal component.

• Can you edit the question to include the frequency and magnitude of the sinusoidal component of the reading? While I did attempt an answer, have just deleted the answer when it was pointed out in a comment that I hadn't understood the circuit. Dec 16, 2023 at 23:28
• I´m sorry, I don´t understand what do you mean with edit the question, what question? Dec 16, 2023 at 23:34
• I´m sorry the ignorance. Like that? Dec 16, 2023 at 23:48

There are several problems with your circuit.

1. Lead-acid charge voltage should be 2.20 - 2.45 V per cell. You have 12 cells to make a nominal 24 V battery so that's 26.4 - 29.4 V and your 34 VDC supply is much too high. When the voltage goes above the cell voltage a large current will be drawn and, in your circuit, this is only limited by the transformer. You may result in over-heating the transformer and damaging the battery.
2. A resistor divider will divide the voltage linearly. If 32.4 V is divided down to 4.5 V (as shown in your second schematic) then that's a ratio of 4.5/32.4 = 13.9, therefore 19.2 V will be divided down to 1.38 V (and not 1 V as shown).
3. Your software will have to have some hysteresis otherwise when you disconnect the relay the voltage will fall and the charging will start again.

There are many, many 12 V battery charger designs available on the Internet. I suggest you study these and see if you can modify one for 24 V operation.

• Thanks for your time. 1) I know that the supply voltage is pretty high, but here the factories want that voltage. Don´t ask me why. 2) Yes, it´s 4.5V and 1.38V, I put it that way as a reference only. Thanks for your correction. 3) It has hysteresis, in fact, I have a problem and is when the user disconnect the battery, because when this happens, the voltage measured is the rectified output of the transformer. So it´s complicated to show this as "battery disconnected", because in the readings of de ADC, it shows as a high voltage. Dec 16, 2023 at 23:25
• "... but here the factories want that voltage." Trying to work outside the laws of physics is not going to end well. 4. What country are you in? 5. Why are you designing a (bad) battery charger for an industrial application when there are proper commercial chargers available that won't destroy the batteries or start a fire? Dec 16, 2023 at 23:46
• The batteries that we use, needs to get to a "equalize charge" sometimes. In this case, that equalize voltage is 32.4V ( given by the manufacturer ). So the voltage is slighty above considering losses. I´m sorry I didn´t clarify this before. Dec 16, 2023 at 23:53
• Can you post a link to the battery datasheet? Many of us would be interested in reading by it. Dec 17, 2023 at 0:02
• assets.ctfassets.net/nh2mdhlonj7m/2TDfK5BpCMa3ARA8pBDVmq/… Dec 17, 2023 at 0:06

Actually, it is worse than sinusoidal, the waveform in this signal is not only full of harmonics, but it also depends on the battery state of charge and aging.

Of course, you can average the signal with bigger capacitor, you could also leave it as is and average it in software. As I see things, when using such a rough charging method, you need to use the peak an not the average voltage for end-of-charge condition.

In regard to improving the charging circuit: a lot to be done, in fact. Assuming "it has to be like this" means a grid frequency transformer and on/off regulation:

• a means to limit the charging current. A resistor, at least. Will your device survive 253V input voltage (pretty much allowed in most 220/230/240V grids) - and - a fully depleted battery?
• the relay switch will be happier on the AC side and your circuit will be more efficient if the switch is at 220V side.
• I tried to use the peak voltage for measuring, but this led me to a lot of inconsistency, let´s say that I put the setpoint for stopping the charge at 30V. But when I tried with differents transformers, sometimes stopped at 29.2V, sometimes at 30.6V. About the resistance for limit the charging current, the battery used has 200Ah, so I think it would be pretty costly Dec 16, 2023 at 23:31
• I forgot to answer about the relay. Yes, the relay is on the AC side of the circuit. It was my mistake while showing the circuit. ( I don´t know where to edit and post the correct circuit. ) Dec 16, 2023 at 23:37
• your transformer may be able to limit the inrush current, but you absolutely do need both a current limit and a voltage limit for the equalizing mode, otherwise you force the battery into a thermal runaway. A thermal emergencu cutoff is also highly advisable if you want unattended equalizing. Dec 17, 2023 at 5:54
• p.s. when you measure the average voltage, but detect the peak voltage for the cut-off, inconsistencies between them are to be expected. As i said, the waveform depends on a lot of factors. Dec 17, 2023 at 6:03