How can I read the battery voltage in this situation

Thread Starter

ariondoneda

Joined Apr 8, 2022
8
Hi,

I`m having trouble figuring it out how to "read" the battery voltage in a particular situation in the circuit shown below.

1654171453677.png

The problem is, when a disconnect the battery the 27V in DC_In appears in V_Bat and I have a false positive, like, my system thinks that there is a battery plugged in, with 27V, but it`s not true, is`s just the DC_In appearing in V_Bat.

How can I isolate the battery voltage and the DC_In voltage? I need to recharge and discharge the battery, so that is why there is this 3 diodes.

Thanks!
 

BobaMosfet

Joined Jul 1, 2009
2,110
Hi,

I`m having trouble figuring it out how to "read" the battery voltage in a particular situation in the circuit shown below.

View attachment 268586

The problem is, when a disconnect the battery the 27V in DC_In appears in V_Bat and I have a false positive, like, my system thinks that there is a battery plugged in, with 27V, but it`s not true, is`s just the DC_In appearing in V_Bat.

How can I isolate the battery voltage and the DC_In voltage? I need to recharge and discharge the battery, so that is why there is this 3 diodes.

Thanks!
Young Jedi.... electricity follows the laws of fluid dynamics (to some extent conceptually). A greater electricity overcomes and pushes a weaker electricity in the opposite direction. Thus, you require 1 and only 1 diode to prevent the 27V from pushing back against the 24V. The 24V can never overcome the 27V so it does not require a diode to prevent it from pushing against the 27V.

In this way, if the 27V is removed the 24V instantaneously supplies voltage and current to the regulator. Your 24V is isolated from the 27V, so you use an optocoupler, like an 4N35 to test your battery voltage.
 

MisterBill2

Joined Jan 23, 2018
18,167
We have much less than enough information to provide a solution, and so every suggestion is a guess. And my guess is that you do not have access to the battery directly, and at the same time you are unable to switch off the 27 volt source.
The very simple procedure will be to connect the voltmeter between the point tagged "V_Bat" and the battery negative marked as ground. Then switch off, or disconnect the 27 volt source. With the circuit as shown and the "DC_IN "at 27 volts there is no place to check the battery voltage.
So we need more information.
 

Ian0

Joined Aug 7, 2020
9,667
If you remove D18, then you remove the current limit from the battery charger. When the battery is depleted the and the 27V supply is connected the 27V power supply will be overloaded.
I presume that the battery in question is lead acid. If so, you can detect its absence by detecting the lack of current through R32
 

Thread Starter

ariondoneda

Joined Apr 8, 2022
8
Young Jedi.... electricity follows the laws of fluid dynamics (to some extent conceptually). A greater electricity overcomes and pushes a weaker electricity in the opposite direction. Thus, you require 1 and only 1 diode to prevent the 27V from pushing back against the 24V. The 24V can never overcome the 27V so it does not require a diode to prevent it from pushing against the 27V.

In this way, if the 27V is removed the 24V instantaneously supplies voltage and current to the regulator. Your 24V is isolated from the 27V, so you use an optocoupler, like an 4N35 to test your battery voltage.
Well, the battery is "24V" but it's charged to DC_In voltage level, so it's actually 27V when it's fully charged. So D17 is there to charge, D18 to discharge and D16 to prevent the battery from supplying power to the things before DC_In, when it does not exist anymore, 0V.
 

Thread Starter

ariondoneda

Joined Apr 8, 2022
8
We have much less than enough information to provide a solution, and so every suggestion is a guess. And my guess is that you do not have access to the battery directly, and at the same time you are unable to switch off the 27 volt source.
The very simple procedure will be to connect the voltmeter between the point tagged "V_Bat" and the battery negative marked as ground. Then switch off, or disconnect the 27 volt source. With the circuit as shown and the "DC_IN "at 27 volts there is no place to check the battery voltage.
So we need more information.
The 27V comes from a Fly-Back SMPS, with AC power input. When there is no AC DC_In=0V, in that moment the battery needs to handle the load. The battery is Lead-Acid. When fully charged it will be ~27V.
I have access to the battery, but I need to check it's voltage remotely, so I need to "read" it's voltage electronically, and with or without DC_In, 0V or 27V. I can not measure it with a voltmeter.
I don't need to know the exact voltage, just know if it's below 21V and if it's connected.

I hope that this is enough.
 

Thread Starter

ariondoneda

Joined Apr 8, 2022
8
If you remove D18, then you remove the current limit from the battery charger. When the battery is depleted the and the 27V supply is connected the 27V power supply will be overloaded.
I presume that the battery in question is lead acid. If so, you can detect its absence by detecting the lack of current through R32
I thing that the problem is that when the battery is fully charged there will not be any current passing trough R32. So I will get a reading saying that there is no battery, when there is.
 

Ian0

Joined Aug 7, 2020
9,667
I thing that the problem is that when the battery is fully charged there will not be any current passing trough R32. So I will get a reading saying that there is no battery, when there is.
Not with a lead-acid battery - there will always be a float-charge current.
 

crutschow

Joined Mar 14, 2008
34,281
Below is the LTspice simulation of Ian0's circuit using some typical part models (with a reduction in the value of R2 to increase the circuit sensitivity slightly:
It gives a charging output indication (red trace) for any charging current (yellow trace) above about 10mA, which should be sufficient to indicate a battery is connected.

1654188965432.png
 

Thread Starter

ariondoneda

Joined Apr 8, 2022
8
Below is the LTspice simulation of Ian0's circuit using some typical part models (with a reduction in the value of R2 to increase the circuit sensitivity slightly:
It gives a charging output indication (red trace) for any charging current (yellow trace) above about 10mA, which should be sufficient to indicate a battery is connected.

View attachment 268601
Great, but I need to check if the battery is plugged or not, basically. So with this I get a "Not Charging" status even if the battery is connected.
 

Thread Starter

ariondoneda

Joined Apr 8, 2022
8
Providing the current rating is adequate a switched jack such as this could be used (perhaps via a transistor) to connect/disconnect the 27V when the plug is inserted.
Interesting. I fear that even if I use this I would have a problem, because If the connector is plugged but without a battery we would have a false positive.
 

MisterBill2

Joined Jan 23, 2018
18,167
OK, understanding the detailed requirements better now.
If more analog inputs are available then there is a scheme to verify the state of the battery and it's presence. That is to read the voltage on each side of the resistor R2, (51 ohms). If the resolution of the reading is adequate you can deduce if the battery is charging or not, and if the supply voltage is also monitored then it is fairly simple to verify that the battery is connected .
A lead/acid battery in a float charge arrangement has a small charging current, and so it is simple to verify that the voltage drop across the resistor reflects that current. That can be found by subtracting the two voltage readings. It will make the math more convenient if R2 is increased to 100 ohms.
Comparing the supply voltage with the between the diode and R2 will indicate if the battery is connected or not, because if not connected then the voltages should be the same, or very close.
So there is the scheme for knowing the status of the battery, needing only one more analog input and some added software.
 

BobaMosfet

Joined Jul 1, 2009
2,110
The 27V comes from a Fly-Back SMPS, with AC power input. When there is no AC DC_In=0V, in that moment the battery needs to handle the load. The battery is Lead-Acid. When fully charged it will be ~27V.
I have access to the battery, but I need to check it's voltage remotely, so I need to "read" it's voltage electronically, and with or without DC_In, 0V or 27V. I can not measure it with a voltmeter.
I don't need to know the exact voltage, just know if it's below 21V and if it's connected.

I hope that this is enough.
Something to be aware of- it's a lead-acid battery. You cannot correctly test its voltage without putting a load on it. Even a 'dead' battery can say it's at proper voltage when you're only drawing mA in current to test it. It only collapses under load- and therefore, that is the condition you need to test with to get a valid reading.
 

MisterBill2

Joined Jan 23, 2018
18,167
Not checking to see the exact voltage, but testing to see that the battery is connecting and functional. The fact is that if it is at the float voltage and also drawing the small amount of float-charge current, then probably it is ready to do a backup supply powering session. If the voltage across the resistor is greater than that small float charge would be, the battery may be a bit discharged. If the voltageacross the resistor is zero, then the battery might be disconnected. The reading accuracy does not need to be perfect, but it does need to be repeatable and have adequate resolution.
 
Top