I am testing the following comparator schematic:


simulate this circuit – Schematic created using CircuitLab

I've replaced the original 280 kΩ resistor with R1 and trimpot R3. The hysteresis resistors are calculated to switch on at 30.78 V battery (2.54 V on + input) and switch off at 29.78 V (2.46 V on + input). Battery voltage at testing time was 28.89 V.

So, I am pressing the button SW1 and turning the pot until comparator triggers ON. First I noticed some flicker on the output before switching to a solid ON. This is already strange, since hysteresis should have taken care of it. When I release the button the comparator stays ON for a random period of 5 to 15 seconds, then switches OFF.

I thought the calculations were wrong, so I connected a voltmeter to TP1. The comparator switched ON at 2.63 V, not at the expected 2.54 V. With the button released the voltage dropped to 2.35 V and the comparator switched OFF immediately.

I re-tested everything several times and the result is the same: with the voltmeter connected the circuit switches ON and OFF immediately when the button is pressed and released. There is no jitter when I rotate the potentiometer either. Without the voltmeter there is a jitter and then it stays ON for some time. Furthermore, connecting the voltmeter sometimes activates the output, sometimes not. Considering the very high voltmeter impedance this is very strange.

Any ideas why this is happening and what I can do to fix it?


The original circuit had two problems that combined to produce the observed strange behavior.

First, I failed to account for 5V feedback voltage injected into the voltage divider via R4, R5. Accidentally, with selected R1-R3 it was enough to keep TP1 voltage at 2.457V, i.e. within millivolts of the OFF threshold. Connecting the voltmeter pushed this down enough to trip the comparator. This was fixed by changing R1 to 200k.

Second, high resistor values made circuit susceptible to noise. This was fixed by adding 1nF capacitors to TP1 and 2.5V reference. I've used smaller values because they will remain in the circuit after the test button removed, so will affect the dynamic response.

My thanks to @unawriter and @mosfet for helping me pinpoint these problems.


After more testing it become apparent that while changing R1 did make the circuit working, the experimental resistance values and thresholds do not correspond to theoretical calculations. It seems the hysteresis formulas in comparator datasheet assume very low source impedance. In this case it is very high, so feedback chain significantly affects the thresholds. Maybe I have to make another question specifically for the calculations.

  • \$\begingroup\$ What circuit generates the 2.5 volts to the inverting input? How the comparator gets its DC supply - any decoupling capacitor? A breadboard and looong wires? . What happened when you tried another comparator? Multiple comparator IC ? If yes, how are the others connected? Show a photo to stop evil sounding guesses of elementary errors. \$\endgroup\$
    – unawriter
    Jan 22 at 23:05
  • \$\begingroup\$ @unawriter the comparator powered by MAX6143 5V reference. Two 47k resistors divide it into 2.5V reference. There are 0.1uF bypass caps on reference and comparator pins. \$\endgroup\$
    – Maple
    Jan 22 at 23:21
  • \$\begingroup\$ Try to insert a 22nF...39nF capacitor between TP1 and GND to stop noises. The about 0.5...1ms time constant should be nothing for manual button presses. \$\endgroup\$
    – unawriter
    Jan 22 at 23:28
  • \$\begingroup\$ what is the purpose of this circuit? \$\endgroup\$ Jan 22 at 23:45
  • \$\begingroup\$ @JasenСлаваУкраїні it is part of this circuit, except different voltage reference chip is used here and 1uF C4 is not installed. \$\endgroup\$
    – Maple
    Jan 23 at 0:03

1 Answer 1


Use lower value resistors (order of 10s of kΩs). With the values you selected, everything is acting like an antenna, especially if this is on a breadboard. Also, your "very high voltmeter impedance" isn't very high compared to the resistances of your circuit.

  • \$\begingroup\$ The resistors were calculated with 2mA idle allowance for the entire circuit. I can make them a bit smaller, but not by much. Can some additional capacitors somewhere help? \$\endgroup\$
    – Maple
    Jan 22 at 23:25
  • 2
    \$\begingroup\$ @Maple you definitely want to decouple the chip if that's not already done. You also want to put a cap across your reference. The reference ground and the "switch circuit" ground should be close with no current flowing between them. See "star ground" for more theory. Long story short, the comparator is comparing the potentials on its input - so it's important that local input ground references are always in potential sync. \$\endgroup\$
    – MOSFET
    Jan 22 at 23:41

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.