10
\$\begingroup\$

I've wired up my project(s) similar to how they're laid out in A to control whether or not an LED is on or off. It works fine (as far as I know), but I've seen lots of examples online of circuits laid out in a B formation (including this SparkFun transistor tutorial). Is this just a convention, or is there a reason why you'd prefer B over A?

Power comes in from the top and feeds out to Gnd at the bottom, and a pin connected to an Arduino of some kind connected to the base:

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
1
  • 2
    \$\begingroup\$ Version A transistor is not a switch but emmiter follover. As a switch BJT should be in saturation , minimum collector-emmiter drop voltage. \$\endgroup\$
    – user263983
    Apr 14 at 23:02

7 Answers 7

22
\$\begingroup\$

Short answer: Use configuration B (almost certainly, although we don't know the rest of the circuit).

Longer answer:

Depending upon the rest of the circuit, changing the order of the switching transistor and the load may change the voltage which you need to apply to the base.

If you use an NPN transistor and the emitter is grounded, you have a common emitter configuration. The base voltage when the transistor is "on" needs to be between 0.6 and 0.8 volts (or thereabouts). If it goes much higher, there is a chance you will burn out your transistor. The off voltage should be between 0 and say 0.5 volts.

If you use the NPN transistor and the collector is connected to Vcc, you have what is called an emitter follower configuration. When the transistor is "on", the voltage at the emitter will be about 0.6 to 0.65 volts below the voltage at the base. Thus to get full power through your transistor switch, the voltage at the base needs to be close to Vcc (perhaps above). To turn the transistor off, the base voltage needs to be close to 0.5 volts or less.

Because the emitter follower configuration requires a much greater voltage swing at the base, for switching circuits, the common emitter configuration is usually preferred.

Note, that if you use a PNP transistor instead of the NPN in your schematic, the common emitter configuration will have the transistor's emitter connected to Vcc, and the emitter follower will have the collector connected to ground. Again, the common emitter configuration is usually preferred.

If the transistor is between the ground and the load, the configuration is called a low side switch. If the transistor is between the load and Vcc, the configuration is called a high side switch. From the discussion above, whether you want a low side switch or a high side switch, usually will depend upon the polarity of your transistor (NPN or PNP).

Further note, that similar, but not exactly the same, considerations apply if you are using a MOSFET instead of a bipolar transistor. A low side switch is usually associated with an N-channel MOSFET. In the case of a high side switch, sometimes an N-channel MOSFET is used, requiring relatively more complicated driving circuitry, and sometimes a P-channel MOSFET is used. The reason for this is that for the same price, an N-channel MOSFET will typically have significantly better characteristics than a P-channel MOSFET. Put another way, to get a P-channel MOSFET with equivalent characteristics, but opposite polarity, to an N-channel MOSFET, will generally cost more, often significantly more.

\$\endgroup\$
16
\$\begingroup\$

Yes, it does matter, and (A) is the wrong order for a switching application.

The (B) circuit is the only one where the transistor acts a saturated switch, as you likely intended. It's unlikely to be damaged as long as you don't exceed the transistor's maximum collector current and have enough base drive current available to keep it saturated.

In the (A) circuit, the transistor is in the linear region, and will be dissipating quite a bit of power. Heavier loads may destroy it, and you won't be able to fully turn such loads on anyway. The well-being of the transistor requires investigation of the SOA - Safe Operating Area - graph in the datasheet.


It happens that on this very website you already have all the tools to answer your own question!

Let's set up both circuits side-by-side. Don't forget about the base resistor that you've omitted from your diagram!

schematic

simulate this circuit – Schematic created using CircuitLab

We can now plot the LED current vs. the value of the series resistor, and compare the behavior of both variants, as the load resistance is swept from 50 Ohms to 10kOhms.

The diode currents plotted as a function of load series resistance

As you can see, if you want to drive the load harder - perhaps it's not an LED but, say, a solenoid, or a motor - the circuit (A) "runs out of oomph" and doesn't fully turn the load on.

That's because a transistor is controlled by the base-emitter voltage. In a circuit where emitter is not at a fixed potential, but you drive the base with a fixed voltage, you'll be at the mercy of the load's behavior and won't be fully in control of the transistor.


But so what, the transistor is still switching, right? Well, yes, in circuit (B) the transistor always acts as a switch. But in circuit (A) it only acts as a switch when switching relatively light loads. As the load gets heavier, the transistor stops acting as a switch, and acts like an additional series resistor.

To see this in action, let's plot the voltage across the transistor in both variants of the circuit, as we sweep the load resistance from 50 Ohms to 10kOhms.

Voltage across the transistors as the load resistance is swept

Observe that the transistor in the (B) variant acts like a saturated switch, with a fairly low voltage across it.

In the (A) variant, the transistor does not work in the saturated switching region, and the voltage drop on the transistor can be arbitrarily large. As the load current increases and the collector-emitter voltage grows, eventually these two parameters will get outside of the safe operating area (SOA) and the transistor will be destroyed.

To see this, let's plot the power dissipated in the transistor in each of the circuit variants, as the load resistance is swept from 50 Ohms to 10 kOhms:

Power dissipated by the transistors as the load resistance is swept

The transistor in the (A) circuit dissipates up to two orders of magnitude more power than in the (B) circuit. We can see this by plotting the ratio of the power dissipated by Q1 to power dissipated by Q2, as the resistance is swept:

Ratio of power dissipated by the transistors as the load resistance is swept


Is there a way to make the (A) circuit operate as a saturated switch? Sure, just use a transistor whose emitter can be connected to the fixed VCC potential: a PNP transistor.

schematic

simulate this circuit

Note that while the NPN transistor's control voltage is referenced to ground, the PNP transistor's control voltage is referenced to VCC. When the base of the PNP is at emitter potential VCC, the PNP is off, just as when the base of the NPN is at the emitter potential GND.

Both transistors drive similar currents into the loads across the entire range of load resistances:

The diode currents plotted as a function of load series resistance

They both also operate as saturated switches, with only a small saturation voltage present across the transistor:

Voltage across the transistors as the load resistance is swept


All the plots were generated using CircuitLab, and the DC Sweep simulation parameters are pre-entered, so you can re-run the simulations easily from each of the two circuits. You'll get all the plots I've shown above for their respective circuits.

\$\endgroup\$
3
\$\begingroup\$

Also, the order of the LED and resistor doesn't generally matter, but it is slightly safer to put the R at the top because if you short the junction to ground (e.g. with a DMM lead or a scope probe), you wouldn't burn out the LED.

\$\endgroup\$
3
\$\begingroup\$

The only reason it matters is that in schematic A you might have a hard time turning the transistor on all the way. In order to turn it on, you need to drive enough current into the base. In schematic A you won't be able to do that unless, for example, you are driving the base with a 5 V IO pin, and the collector is connected to 3.3 V. In that case it would be possible to put the NPN switch on top.

But usually the IO voltage and the high side voltage for the pullup or LED are the same. In that case, the NPN switch must be on the low side.

NOTE: when using a BJT like this (as a saturated switch) you always need a resistor in series with the base. You didn't show it in either of your schematics.

\$\endgroup\$
2
\$\begingroup\$

Yes, to turn on the transistor, you need to raise the base to a voltage high enough to get 10% of the current flowing into the base that you expect to flow at the collector. Remember, you'll need a resistor at the base on the right (better) version to limit current. You'll not need the base resistor on the A version because current is limited through the emitter but calculating current is not as easy as in version B where the emitter is tied to ground and the base voltage will be 0.6v and current into the base can easily calculated if powering it (through a resistor) from any given voltage.

\$\endgroup\$
2
\$\begingroup\$

Yes, it does matter because of voltage drops. The NPN transistor's drop is 0.2V, the LED's drop is ~1-2V depending on the current and the voltage drop is variable. Because of this if you want to control the current through the base, the base voltage will matter. So to make things easy, in most designs, it would be better to put the NPN on the bottom with the emitter connected to ground (configuration B). You will notice that in designs with configuration B, the NPN's emitter is (should be) grounded.

\$\endgroup\$
0
0
\$\begingroup\$

A good switch has the largest VBE. When you drive the transistor, the VCC of the previous block would most likely be defined already. The current the diode and resistor in A would potentially increase emitter voltage reducing the VBE to a value lesser than VCC which isn't the case for 'B' where you get VCC = VBE. If you ensure the BJT is conducting well, it would really not matter. But this is the reason why we can have PNP for A and NPN for B so that their VBE can be can be maximum of what you can give.

\$\endgroup\$
1
  • 2
    \$\begingroup\$ Welcome to EE.SE. This post is a bit garbled. A good switch will have a small \$ V_{ce}\$ when on. \$ V_{be }\$ will generally just be the BE forward voltage drop of about 0.6 to 0.7 V and not "the maximum of what you can give". Remember that you can Edit your post at any time to improve it. \$\endgroup\$
    – Transistor
    Apr 16 at 10:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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