How does this transistor-based voltage detector circuit work?

answered this SE EE question on Dec 18, 2022.

My answer

How to compare voltages

To detect if a voltage is below/above a given value, you need to compare it to that value. This can be done in two ways:

... by a threshold element

First, we can apply (a part of) the input voltage to an element with a fixed voltage threshold, for example a diode, LED, base-emitter junction, zener diode, etc. If the input voltage is higher than the threshold, the current will be diverted to the threshold element.

This idea is implemented in the OP's circuit where a part of the input voltage is obtained by the voltage divider and the base-emitter junction of the first transistor serves as a 0.7 V threshold element.

When the threshold is too small (as in the OP's case), it can be increased by adding another or more voltage threshold elements (diodes) in series. In the OP's circuit, another diode can be inserted between the emitter and ground to "lift" the emitter with another 0.7 V.

But this trick will create a problem with the control of the second transistor - it will always be "on". And here it occurs to us to apply the same trick to the second transistor - we can insert another diode in its emitter.

... by a voltage comparator

With the same success, we can compare the input voltage with another but reference voltage. For this purpose, the two voltages must be subtracted and the result amplified. We can do it in two ways:

  • in series (according to KVL). In this case, the two voltage sources are grounded and the result is "floating". The two voltages have the same polarity (usually positive) so they are subtracted in the loop.
  • in parallel (according to KCL). In this case, the two voltage sources have opposite polarity (positive and negative) and are connected through resistors to the output; so they are subtracted and the output is grounded.

Let's see, for example, how the series comparator is implemented.

Transistor comparator. In this case, we can insert the reference voltage source in the emitter of the transistor to "lift" the emitter to the desired level. The result of comparison is applied to the transistor input (base-emitter junction) and amplified.

Op-amp comparator. Here, we connect the reference voltage source to one of the op-amp inputs and the input voltage source to the other. The result of comparison is applied to the op-amp differential input (between the two inputs) and amplified.

Implementations

... without transistors

If you use the fact that an LED is both a threshold element and an indicator, you can make the simplest possible implementations:

1. Low-voltage indicator: Connect the anode of the LED to a reference positive source and its cathode to the input voltage source. The latter must be able to sink the LED current. Of course, you has to increase the reference voltage by the LED forward voltage.

2. High-voltage indicator: Connect the cathode of the LED to a reference positive source and its anode to the input voltage source. The latter must be able to source the LED current and the reference voltage source to sink the LED current. Now you has to decrease the reference positive source voltage by the LED forward voltage.

... by one transistor

You can make a more precise low-voltage indicator by adding only one PNP transistor (it is as if we removed the second transistor in the OP's circuit). For this purpose, connect the emitter to the positive reference voltage and the base to the input voltage and insert the LED with a resistor in series between the collector and ground.

Generalization

You can detect if a voltage is below/above a given value in the following general ways:

1. Current steering: Apply the input voltage to an element with a fixed voltage threshold (diode) and use the current through the element as an output.

2. Diode string: To increase the threshold voltage, connect in series:

  • more diodes
  • additional voltage source

3. Series comparison: Subtract the input and reference voltage in a series manner and amplify the result.

4. Parallel comparison: Subtract the input and reference voltage in a parallel manner (through resistances) and amplify the result.

See also

How do we investigate basic transistor amplifier stages? (a related story from my blog Circuit Stories)
Deriving a Series Voltage Summer from Kirchhoff's Voltage Law (my Wikibooks story)
Building a Parallel Voltage Summer (another Wikibooks story)
3-LED voltage indicator (my inventor's story about a similar circuit, Codidact)

My comments

  1. @josh, It will work (I would add only some base resistor of a few k to the second transistor)... but I would like to present the concepts to you. That is why I am telling how such a circuit can be made, especially yours. In the meantime, while I finish my answer, would you mind taking a look at my story on basic transistor stages (I linked to it at the end of my answer a while ago)? I have been preparing it with great enthusiasm for my students this fall... but it turns out I won't be using it. Here's a chance for it to do something useful. I think it will be very useful for you.

Comments