Using Sensed battery voltage to pull EN/UVLO pin low

WBahn

Joined Mar 31, 2012
30,055
Don't power the LN339 from the same voltage as the reference. The device needs to be powered by at least 2 V greater than the input common-mode voltage range it will see. Power it from your battery just like you are powering your voltage regulator.

And why do you insist on using an adjustable voltage regulator to produce your voltage reference? At least use a fixed regulator to eliminate component tolerances in your voltage-setting resistors. Better yet, use a 5 V voltage reference IC.
 

WBahn

Joined Mar 31, 2012
30,055
I updated my design with the comparator to a more detailed design. Would this work in the lab? I was expecting to need to switch a npn or something at the output of the comparator. I was also expecting to need a pull up or pull down resistor.
The output of the LM339 IS an NPN transistor!

Since all you are wanting to do is pull the node LO when the voltage drops below the comparison threshold, you just want an NPN to pull the node LO. When it's above the threshold, the circuit is as though the LM339 wasn't even there.

There is one problem I am seeing with my design. I tried to make it to where the output would go low right when the input reaches 13.5V. I remapped the inverting voltage using R3 and R4 attempting for V- to reach 5V right when Vbattery=13.5V which would trigger the output of the comparator to change. That seems to be delayed slightly as shown in the simulation. Why is this happening?
Use the measurement cursors to determine what the actual time and voltages are at the transition point.
 

WBahn

Joined Mar 31, 2012
30,055
To me it looked like its 13.5V at 12s, and then goes low shortly after 12s?
Don't eyeball it, use the cursors and measure it.

Taking a screen capture of the image, I get that the time at which it falls to the halfway point to be 12.228 s (with about 3 ms/pixel resolution),

Your ramp goes up (13.8 V - 12.2 V)/(15 s) = 106.67 mV/s, so at 12.228 s the voltage should be 13.504 V.
 

Thread Starter

jim0000

Joined Oct 28, 2020
130
Don't power the LN339 from the same voltage as the reference. The device needs to be powered by at least 2 V greater than the input common-mode voltage range it will see. Power it from your battery just like you are powering your voltage regulator.

And why do you insist on using an adjustable voltage regulator to produce your voltage reference? At least use a fixed regulator to eliminate component tolerances in your voltage-setting resistors. Better yet, use a 5 V voltage reference IC.
Different regulation:
For the initial design I wanted to use components that I happen to have on hand to test in the lab. The final design I agree, a fixed regulator or reference IC will be better.

LM339 supply:
I didn't know the LM339 needed the supply 2V greater than the input common mode voltage range. Is that something on the datasheet that I missed or is the just best practice? I was worried it would cause a changing output to the comparator since the battery voltage will be changing, and I read that when the comparator is high it can be up to the supply voltage. Would that mess up my output? I was hoping to have a constant comparator output.
 

Thread Starter

jim0000

Joined Oct 28, 2020
130
Don't eyeball it, use the cursors and measure it.

Taking a screen capture of the image, I get that the time at which it falls to the halfway point to be 12.228 s (with about 3 ms/pixel resolution),

Your ramp goes up (13.8 V - 12.2 V)/(15 s) = 106.67 mV/s, so at 12.228 s the voltage should be 13.504 V.
I don't think I knew you could use cursors to measure in LTspice, how do you do that?
 

WBahn

Joined Mar 31, 2012
30,055
Different regulation:
For the initial design I wanted to use components that I happen to have on hand to test in the lab. The final design I agree, a fixed regulator or reference IC will be better.

LM339 supply:
I didn't know the LM339 needed the supply 2V greater than the input common mode voltage range. Is that something on the datasheet that I missed or is the just best practice?
It's in the datasheet: https://www.ti.com/lit/ds/symlink/lm339.pdf?ts=1670332503325

1670350640749.png

Look at the Common-mode input-voltage range.

Since you want to operate up to 50°C, you need to abide by the requirement that the inputs need to be no more than (Vcc-2V).

If you look at Note 3, you find that one input can exceed this range provided the other input is within it. Both of your inputs exceed the range.

I was worried it would cause a changing output to the comparator since the battery voltage will be changing, and I read that when the comparator is high it can be up to the supply voltage. Would that mess up my output? I was hoping to have a constant comparator output.
Where did you read that when the comparator is high the output can be up to the supply voltage?

It is an open-collector output, so it is only able to pull the output pin LO.

You might be looking at something that is saying that you can't apply an output TO the output pin that exceeds the supply voltage, although I haven't been able to find a spec like that in the data sheet. The Absolute Ratings merely say that you can't apply more than 36 V to the output pin.
 

Thread Starter

jim0000

Joined Oct 28, 2020
130
It's in the datasheet: https://www.ti.com/lit/ds/symlink/lm339.pdf?ts=1670332503325

View attachment 282399

Look at the Common-mode input-voltage range.

Since you want to operate up to 50°C, you need to abide by the requirement that the inputs need to be no more than (Vcc-2V).

If you look at Note 3, you find that one input can exceed this range provided the other input is within it. Both of your inputs exceed the range.



Where did you read that when the comparator is high the output can be up to the supply voltage?

It is an open-collector output, so it is only able to pull the output pin LO.

You might be looking at something that is saying that you can't apply an output TO the output pin that exceeds the supply voltage, although I haven't been able to find a spec like that in the data sheet. The Absolute Ratings merely say that you can't apply more than 36 V to the output pin.
I believe I would have to add a pull up resistor? If I connect 5V to the positive LM339 supply rail I was thinking the output could get up to 5V. Like below? Is this incorrect?

View attachment 282402
 

WBahn

Joined Mar 31, 2012
30,055
Look back to your original circuit (in one of your many other threads on this topic) where you had a single NPN transistor that was used to either pull that EN pin LO or to leave it alone and let the voltage divider formed by the two resistors determine that ~4 V at that node.

NOTHING HAS CHANGED!

That NPN transistor is merely INSIDE the LM339.

1670352206365.png
 

Thread Starter

jim0000

Joined Oct 28, 2020
130
Look back to your original circuit (in one of your many other threads on this topic) where you had a single NPN transistor that was used to either pull that EN pin LO or to leave it alone and let the voltage divider formed by the two resistors determine that ~4 V at that node.

NOTHING HAS CHANGED!

That NPN transistor is merely INSIDE the LM339.

View attachment 282403
Ah that makes a lot of sense. Since its an open collector output it looks like I am still just switching a path to ground.
 

sghioto

Joined Dec 31, 2017
5,388
Since its an open collector output it looks like I am still just switching a path to ground.
It's simple enough to work out the details of the comparator circuit but back to your original question in post #1 how to isolate the battery voltage from the regulator.
If you need to charge the battery at 20-25 amps it might be a better idea to use a timer circuit to control the regulator.
Starting with a fully charged battery my thought would be to activate the regulator/charger when the battery voltage drops below 12.2 volt using the comparator circuit.
 
Top