# Calculating base resistors of a NPN driving a LED

I am a beginner in circuit analysis. I have a simple circuit and I want to get the right value of R1 & R2 resistance, to turn on the LED on collector of BC547. I need 20mA to turn on the LED and want 3.3V on base of BC547 transistor.

I tried to get the value of R1, R2 but the result is not correct.

## My steps:

         5-IR1-IR2=0
5-IR1-3.3=0
1.7-IR1=0


[IR1=1.7v]

         IC=β*IB
20m=110IB
IB=0.181mA


to get approximate value of IB. I do it 5 times.

         IB=0.181*5=0.9mA


and I put the final value of IB in [IR1=1.7v]

So, the next:

         0.9m*R1=1.7v
R1=1.8k


and go back to the first equation: 5-IR1-IR2=0 and add the value of R1 to get the R2 value.

         5-0.9m*1.8k-0.9*R2=0
5-1.62-0.9m*R2=0
R2=3.75k


This my analysis for the circuit, but I simulate it on Circuit Simulation Program like Multisim the result not match. I need help to know the wrong thing that I did.

• If you put 3.3V on the base, you'll destroy the transistor.
– user16324
Commented Sep 1, 2017 at 21:06
• Do you have two supply voltages 3.3 and 5V? why 3.3? Commented Sep 1, 2017 at 21:26
• I put it as a preliminary value to start my steps. Commented Sep 1, 2017 at 21:29
• By the way, you don't "need 20mA" to turn on the LED. That may be the maximum current allowable in the datasheet. Modern LEDs emit light with uA flowing and often 1mA or 2mA is plenty for an indicator LED. There are too many products with blindingly bright indicators. Commented Sep 1, 2017 at 22:25

You don't want 3.3V on the base of the transistor, because that would utterly destroy the BE junction, which behaves like a diode: its V/I graph rises very sharply at ~0.6V.

I'm not sure what you want R2 for, R1 can supply the base current to turn the transistor on.

Let's assume 2V for the LED + T1, so 3V for R1. That gives 3/220 ~= 14 mA. Assume a modest B of 100, so you need 0.14 mA base current. Assuming 0.6V Vbe and no R2 that means R1 = (5-0.6)/0.14e-3 ~= 31k. If you want full saturation you can use a B of mabye 20, for an R1 of ~6k.

• But what does that mean "2V for the LED + T1, so 3V for D1" Commented Sep 1, 2017 at 22:01
• @AmmarAmer: I think "3V for D1" should be "3V for R3". He's allowing 2 volts for the LED and a saturated transistor, leaving 3 volts for R3. Commented Sep 1, 2017 at 22:56
• correct, I'll chane the text Commented Sep 2, 2017 at 6:59

hFE or $\beta$ is very nonlinear dependant on Vbe and Vce. When operating as a "switch" , hFE is reduced to almost 10% of max , so we tend to use Ic/Ic = 10 to 20 to make it work reliably. The spec is called Vce(sat)@ Ic (rated) and is a result of the internal rCE of the transistor chip size.

Therefore only use a series R from 3.3V out to Vbe= 0.65~0.7V (typ) to compute Ib = 10% to 5% of Ic.

e.g. 2.6V/2mA= R series from 3.3V = 1.3kohm

Ic = 20mA. You choose VBE(on) value from the datasheet.

VBE = VB - VE. You already know VBE value, VE = IE x RE which is equal to 0 since there is no resistor.

Voltage across R2 is equal to VB and voltage across R1 is equal to VCC - VB.

Here, you get that VR1 / VR2 = R1 / R2 and give the values.