2N2222 base resistor

Dummy question for you guys.

I'm switching a parallel array of 10 leds (3.2v, 20mA with each led ballasted with a 82R resistor) with a 2N2222 transistor. The led supply is 5V as is the base voltage (from an Arduino digital pin).

How do I calculate the value of base resistor will I need for the transistor? I've tried many methods suggested to me but always end up with a different value each time! The latest formula I used was RB = 0.2 x RL x hFE with values of 8.2R for RL and 300 for hFE. That gave me a value of 492R. Does that sound right? I have seen values of as high as 100K being used with this transistor, so have I used the right formula and values?

Any help gratefully received :slight_smile:

Bernie

Rb = Vr / ( Ic / hfe ) = Vr x hfe / Ic
where Ic is collector current or sum current of all your leds (200 mA)
hfe - 40, worst case scenario Ic = 500 mA, V = 10V
Vr - Voltage across resistor, V output - Vbe = 5 - 0.7 = 4.3

Rb = 4.3 x 40 / 0.2 = 860 Ohm

Many thanks Magician!

I can see now I was using the wrong hFE figure (amongst other things). I was using the figure of 300 as quoted in the catalogue, rather than 40 for the worst case scenario taken from the data sheet. That'll teach me :blush:.

Bernie

You are welcome. To get more accurate results, be aware that Vout isn't exactly 5V, as it also drop down when more current drain out from output, to 4.4 or even 4 V. So Vr = 3.7 / 3.3V instead of 4.3

I think its worth an extra safety factor to ensure the transistor is driven into full saturation - make the base current say twice the calculated value for worst-case hfe...

If a transistor is still on the borderline of linear region and saturation it's Vce could be higher and less predictable. A factor of two or so will probably cover the obscure effects you haven't allowed for like logic high drooping under load, lower than nominal 5V supply, hfe depending on Vce, or whatever.

Thanks again for the help people.

I think I'll take on board both your comments and start off with a 500R resistor. That'll give me base current around 7-8mA which should be ample. Besides, it just so happens I've got a whole load of 500R resistors lying around!!

Bernie

Are you sure 500R is an unusual value, a value of 510R is more standard.

I knew that!! :blush:

Slight shlip of the mind! Yes of course you're right I did mean 510R, my brain hasn't woken up in a while XD

Bernie

This link might help you Transistor Simulator And Calculator