Electronic – Help understanding BJT voltage comparator

bjtcomparator

I'm trying to understand how a transistor voltage comparator works. For example I've been studying this LM339:

comparator circuit diagram http://lc.fie.umich.mx/~a0686696c/Materias_files/Lab.Elect.Analog_files/Voltmetro/Comparators_files/ComparatorGuts.GIF

My questions are:

  1. What are the current sources for and how would those actually be implemented if for example I wanted to bread board this circuit

  2. How can the circuit differentiate between inputs of say 1.5V or 2V? I must be wrong but my understanding is that if the voltage on a transistor exceeds a certain threshold the transistor will turn on. So I don't understand how inputs of (3V, 4V) and (4V, 3V) for example are any different.

  3. If INPUT+ is at 0V and V+ is at say 12V then wouldn't 12V be shorted to 0V at the base of Q2?

Basically a walk-through of what happens with this circuit for different inputs would be great.

Best Answer

For purposes of understanding the circuit, think of the current sources as being resistors. The processes that make ICs are very good at making current sources within them (even better than they are at making resistors), and using current sources rather than resistors will reduce the required margin between the input voltages and V+, but for purposes of understanding resistors will work fine. The exact values don't particularly matter. Note also that for purposes of the following discussion, transistors will be regarded as having a base-emitter drop of exactly 0.7 volts. In reality, the Vbe can vary, though similar on the same chip exposed to the same conditions should exhibit similar behavior.

Each of the PNP transistors will try to draw current into its emitter, sending about 2% out the base and 98% out the collector, to pull the emitter and collector toward voltages that are 0.7 volts apart. For Q1 and Q4, the effect of this is that the emitters will be 0.7 volts above the inputs; about 2% of the current the emitters have to draw will go out the inputs, and the rest will be sunk to ground.

Suppose the + input is at 1.0 volts and the - input is 1.1 volts. Then the base of Q2 would want to be at about 1.7 volts and the base of Q3 at 1.8 volts. Q2 will draw enough current through its emitter to pull it down to about 2.4 volts (0.7 volts above its base). Since Q3 will only have 0.6 volts between its emitter and base, it won't have to pull anything through its emitter.

Thus, of the current supplied by the 100uA current source near the top, nearly all of it will go into the emitter of the left transistor, and about 98% of that will go through to its collector. The Q5/Q6 circuit is called a current mirror; Q5 will gobble up all the current it's offered and Q6 will be willing to gobble up either as much current as is flowing into Q5, or as much current as is necessary to pull its collector to ground. In this case, Q3 will be passing through almost nothing, so Q6 will pull its collector to ground. Q7 will have nothing on its base, so its collector won't gobble anything. About 100uA will thus be available to flow into the base of Q8, turning it on.

Suppose the input voltages were switched. Then Q2 would have nothing between its emitter and base, but Q3 would have 0.7 volts. In that scenario, no current flows into the left side of the current-mirror circuit, so the right side isn't willing to gobble anything. Thus, most of the 100uA from the top center flows into the base of Q7. That turns it on and makes it gobble up the current from the right-side source leaving nothing for Q8.