# Resistor placement in transistor and LED circuit

I want to know which layout is the most correct and why. Using different placement of the resistor and transistor, how will it affect the circuit?

1. Why does the placement of the resistor on the collector or on the emitter matter?
2. Why is the placement of the resistor before or after the LED and on the collector side of the transistor better?
3. Without the resistor on the base side of the transistor, what are the consequences?

The transistor is a bipolar (BJT) transistor array with two NPN transistors (dual.)

• Designs B and C should use a separate base resistor for each transistor. Commented Nov 28, 2022 at 17:21
• Unless you explain why, you have helped no one. Commented Dec 3, 2022 at 21:48

The A schematic is has the transistors configured as constant current sources.

The B and C schematics are electrically the same and use the transistors as saturating switches.

You'll select between A and B/C depending on what behavior you want. It makes sense to drive the LEDs using constant current, so schematic A would be preferred - but the emitter resistors will not be the same values as you'd use for the more typical collector resistor (B/C) setup.

The microcontroller logic output is about 3V, the VBE is about 0.65V, so the voltage across the emitter resistor will be about 2.4V. Select the resistance to give you the current you want at that voltage. Note that the 12V doesn't figure into this - as long as the LED supply voltage is high enough, the circuit will act as a current source.

For example, to drive the LEDs with 30mA, you'd want 2.4V/30mA≈80Ω emitter resistors. The emitter resistors will be dissipating 2.4V×30mA≈70mW. The transistor will be dissipating about (12V-2×Vled-2.4V)×30mA≈(9.6V-2×1V)×30mA≈1/4W. This should be acceptable for most through-hole transistor packages. You can always add a series collector series resistor to take over some of the dissipation from the transistor, but that will raise the minimum operating voltage for the LEDs. Without the collector resistor, the LEDs will be operating at constant current from 5-6V upwards.

Why is the placement of the resistor before or after the led and on the collector side of the transistor better?

It makes no difference.

Why does the placement of the resistor on the collector or on the emitter matter?

If you place the resistor in the emitter, you can fairly reliably control the current through the LEDs by altering the base voltage (largely irrespective of the collector-side supply voltage variations). This may or may not be important to you. The down-side is that the transistor dissipates power to control current. Again, this may or may not be important to you.

If you place the resistor in series with the LED in the collector, then LED current is determined by collector-side supply voltage, LED(s) forward voltage and, the value of the resistor although, you do have some limited control at the base (providing you use a series base resistor). The transistor will not dissipate much power because it is either "on" or "off".

Without the resistor on the base side of the transistor, what are the consequences?

None for schematic A and problems for schematic B and C. The problems will be that the base-emitter junction acts like a forward biased diode and so, without a resistor, the circuit that drives the base will be clamped to less than 1 volt and, may feed excessive current into the base and damage something.

Always use a series base resistor for each transistor if needed.

• Using resistors between the 12V supply and the LEDs (schematic B) will facilitate using a bussed resistor network, which is useful for multiple LED strings. Schematic A or C would be used for LEDs with a common anode and multiple cathodes, like an RGB LED or a seven segment display. Commented Nov 28, 2022 at 19:42

With circuit A the resistors are in the input path, meaning that the current through them will raise the voltage at the transistor emitters, and the input voltage will need to be higher than that plus $$\V_{be}\$$. This can be used to make a relatively constant current drive for the LEDs.

Say your micro has an I/O output voltage of 3.3 V, subtract 0.7 V for $$\V_{be}\$$ and you have 2.6 V at the emitter, from this you can figure the resistance you need for the LED current you want. Let's say this is 20 mA, that gives you: $$\frac{2.6V}{20mA} = 130\Omega$$

With this as the emitter resistor the LED current will be 20 mA largely regardless of the LED supply voltage and voltage drops of the LEDs. You can even put more LEDs in the string as long as the LED supply voltage is high enough to handle the extra voltage drop. In this circuit you don't necessarily need a base resistor as the emitter resistor will limit base current. In this example base current would be $$I_e \times (1-\alpha)$$ So for a transistor with a reasonable high $$\h_{FE}\$$ around 200 uA.

Circuits B and C are virtually equivalent, it doesn't matter which order the LEDs and resistors are in. In a series circuit order doesn't matter. In a parallel circuit order doesn't matter. It's only when you have series-parallel circuits that order starts to matter.

In these circuits the transistor will be acting as a switch, and you will need a base resistor to limit the base current. The LED current is going to be the LED supply voltage minus the LED voltage drops and $$\V_{CEsat}\$$ divided by the resistance, so supply voltage and the LED voltages will affect the current much more than in circuit A. Adding another LED in series would require recalculating for a different resistor value.

Why does the placement of the resistor on the collector or on the emitter matter?

The placement of the resistor at collector or emitter matters because in order to turn on the transistor the base has to be ~0.7V higher potential than the emitter. So using Schematic A as the example, here your output from the Micro will be about 3V, and that means the voltage at the top-end of your emitter resistor will be ~2.3V. This leaves around 9.7V to be distributed across your two LEDs and the transistor itself.

2.

Why is the placement of the resistor before or after the led and on the collector side of the transistor better?

I don't believe there is any (significant) consequence to placing the resistor before or after the LEDs in the collector. The steady-state result is the same.

3.

Without the resistor on the base side of the transistor, what are the consequences?

You should use a base resistor. This is to limit the base current and to control the base voltage. With this setup your base resistor ensures that the voltage at the base of the transistor itself is ~0.7V, whilst the emitter is tied to 0V. The resistors for the LEDs are in the collector, so that when the transistor is on they act as current-limiting resistors for the LEDs.

• Approach A will work fine although it is unusual. The transistors will act as constant current sources. The current will be defined by the logic supply voltage (- a vibe drop) and the emitter resistor value. The LED brightness will not depend upon the 12v rail voltage. Any voltage not required by the LEDs will appear across the transistor. Commented Nov 28, 2022 at 17:20
• @KevinWhite yes agreed, I will edit the answer to reflect this reality.
– Q''
Commented Nov 28, 2022 at 17:29

The best one is A because it ensures that the LEDs get all the same current.

B and C are identical and both can be bad. Depending on the value of R3, if the transistors are not saturated, due to small differences in the Vbe of the transistors, the current through Q1 will be different from the current through Q2. And differential temperature in the two transistor will make it worse.

A.

Pro- in each string current is fairly constant at (Vin - Vbe)/R.

Con - transistors will dissipate more power, and they are both in one package so heating could be significant

Con - uses about 3V of your headroom with 3.3V drive, so if the LED Vfs add up to more than 9V LED current may drop

B.

Okay, but use separate base resistors- the transistors are not necessarily matched

Pro - transistors saturate, so they should run cool if properly designed

Pro - if voltage across the LEDs is not too high relative to 12V current is well enough controlled

Pro - if either wire to LEDs is shorted to ground no parts are destroyed (assuming short circuit protected PSU).

Con - none

C.

Okay, but use separate base resistors- the transistors are not necessarily matched

Pro - transistors saturate, so they should run cool if properly designed

Pro - if voltage across the LEDs is not too high relative to 12V current is well enough controlled

Con - if the wire from the LED is shorted to ground the LEDs may be destroyed.

There's no particular advantage to driving the two strings independently in B and C since the transistor is either on or off, so you might want to consider replacing the dual transistor with an adequately rated single BJT or MOSFET and saving cost, PCB space and component count.

• Do you think that Schematic A is sensitive to resistor values, enough to be considered a con? Commented Nov 29, 2022 at 14:47
• @Smith All three circuits have current that is inversely proportional to the resistor values. A has a small negative tempco of less that 0.1%/°C due to the transistors. B and C have a tempco that depends on the LEDs and what voltage is left across the resistors, so they could be worse, depending. For visual perception, neither is likely all that important unless the LEDs add up to too much voltage. Commented Nov 29, 2022 at 14:54

Schematics B and C are electrically equivilent. The transistors are used as switches (assuming the base resistor is low enough), and the current in the LEDs is determined mainly by the value of the resistors, the "12V" supply voltage and the voltage drop of the LEDs.

Schematic A is rather different, the resistor and transistor form a voltage controlled current sink. The current in the LEDs is determined mainly by the value of the resistor and the logic voltage fed into the transistor.

The nice thing about Schematic A is it decouples the current from the supply voltage and the forward voltage of the LEDs. That is really handy if your "12v" supply is unregulated or if you have a mix of different color LEDs. It does have a couple of downsides though.

Firstly if the forward voltage across the LEDs gets too high, or the LEDs go open circuit, then current will flow through the base of the transistor instead of the LEDs. This means regulation of the LED current will be lost and an undesirable current may be drawn from the microcontroller pin. To mitigate this I recommend using a voltage divider between the microcontroller pin and the base of the transistor.

Secondly most of the wasted power is dissipated in the transistor rather than the resistor. You need to make sure the transistor can cope with this. It's probably not an issue with a 12V supply and the 20mA or so that normal indicator LEDs use but it's worth bearing in mind if you are running higher voltages or curents.

As the transistor starts conducting, the voltage raises in its current limiting resistor.

The placement of the resistor on the "collector or emitter" matters because when the resistor is in the emitter chain, the current flow between base and emitter (that opens the transistor) is driven down to very small values by the voltage that falls on this resistor. In other words, the system has the strong negative feedback, amplifying current but not voltage. It cannot be more voltage across the resistor that it is on the base, otherwise the current will not flow from the base to the emitter so the transistor will stop conducting.

Hence this design has very high input impedance. If the resistor is in the collector chain instead, voltage on it does not limit the current from base to emitter significantly. This is why we need a current limiting resistor there, otherwise the base-emitter current can exceed that is permitted for the transistor. This design can amplify both current and voltage and is generally preferred, unless very high input impedance is required.

If LED and resistor are connected sequentially with nothing connected at the point between them, it should not matter in which order.