#412 BJT Comparator
Investigating and testing a comparator design with discrete components.
Notes
Comparators are used to compare two voltages, with a binary output (high or low).
These days, it is common to see OpAmps used as general purpose comparators. There are also specialised comparator ICs such as the LM311 (from the LM111 family - one of the first comparator IC families). Comparator ICs are typically for more demanding applications and may feature:
- Integrated references
- High-speed (fast propagation delay, rise and fall times)
- Low-power
Comparator IC internals are relatively sophisticated; much of the complexity concerns temperature stability and balance adjustment. However at their heart, the basic concept of a comparator is a differential amplifier but with an output that swings between two states.
For this project, I’m going back to basics and attempting to implement a comparator with discrete transistors.
Design Inspirations
It was surprisingly difficult to find examples of BJT comparator circuits. It seems the field jumped very quickly to OpAmp and Comparator ICs.
The most useful references I found were:
- Electronic Principles which presents a simplified schematic of an IC comparatorin section 22-13, p853
- Art of Electronics 2.22 Temperature controller, p105 - a circuit that includes a BJT comparator in the control circuit
Design
Q1-4 comprise the differential amplifier with current mirror to provide an active load. Q5,Q6 current mirror limits the emitter current of the differential pair.
In the demonstration mode (which can be disconnected with jumpers), R1 and R2 are 100kΩ potentionmeters that effectively make a Wheatstone bridge for comparing the voltages at the wipers.
The output is tapped at the collector of Q4. In some comparator circuits, this may simply drive the base of an open-collector NPN output stage - however this will normally have a linear region and not a clear-cut on/off.
In this design, I’ve tapped Q4 collector to control high-side PNP (Q7) in turn switching an NPN (Q8) output stage - which presents as an open-collector output stage. An LED and current limiting resistor is the “load”, providing visual switching indicator.
I built this up first and testing it on a breadboard..
Protoboard Construction
This is a nice demonstration circuit, so I made it a little more permanent on protoboard. With jumpers in place, the 100kΩ potentiometers set the input and reference voltage for the comparator.
Pin headers provide a breakout of:
- Vi - for measuring the input voltage, or applying the input voltage if Vi jumper is removed
- Vr - for measuring the reference voltage, or applying the reference voltage if Vr jumper is removed
- Vo - comparator output
- Power and Ground
Testing
Here’s a scope trace that captures some manual manipulation of the input and reference voltage pots.
- CH1 (Yellow) - input voltage Vi
- CH2 (Blue) - reference voltage Vr
- CH3 (Red) - comparator output voltage Vo
Credits and References
- Comparator - wikipedia
- how would one design a comparator using just discrete BJTs
- Voltage Comparator Circuits
- OPERATIONAL AMPLIFIERS : part 17 (Operational amplifier models)
- Op Amp Comparator Circuit
- Art of Electronics 2.22 Temperature controller, p105
- Electronic Principles - Malvino section 22-13, p853
- ..as mentioned on my blog