EEVblog Electronics Community Forum

Electronics => Beginners => Topic started by: ender2336 on March 17, 2020, 05:36:15 am

Title: Internal working of a Comparator
Post by: ender2336 on March 17, 2020, 05:36:15 am
Hi

I am looking for an explaination of the inner workings of a comparator. I understand the macro functionality.

What I cannot find anywhere is an adequate explaination of the internal equivalent circuit.

Any help would be appreciated.

Ender
Title: Re: Internal working of a Comparator
Post by: magic on March 17, 2020, 06:55:27 am
Roughly like an opamp minus the frequency compensation stuff.

Essentially, a long tailed pair takes a constant current through its emitters and splits it into two branches proportionally to the difference between base voltages. One of the branches (or the difference between the two) is fed into the base of a common emitter stage which moves the output either up or down.
Title: Re: Internal working of a Comparator
Post by: Zero999 on March 17, 2020, 09:20:38 am
The heart of a comparator and any op-amp circuit is a long tailed pair. I advise building one from a couple of BJTs.

https://www.allaboutcircuits.com/textbook/experiments/chpt-5/differential-amplifier/ (https://www.allaboutcircuits.com/textbook/experiments/chpt-5/differential-amplifier/)
https://en.wikipedia.org/wiki/Differential_amplifier#Long-tailed_pair (https://en.wikipedia.org/wiki/Differential_amplifier#Long-tailed_pair)
https://sound-au.com/articles/comparators.htm#s5 (https://sound-au.com/articles/comparators.htm#s5)
Title: Re: Internal working of a Comparator
Post by: ggchab on March 17, 2020, 10:32:08 am
w2aew has some nice videos on the subject  :)
Ex.: https://www.youtube.com/watch?v=mejPNuPAHBY&t=8s (https://www.youtube.com/watch?v=mejPNuPAHBY&t=8s)
Title: Re: Internal working of a Comparator
Post by: Zero999 on March 17, 2020, 10:57:53 am
I think the easiest way to understand the circuit is to bias one of the transistor bases to 0V, with the other acting as the input. Now we have a two stage amplifier, with Q1 operating in common emitter and Q2 in common base configuration. Really a single BJT can be used as a differential amplifier, as it turns on when the base voltage is above the emitter by around 0.6V. The output of the emitter follower is connected to the input of common base circuit. Q1's emitter voltage is 0.6V less than the base voltage. When it falls 0.6V below Q2's base voltage, Q2 will turn on.
[attachimg=1]

This circuit is not very practical because the output voltage swing is tiny and depends on the input voltage. A simple enhancement would be to add a PNP transistor to the output, which will turn on, as soon as Q2 starts to turn on. Of course that would invert the signal so the inputs could be swapped to compensate. Swapping R2 for a constant current stage would increase the range of input voltages, by making the output swing independent of the input voltage and increase the gain.