The negative input must exceed the positive before the output will go low.To me it looked like its 13.5V at 12s, and then goes low shortly after 12s?
The negative input must exceed the positive before the output will go low.To me it looked like its 13.5V at 12s, and then goes low shortly after 12s?
The output of the LM339 IS an NPN transistor!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.
Use the measurement cursors to determine what the actual time and voltages are at the transition point.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?
Don't eyeball it, use the cursors and measure it.To me it looked like its 13.5V at 12s, and then goes low shortly after 12s?
Different regulation: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.
I don't think I knew you could use cursors to measure in LTspice, how do you do that?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.
It's in the datasheet: https://www.ti.com/lit/ds/symlink/lm339.pdf?ts=1670332503325Different 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?
Where did you read that when the comparator is high the output can be up to the supply voltage?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.
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?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.
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.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
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.Since its an open collector output it looks like I am still just switching a path to ground.
by Jake Hertz
by Jake Hertz
by Jake Hertz