Comparator Circuit

Thread Starter

Ghyrt

Joined Jun 3, 2009
10
I'm trying to make a circuit that will detect a sudden positive change in input voltage. The idea behind the attached design is that if the input voltage (which is mostly DC) increases suddenly, the non-inverting input on the comparator will momentarily be higher than the non-inverting. However, when I implement this, the output is always high. I'm guessing this has something to do with the fact that there is a path between my inverting and non-inverting inputs, but I wanted another opinion.

Any ideas why this isn't working? Am I even close?

I am using a LM311N as my comparator.
 

Attachments

hgmjr

Joined Jan 28, 2005
9,027
I'm trying to make a circuit that will detect a sudden positive change in input voltage. The idea behind the attached design is that if the input voltage (which is mostly DC) increases suddenly, the non-inverting input on the comparator will momentarily be higher than the non-inverting. However, when I implement this, the output is always high. I'm guessing this has something to do with the fact that there is a path between my inverting and non-inverting inputs, but I wanted another opinion.

Any ideas why this isn't working? Am I even close?

I am using a LM311N as my comparator.
I am surprised to hear that the output is always high. The LM311 is an open collector output and requires a pullup for it to work.

Take a look at the datasheet for the device and you will see what I mean.


hgmjr
 

Thread Starter

Ghyrt

Joined Jun 3, 2009
10
I am surprised to hear that the output is always high. The LM311 is an open collector output and requires a pullup for it to work.

Take a look at the datasheet for the device and you will see what I mean.


hgmjr
I have a 220 Ohm Resistor from Vcc to pin 7 and an LED from pin 7 to ground to observe output. If I understand correctly, pin 7 shorts when output is supposed to be 0 and goes to high impedance when output is to be high.

What's I'm observing is that even when the signal voltage is held constant, the LED is lit. I'm baffled.


EDIT:
You need to number your pins so that we can tell how you connected it up.

hgmjr
I'll get on that. It may take a little bit.
 
Last edited:

Bychon

Joined Mar 12, 2010
469
Both inputs get the same voltage, all the time, if the resistors to ground are equal. With no difference, there is nothing to amplify. Even if the resistors to ground aren't equal, both inputs will be one higher than the other, and will stay that way, no matter what the input does.

A comparator compares voltages. They have to be different from each other to get any useful result. You need a capacitor on the - input so the voltage there will hold still for a short amount of time while the voltage on the + input bounces higher.

In addition, you have to set up the resistors so the - input will have a higher voltage than the + input when nothing is wrong. That will get the comparator to have a low output until the sudden positive change happens. Then, when the comparator reacts to the change, it will change output voltage. Other wise, the output voltage will forever be stuck in the high condition.
 

Thread Starter

Ghyrt

Joined Jun 3, 2009
10
Both inputs get the same voltage, all the time, if the resistors to ground are equal. With no difference, there is nothing to amplify. Even if the resistors to ground aren't equal, both inputs will be one higher than the other, and will stay that way, no matter what the input does.

A comparator compares voltages. They have to be different from each other to get any useful result. You need a capacitor on the - input so the voltage there will hold still for a short amount of time while the voltage on the + input bounces higher.

In addition, you have to set up the resistors so the - input will have a higher voltage than the + input when nothing is wrong. That will get the comparator to have a low output until the sudden positive change happens. Then, when the comparator reacts to the change, it will change output voltage. Other wise, the output voltage will forever be stuck in the high condition.
I'm pretty sure my picture captures that concept. There is a resistive voltage divider on the non-inverting input, and no resistive divider on the inverting input. As the inductor's voltage drop appraoches 0, the inverting pin will approach V_in.
 

Lesaid

Joined Apr 16, 2008
9
This requirement is almost identical to a project of mine a couple of years ago - which used an inductor in a potential divider to detect a pulse (in this case, caused by movement of a magnet near the inductor).

You might like to try the potential divider the other way round so that the +ve and -ve inputs are biased with -ve above the +ve so the output is always low. Then put the inductor in series with the middle resister of the divider (between the two inputs) so that when the pulse arrives, it momentarily reverses the bias of the two inputs, overriding the potential divider. I used high value resistors and a home-wound inductor that produced a pulse of over 100 mV - much more than was necessary to bias the opamp. I found I needed a capacitor in series with a high value resistor in a positive feedback loop to ensure that the opamp stayed 'on' for a second at a time, even with a short pulse.

Hope this helps.
 

Lesaid

Joined Apr 16, 2008
9
My apologies - I just realised an error in my last post - the inductor was between the potential divider and the +ve going input, not in series with the divider. But the principle is the same - the pulse from the inductor temporarily overrides the reverse bias from the potential divider.

Sorry for any confusion.
 

Engr

Joined Mar 17, 2010
114
I think the 220 ohms pull-up resistor from pin 7 to Vcc is too small that is why the output is always high. Try using a 1K ohms resistor.
 
Top