I didn't add any hysteresis to below circuit but there's ~500 mV delay between output going high and low, output goes high at 7.5 V but goes low at 7 V:


simulate this circuit – Schematic created using CircuitLab

I think the current through the pull-up resistor keeps the transistor on but isn't the LM393 supposed to prevent that by sinking the pull-up current to ground so the output can be without any hysteresis?

What is causing this unwanted hysteresis?

  • 1
    \$\begingroup\$ "delay" ... there will be a propagation delay in all parts which may present itself as equivalent to hysteresis but do not confuse a transport delay with threshold hysteresis \$\endgroup\$
    – user16222
    Commented Jun 30, 2020 at 14:33
  • \$\begingroup\$ What is your input signal and what frequency is it? \$\endgroup\$
    – Andy aka
    Commented Jun 30, 2020 at 14:33
  • \$\begingroup\$ @Andyaka It's DC voltage. \$\endgroup\$ Commented Jun 30, 2020 at 14:33
  • \$\begingroup\$ How are you determining "output goes high"? Measuring the voltage directly at the op-amp, or when the relay activates? \$\endgroup\$
    – Aaron
    Commented Jun 30, 2020 at 15:53
  • \$\begingroup\$ I did both if your read my chat with Spehro. with and without relay and or transistor, directly at output etc. it was stray capacitance causing it. \$\endgroup\$ Commented Jun 30, 2020 at 16:01

1 Answer 1


Edit: As it turns out from OP, the cause was unwanted feedback, likely causing high-frequency oscillation. Reducing the impedance at the non-inverting input by 10:1 by changing the resistor values cured the symptom.

In general it is a good idea to have a bypass capacitor across the supply rails near the chip and to bypass any slow-moving or DC input such as the reference voltage in the above circuit with a capacitor to ground. In this case, something like 100nF would be appropriate. OP could then most likely go back to the higher values and waste less power.

Solderless breadboards, as OP used, have a certain amount of parasitic capacitance between rows of connections, several pF or more, and although that is often not of much concern, it can cause issues in some cases, even where high frequencies are not intended to be present.

A coupling of only 5pF could cause this amount of oscillation with ~6.9K source impedance at only ~150kHz, which is well within the capabilities of that comparator.

Possibly the current drawn by the relay coil is dragging the 24V nominal supply down by 1.6V, which would cause the hysteresis you are seeing.

You can add a voltage regulator (series or shunt) or a zener diode regulator to stabilize your reference.

You must also have a flyback diode across the relay, which could conceivably be causing the problem. Try it without the relay connected at all and see what happens.

  • \$\begingroup\$ The 24V reference voltage is directly from the 7824 regulator and it's not dropping, relay is only drawing 8 mA. \$\endgroup\$ Commented Jun 30, 2020 at 14:48
  • \$\begingroup\$ See edit--- flyback diode is not optional. \$\endgroup\$ Commented Jun 30, 2020 at 14:51
  • \$\begingroup\$ Flyback diode is connected, I disconnected the relay and measured the output voltage. output doesn't go to the positive rail, only to ~12 V, output voltage decrease gradually as the positive input reference decreases. but instantly goes to 12 V. \$\endgroup\$ Commented Jun 30, 2020 at 14:56
  • \$\begingroup\$ Are you sure there isn't some AC ripple on your 8V or 24V inputs? Oscilloscope? \$\endgroup\$ Commented Jun 30, 2020 at 14:59
  • 1
    \$\begingroup\$ I just added the 22k and 10K resistors again and a 1uF capacitor to the output, that solves the problem. your guess was right (as always), it was oscillating. \$\endgroup\$ Commented Jun 30, 2020 at 15:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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