Pages: [1]   Go Down
Author Topic: 2N2222 base resistor  (Read 4221 times)
0 Members and 1 Guest are viewing this topic.
Gloucestershire, UK
Offline Offline
Full Member
***
Karma: 1
Posts: 107
Outta Steam
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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  smiley

Bernie
Logged

Montreal
Offline Offline
Faraday Member
**
Karma: 27
Posts: 2566
Per aspera ad astra.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Gloucestershire, UK
Offline Offline
Full Member
***
Karma: 1
Posts: 107
Outta Steam
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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  smiley-red.

Bernie
Logged

Montreal
Offline Offline
Faraday Member
**
Karma: 27
Posts: 2566
Per aspera ad astra.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

0
Offline Offline
Shannon Member
****
Karma: 200
Posts: 11694
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

[ I won't respond to messages, use the forum please ]

Gloucestershire, UK
Offline Offline
Full Member
***
Karma: 1
Posts: 107
Outta Steam
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 602
Posts: 33371
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Gloucestershire, UK
Offline Offline
Full Member
***
Karma: 1
Posts: 107
Outta Steam
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I knew that!!  smiley-red

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

Bernie
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 34
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This link might help you http://www.csgnetwork.com/transistorcalc.html
Logged

Pages: [1]   Go Up
Jump to: