Strange comparator behavior

analogcomparator

I am testing the following comparator schematic:

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?

UPDATE:

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.

UPDATE 2:

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.

Best Answer

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.

Related Topic