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.
- Is there a problem with this circuit?
- And why is my ranger output line being biased and constrained to [2V, 2.5]?