# Comparator Undesired Behavior

The following circuit is a comparator, which compares input square signal at non-inverting pin with fixed reference voltage at inverting pin of integrated comparator circuit LM393 ($$\R\$$ is collector resistor since this comparator has open collector). If $$\V_{IN}>V_{REF}\$$ then $$\V_{OUT}=V_{CC}\$$. If $$\V_{IN} then $$\V_{OUT}=0V\$$.

simulate this circuit – Schematic created using CircuitLab

As I built this circuit on breadboard I noticed that $$\V_{IN}\$$ has to differ at least few 100 mV in order for comparator to switch between $$\V_{CC}\$$ and 0V. However such behavior is undesired since input square signal's amplitude varies only few 10 mV between HIGH and LOW states. So I set $$\V_{REF}\$$ in the middle between two input voltage states, but comparator didn't change its output.

But shouldn't the comparator change its output even for slight voltage difference between two inputs? According to equation, which applies for differential structure amplifying devices such as comparator and operational amplifier, my statement is correct. This equation goes as follows:

$$V_{OUT}=A_{OL}(V_+-V_-)$$ $$V_{OUT}=A_{OL}(V_{REF}-V_{IN})$$

Also, if I would design a simple differential structure amplifier with discrete components, which would most probably have much smaller open-loop gain and other deficiencies, a slight voltage difference between two inputs would result in much greater voltage difference at its output.

NOTE: I also tried replacing this integrated comparator circuit with operational amplifiers TL072 and LM358, where both of them indicate similar behavior.

Any ideas if this behavior is normal to all operational amplifiers and comparators? How else could I compare input signal, which varies only for few 10 mV if not this way?

• What is the actual value of Vref? Could be a common mode problem if near the rail. – Nino Jun 25 '19 at 18:10
• Do you have an oscilloscope? And Vin_square isn't bipolar, right? Connect replace the Vin_square input with a potentiometer divider and see if it still happens. – DKNguyen Jun 25 '19 at 18:17
• Vref MUST be 2V below Vcc, and scale input accordingly – Tony Stewart Sunnyskyguy EE75 Jun 25 '19 at 18:20
• @DKNguyen Yes, I have an oscilloscope. Vin_square varies only between positive potentials, it doesn't goes from positive to negative, if that is what bipolar means. – Keno Jun 25 '19 at 18:22
• @Keno Yes, -1.5V CM input range means that Vref or Vin needs to be at least 1.5V below Vcc?. Also, you should look at the "Response Time for Various Input Overdrives". e2e.ti.com/cfs-file/__key/… – G36 Jun 25 '19 at 18:37

As others pointed out, this chip requires the input voltages be at least 1.5 or 2 V below the positive rail, and you don't seem to be following this restriction.