Go Down

### Topic: What resistor value at the transistor base? (Read 7263 times)previous topic - next topic

#### NCC1966

##### Jul 06, 2016, 11:17 pm
I am going to use a 2N2222 transistor to light up an array of LEDs. I should hook no more than 15-20 LEDs in each transistor.

What's the correct the value of the resistor that goes between the transistor base and the Arduino pin?

Thanks!

#### larryd

#1
##### Jul 06, 2016, 11:19 pm
Draw a diagram showing what you are proposing.

.
No technical PMs.
If you need clarification, ask for help.

#### Southpark

#2
##### Jul 06, 2016, 11:46 pmLast Edit: Jul 07, 2016, 12:24 am by Southpark
I am going to use a 2N2222 transistor to light up an array of LEDs. I should hook no more than 15-20 LEDs in each transistor.

What's the correct the value of the resistor that goes between the transistor base and the Arduino pin?

Determine the DC voltage (Vemitter) that you are expecting at the emitter (for however many LEDS you plan to use, and knowing the operating current of the LEDs).

Then know decide on what voltage you're going to apply (on the source side of the base resistor)... eg, Vinput.

Look up the specs for 2N2222. If the continuous base current information says don't go over 20 mA (or whatever the value will be), then Vinput = Ibase*Rbase + 0.6 + Vemitter.

So Rbase = (Vinput - Vemitter - 0.6)/Ibase; where Ibase could be 20 mA.

#### Wawa

#3
##### Jul 07, 2016, 12:14 am
The question can't be answered correctly if the collector current is unknown.
Are these LEDs all going to be in parallel, or in series, or a combination of that.
In general, for small transistors like the 2N2222, the base current should be >= 1/20 of the collector current.
There is usually a saturation graph in the datasheet.
Leo..

#### MarkT

#4
##### Jul 07, 2016, 12:25 am
Assuming 20 LEDs each using 20mA, then that's 400mA load, so you want 20mA minimum for the base,
but the Arduino outputs are abs. max. of 40mA, so lets say 25mA base current, so at 5V logic supply
thats about 4.2/0.025 = 170 ohms or so, so 150 is the closest standard value (output pins have a few dozen
ohms internal resistance anyway, so 150 is better than 180).
[ I DO NOT respond to personal messages, I WILL delete them unread, use the forum please ]

#### Wawa

#5
##### Jul 07, 2016, 01:06 am
OP also mentions "in each transistor".
How many transistors.
At those base currents, you also have to watch total MCU current.
Leo..

#### Southpark

#6
##### Jul 07, 2016, 02:12 amLast Edit: Jul 07, 2016, 02:20 am by Southpark
OP also mentions "in each transistor".
How many transistors.
At those base currents, you also have to watch total MCU current.
Leo..
Not sure. Without enough output current capacity on each arduino output pin, probably better to just use 1 arduino output for 1 transistor.

#### Wawa

#7
##### Jul 07, 2016, 02:47 amLast Edit: Jul 07, 2016, 02:49 am by Wawa
Not what I meant.
"Array" was mentioned.
At 25mA per pin, you can only use 6 pins.
http://playground.arduino.cc/Main/ArduinoPinCurrentLimitations
Leo..

#### NCC1966

#8
##### Jul 07, 2016, 07:12 pmLast Edit: Jul 07, 2016, 07:29 pm by NCC1966
My simple diagram:

I found the following formula:

Rb = Vr x hfe / Ic

Ic - 0.2 (sum current of all leds)
Hfe - 40 (worst case scenario Ic = 500 mA, V = 10V)
Vr - 5 (Voltage across resistor)

Rb = 5 x 40 / 0.2 =  1K

Is this correct?

So if it would be 5 LEDs the resistor would be 2K; if it would be 20 LEDs resistor would be 500R and so on?

PS: It doesn't matter the voltage used to feed the LEDs (12V)? So, it could be 12V or 12000V?

#9
##### Jul 07, 2016, 07:45 pm
LED resistor: (Vs - Vf - Vce)/.02A = resistor, Vs = Vsource, Vf = forward voltage of LED, Vce = voltage drop across transistor collector to emitter, similar to a diode drop
Example (12V -2.5V - 0.7V) / .02A = 440 ohm

Base resistor: (Vs - Vbe)/.02A = resistor, Vs = Arduino voltage. Vbe = voltage across  base to emitter, similar to a  diode drop
Example (5V - 0.7V)/.02A = 215 ohm  20mA base current will turn it on pretty well.
N-Channel MOSFT would be better, will run much cooler than an NPN.
AOI514 from Digikey.com will work well. Logic level so Arduino can drive directly, very low Rds so it will have very little voltage drop across and stay cool, vs NPN where the 0.7V is fixed and power dissipated can rise a lot with current flow.
http://www.digikey.com/product-search/en?keywords=aoi514
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.

#10
##### Jul 07, 2016, 07:46 pm
12000V, would be hard to find a transistor that can switch that.
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.

#### NCC1966

#11
##### Jul 07, 2016, 08:29 pmLast Edit: Jul 07, 2016, 08:35 pm by NCC1966
I got it, thanks!!!!!

So Vbe and Vce is the dropped (dissipated) voltage and in the case of NPN transistors it is kind of a "constant" valuing 0.7 right?

Unfortunately I browsed the online stores where I am used to buy parts and they don't have the AOI514 so I will have to stay with the 2N2222.

I don't think it will be a problem though because probably the circuit won't stay on for time enough to get hot. It is going to be used for light a spaceship miniature so I will turn it on for only a few minutes while I show up for friends or for my own enjoyment. I think I will be safe!

Thanks again!

EDIT: I saw that you used .02A as for divisor of the formula for the base transistor. Should I increase this value depending on how many LEDs I am going to use? For instances, if are 10 LEDs so it would be 0.2 intead 0.02A?

#### Southpark

#12
##### Jul 07, 2016, 08:42 pmLast Edit: Jul 07, 2016, 08:42 pm by Southpark
So Vbe and Vce is the dropped (dissipated) voltage and in the case of NPN transistors it is kind of a "constant" valuing 0.7 right?
In your circuit, with the diode/resistor pairs on the collector side, Vbe will be approximately 0.6 Volt (or could assume 0.7 Volt too). Reason...... Ve is grounded at 0 V. The 0.6 V is Vbe(saturation) from manufacturing specs guide for the 2N2222. It's just minimum value assumption for Vbe..... assuming 0.7 V is fine too. It is linked to the 'diode' drop of the transistor's own 'pn junction'.

Vce is the voltage (Vc - Ve).

#### NCC1966

#13
##### Jul 07, 2016, 08:51 pm
In your circuit, with the diode/resistor pairs on the collector side, Vbe will be approximately 0.6 Volt (or could assume 0.7 Volt too). Reason...... Ve is grounded at 0 V. The 0.6 V is Vbe(saturation) from manufacturing specs guide for the 2N2222. It's just minimum value assumption for Vbe..... assuming 0.7 V is fine too. It is linked to the 'diode' drop of the transistor's own 'pn junction'.

Vce is the voltage (Vc - Ve).

What is Vc and Ve? Voltage-collector and Voltage-emitter?

#### Southpark

#14
##### Jul 07, 2016, 09:33 pmLast Edit: Jul 07, 2016, 09:49 pm by Southpark
What is Vc and Ve? Voltage-collector and Voltage-emitter?
Absolutely correct. If you have chosen current limiting resistors Rd for the diodes, then Vc can be found from the sum of voltages in the collector to emitter branch section......needs to sum to 12V.

12V = Ve + Vce + V_Rd + Vdiode

Vce is (Vc-Ve)

12 = Ve + (Vc-Ve) + V_Rd + Vdiode

Ve is grounded (0V) in this case. But the Ve in the above equation cancels with the -Ve anyway.

So 12 = Vc + V_Rd + Vdiode

So Vc = 12 - V_Rd - Vdiode

We usually know Vdiode. And we also usually know (by design) V_Rd, since we design the current through the diode (which also goes through Rd); V_Rd = I_diode * Rd.

Could also start from the collector..... with voltage Vc.

Vc + V_Rd + Vdiode must sum to 12 Volt.

So again, we get Vc = 12 - V_Rd - Vdiode

Go Up