I need help understanding why these two circuits designed to be the input to a microcontroller logic-level GPIO pin operate completely differently. Green is the voltage at "output" and blue is the voltage to the base of the transistor. I was looking for both to have sharp on and off curves.

The blue is a little hard to see, but in the low-side configuration, I get 0 volts at the output until about .6V which turns the transistor off and I can read "high". In the high-side configuration, the output follows the base voltage until it drops below .6V and stays low until it rises back above .6 again. I was expecting it to stay at 4.4V in saturation and then drop off sharply at a certain point. I tried different voltage ranges for V2. What am I missing?

If this is modeling an optoisolator or IC beam-break infrared detector, could I expect the same behavior, or would the IR LED and phototransistor combination work differently? This assumes that the light was also following more of an analog (bright and dim) vs. digital (on or off) pattern.

High side vs. low side switch simulations

  • 1
    \$\begingroup\$ If you replace the BJT in the upper circuit with a PNP, they will. \$\endgroup\$
    – tobalt
    Nov 16, 2022 at 8:48

1 Answer 1


What am I missing?

The upper circuit is a unity-gain emitter-follower (aka "common-collector"). There is no voltage amplification with this circuit and, what you see on your simulation screen is exactly what I'd expect to see. This is why the term "emitter-follower" is used; the emitter voltage "follows" the base.

Your lower circuit is called "common-emitter" and, you can get plenty of voltage amplification. Your sim screen shows exactly what I'd expect to see. Note also that the output voltage is inverting compared to the input voltage.

If you want to easily remember which one has unity gain and which one produces voltage amplification, consider that the base-emitter junction is a forward biased diode hence, the emitter voltage in a common-collector circuit is always about 0.7 volts lower than the base voltage. Therefore, it must be a unity gain system with respect to AC signals.

When you raise the base voltage, the emitter voltage follows and creates the situation where just the right amount of base current flows to maintain the collector/emitter current at the right level for the voltage at the emitter. It's negative feedback regulation.

Because the emitter is tied to ground in the common-emitter circuit, you can force current into the base quite easily and override the negative feedback system of the common-collector. Thus it can have high voltage gain.

if this is modelling an opto isolator or IC beam-break infrared detector, could I expect the same behaviour, or would the IR led and phototransistor combination work differently?

It will work differently because the input to the phototransistor is "light" and, that light level is unaffected by the inherent negative feedback system in a common-collector circuit. Both opto circuits will behave similarly in that for a given photodiode (LED) current, you will get the same current in the emitter as you do in the collector but, in terms of voltage output, one will be inverting and one will not.

At higher frequencies, it's better to use the common-collector circuit because the phototransistor's internal miller-capacitance won't create high-frequency signal negative feedback.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.