Go Down

### Topic: Help with transistor and resistor selection for LED array (Read 2500 times)previous topic - next topic

#### ohiggins

##### May 09, 2013, 02:23 pm
Hi All,

1/ How awesome is Arduino! After very little electronics but lots of programming for 10 years I have just come back and the power of this tool is amazing..

Anyhow, my theory is a bit off. I was wondering if any body could help me make a decision here. I am building a shift light for my motorbike and i need the LEDs to be quite bright and noticeable in the sun.

The LEDS I was going to use are LED1-4 (R1-R4 is 510ohm);

IF Typical (mA)   20
VF Typical (V)   2.1
IV Typical (mcd)   10000
IF Max Continuous (mA) 50

I am not sure on what to use for T1, i was thinking the BC337, but I can't seem to figure out what I would need for R5.

Any ideas or even other suggestions would be welcomed.

Cheers
Oliver

#### Grumpy_Mike

#1
##### May 09, 2013, 02:43 pm
The LED current will be:-
voltage across resistor 12 - 2.1 = 9.9V
510R resistor will cause 9.9 / 512 = 19.33mA to flow.

So the transistor has to take 4 * 19.33 = 77.3mA
Assuming a transistor gain of 20 means 3.86mA needs to flow through the base.
Therefore R5 needs to be
5 - 0.7 = 4.3 / 3.86 = 1K
If the real gain of the transistor is greater than 20 then it doesn't matter because the transistor will still be saturated.

#### fungus

#2
##### May 09, 2013, 02:56 pm
R5 is there for two reasons:

a) Stop more than 40mA from coming out of the Arduino pin.
b) Allow enough current to saturate the transistor.

For (a), any value from 150 ohms and upwards will do.

For (b) ... a BC337 will multiply the current going through the base by about 50. You need 200mA so you need to allow more than 4mA through. For this, R5 needs to be less than about 1K.

Me? I'd use a 470 Ohm resistor, although 220, 330, 680, etc. will work just as well.

PS: http://www.mcmanis.com/chuck/robotics/tutorial/h-bridge/bjt_theory.html
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

#### ohiggins

#3
##### May 09, 2013, 02:57 pm

The LED current will be:-
voltage across resistor 12 - 2.1 = 9.9V
510R resistor will cause 9.9 / 512 = 19.33mA to flow.

So the transistor has to take 4 * 19.33 = 77.3mA
Assuming a transistor gain of 20 means 3.86mA needs to flow through the base.
Therefore R5 needs to be
5 - 0.7 = 4.3 / 3.86 = 1K
If the real gain of the transistor is greater than 20 then it doesn't matter because the transistor will still be saturated.

Thank you so much for the quick reply. I appreciate your help.

So, for the sake of the argument if i used 240 ohm on the resistors it would be

9.9/240 =41.25ma

4 * 41.25 = 165ma

41.25/20 for the gain = 2.0625

5-0.7 =4.3 /2.0625 = 2.08k (2k or 2k2)?

#### ohiggins

#4
##### May 09, 2013, 02:59 pm

R5 is there for two reasons:

a) Stop more than 40mA from coming out of the Arduino pin.
b) Allow enough current to saturate the transistor.

For (a), any value from 150 ohms and upwards will do.

For (b) ... a BC337 will multiply the current going through the base by about 50. You need 200mA so you need to allow more than 4mA through. For this, R5 needs to be less than about 1K.

Me? I'd use a 470 Ohm resistor, although 220, 330, 680, etc. will work just as well.

PS: http://www.mcmanis.com/chuck/robotics/tutorial/h-bridge/bjt_theory.html

Thank you for that. That also makes sense. and the above equations should match given the gain of 20 is assumed instead of the 50. Thankyou!

#### fungus

#5
##### May 09, 2013, 03:08 pm

...given the gain of 20 is assumed instead of the 50.

Gain depends on voltages, currents, etc. 20 is quite conservative.

Thankyou!

Karma points are given via the little green '+' over on the left.
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

#### ohiggins

#6
##### May 09, 2013, 03:15 pm

...given the gain of 20 is assumed instead of the 50.

Gain depends on voltages, currents, etc. 20 is quite conservative.

Thankyou!

Karma points are given via the little green '+' over on the left.

Will do, i think i need to make a couple more posts Thanks again

#7

#### mixania

#8
##### May 09, 2013, 04:00 pm
http://ledcalculator.net/

#### ohiggins

#9
##### May 09, 2013, 09:55 pm

http://ledcalculator.net/

Ooo thanks for that it is interesting, it gives me a series configuration instead of a parallel one...

#10
##### May 09, 2013, 10:13 pm
If you put 50mA thru your LEDs they will die an early death.
I would design for 20mA max:
IF Typical (mA)   20

Read their datasheet - you may find that at elevated currents their  lifespan is degraded because they will be running hot.
If you have 12V source, then put 4 in series instead, maube even 5 if you are using that many.
Resistor will be (12V - 0.7 - 4 x (2.1V)/20mA =  145, 150 ohm.
Vce of the transistor may also be lower, from 0.7V maybe as low as 0.3V.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

#### fungus

#11
##### May 09, 2013, 10:18 pm

If you put 50mA thru your LEDs they will die an early death.

Not if they're 50mA LEDs.

(which was the way I read it...)
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

#12
##### May 09, 2013, 10:24 pm
IF Typical (mA)   20
IF Max Continuous (mA) 50

Max Continuous does not read as bieng a 50mA LED to me.  No more than 40mA Max per Arduino pin reads as normal operation.
Vf usually changes at the higher current flow too.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up

Please enter a valid email to subscribe