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:

LT1637 circuit

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]?
  • \$\begingroup\$ 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. \$\endgroup\$ – horta Mar 19 '15 at 3:53
  • \$\begingroup\$ 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. \$\endgroup\$ – horta Mar 19 '15 at 3:56
  • \$\begingroup\$ 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? \$\endgroup\$ – kolosy Mar 19 '15 at 4:03
  • \$\begingroup\$ 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. \$\endgroup\$ – horta Mar 19 '15 at 4:17
  • \$\begingroup\$ 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. \$\endgroup\$ – kolosy Mar 19 '15 at 4:23

I think your problem is actually that your ultrasonic sensor doesn't have a "hard" voltage output. It appears to have a high output resistance of ~10K. That means that you've got a voltage divider between R4 and the ultrasonic output. R3 is pretty much too small to care about. The ultrasonic sensor is getting overwhelmed with voltage from the op-amp. I would remove R4 to begin trouble-shooting. This would remove feedback so you won't get hysteresis, but you'd no longer have current back-feeding your sensor.

Two potential solutions:
1. Increase the feedback resistors by 10X or 100X to lower the relative output resistance of the sensor.
2. Buffer the sensor output with an op-amp.

  • \$\begingroup\$ Does this mean that hysteresis isn't an option in this design, or is there another way to accomplish it? Another op-amp buffering the input? \$\endgroup\$ – kolosy Mar 19 '15 at 4:43
  • \$\begingroup\$ An op-amp buffering the input would certainly work. Op-amps have very low output impedances/resistances. Another option that may work is to increase the feedback resistors to something like 100k and 1k for R4 and R3 or possibly even higher than that, something like 1M and 10k. In that way, the output resistance of the sensor would look much smaller and would therefore carry more weight in terms of the voltage at the input node. \$\endgroup\$ – horta Mar 19 '15 at 4:47
  • \$\begingroup\$ fwiw, switching the feedback resistors to 1K and 1M solved the issue as well. \$\endgroup\$ – kolosy Mar 26 '15 at 1:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.