# Understanding op-amp Schmitt trigger circuit

This is a follow up to the question Replacing a tactile switch with an ultrasonic ranger.

TL;DR the circuit is meant to take a variable analog signal output that varies between 0V and 5V, and make it 0V for values < 100mV and 5V for values >= 100mV

I built (breadboarded) the circuit referenced there, using an LT1637:

I kept the R3, R4 and R5 values as given, and set R1 to 220$\Omega$ and R2 to 10k$\Omega$. The analog input of my ultrasonic ranger is plugged into the 'input' line, and I've measured that without this in place, the ranger produces the voltage I expect on the analog output - around 68mV when something is 6" or closer, and more as the object moves away. The R1/R2 bridge sets my voltage threshold to 111mV.

What I'm seeing is that the input line goes from varying between 68mV and 5V (depending on distance to object in front of it) to between 2.0V and about 2.5V, depending on distance. This is very unexpected to me. The output of the op-amp stays fixed at VCC (which is 5.22V from a regulated wall-wart).

When I simulate a DC sweep on this circuit, plugging in appropriate values, I get the input behaving as expected, and the output pegged at VCC, regardless of input voltage.

So:

• Is there a problem with this circuit?
• And why is my ranger output line being biased and constrained to [2V, 2.5]?
• Are you sure that R3 is 100 and R4 is 10,000? It feels like you've got much more positive feedback than 5*100/10000 V. – horta Mar 19 '15 at 3:53
• Oh wait, this is wrong too: R1 to 220Ω and R2 to 10kΩ. it should be the other way around. Otherwise your set point is very close to 5V. I'm guessing you probably just stated this backwards and you actually have it correct in your simulation and in your breadboard. I'd look closer at my first post. – horta Mar 19 '15 at 3:56
• I just rechecked all R values with a meter, they're all correct (or at least as stated). Flipping R1 and R2 does have an effect - it makes the input unconstrained (though different than without this circuit - it would bottom out at 68mV on its own, goes to 48mV now), but output is now stuck at 0V? – kolosy Mar 19 '15 at 4:03
• If your R values are the same as in the picture, then you should not be seeing 111mV at the negative input. You should see 5*10000/(10220)=4.89V Please confirm that you see either 111mV or 4.89V at the negative input to the op-amp. – horta Mar 19 '15 at 4:17
• I see 5.11V, which is right given the 5.22V Vcc. The 111mV I reference above is for what I expect the logical voltage threshold to be, not the observed value at V-. Op-amps are bit beyond me, apologies if I'm confusing matters. – kolosy Mar 19 '15 at 4:23