In electronic part seller websites, I see that there are two separate categories for opamps and comparators. As far as I know, an opamp itself is already a comparator if you don't connect a negative feed back and run it in the open loop mode. So, what are these "comparators" exactly? What makes them different than ordinary opamps? When should I prefer a comparator over an opamp?
Electronic – the difference between “opamp” and “comparator”
comparatoroperational-amplifier
Related Solutions
An LM339 is ALWAYS a differential comparator.
The impression that there are "general purpose" non differential versions is probably because somebody has missed out the term "differential" without intending it to mean not-differential.
A reference to a page that seems to say otherwise would allow us to explain the confusion.
Differential comparators - overview of meaning of the term:
In the following I will refer to 'signal' or 'voltage' when I talk about what is amplified. The description can be extended to other variables as required.
It is possible to amplify other variables (electrical ones or others) but voltage is the most normal and, when some other variable is apparently amplified, what is really happening is that voltages and currents are being dealt with internally so that the target variable appears to have been amplified.
For example you can get "resistance amplifiers" or capacitor multipliers where a resistance or capacitance value is "amplified" functionally - but voltages and currents are dealt with to do this.
Integrated Circuit comparators are essentially all "differential.
The term "differential comparator" essentially means
"a device that compares and acts on the difference between two variables"
so for a comparator to not be differential is, in the strict sense, impossible.
The terms differential or (implied) non-differential are more usually used for amplifiers. Here the terms make some sense but even a non-differential amplifier IS a differential amplifier at heart. Because -
A differential amplifier is one which amplifies the difference between two points (usually a voltage difference) where neither point is "ground".
A non differential amplifer amplifies the magnitude of a signal without explicit reference to another signal point BUT the actual reference is usually circuit ground. In a few cases a signal is amplified "in isolation" but here the reference point is the centre of the input signal if not otherwise specified, and, if the output signal has a new centre point it is said to have an "offset" - which is an acknowledgement that the original reference point was the centre of the input signal.
It is arguable that you could build a comparator that would not be described as
"differential" but this would be unusual. This could occur if you used ground as one input.
So, a 3V comparator would operate when the input was at 3V above ground - the other unseen differential input would be connected to a reference point 3V above ground.
A difference amplifier will do what you want, but it has a potentially serious problem. The input impedances are not well defined, or matched. Referencing Jay's circuit, the input impedance of the noninverting side is \$R_1+R_f\$. That is as close to a defined input impedance as we get with this topology. Since there is negative feedback, the inverting pin will track the noninverting pin. What would normally be a virtual ground is now varying based on \$V_+ \$, and with it the input impedance of the inverting side.
If this issue is a problem for your application, a better option would be an instrumentation amplifier.
\$V_{out}=(1+\dfrac{2R_1}{R_{gain}})(\dfrac{R_3}{R_2})(V_2-V_1)\$
The inputs are buffered and have matched input impedances, equal to the op amp input impedance. You can either build one yourself, or buy an IC. An IC solution will ultimately have better performance, especially in common mode rejection.
Best Answer
Opamps are optimized for linear operation, in which the voltage difference between the input terminals is kept very small via feedback. As a consequence, the performance when using them in a nonlinear or open-loop application tends to be poor. In particular, charge storage on internal nodes tends to cause opamps to respond very slowly when coming out of an "input saturated" condition.
On the other hand, comparators are optimized for speed at the expense of linearity, and are designed specifically to be fast over a wide range of differential input voltages.