How Is A 741 Operational Amplifier Used In A Comparator Circuit?
Opamps can be used as comparators, although they are not ideal. The LM339, for example, is a better choice. The basic circuit has one of the inputs connected to a voltage reference and the other to the unknown input. When the input is < the reference, the output is slammed to one of the supply rails (depending on the polarity of the inputs) and when the input is > the reference, the output is slammed to the other supply rails. A better circuit uses some positive feedback to add hysteresis so that the output does not oscillate with input close to the reference voltage. .