1
\$\begingroup\$

I am quite new to electronics. I am trying to control three LEDs with an Arduino using a transistor.

I was wondering what the base current limiting resistor value should be.

I looked around the internet and some YouTube videos and came up with these calculations, but I don't know if I am correct or not.

I am using a 2N2222 NPN transistor and I am taking 100 as GAIN (B).I came up with 1.4K. Am I right or am I missing something?

LED Resistors are 220Ohm

enter image description here

\$\endgroup\$
0

2 Answers 2

1
\$\begingroup\$

Actually, with \$\beta\$ = 100 you would end up with an \$I_B\$ of 0.3 mA (not 3 mA).

BUT as you want to switch the NPN fully on, it is actually a good choice to assume a much lower \$\beta\$, like \$\beta\$ = 10 like you did (by mistake).

Why?

Because you want the NPN to operate in saturation (not active mode). So you do end up with a correct answer. Any value for R between 1 kohm and 5 kohm would be correct in my view.

\$\endgroup\$
3
  • \$\begingroup\$ Thank you for the correction. How can i tell what is correct current Gain? I assume it's 100 so according to it (if i re calculate it) i get 14k base resistor and this doesn't seem right as most guys on youtube and web are using lesser then this. \$\endgroup\$
    – usmandroid
    Dec 10, 2021 at 11:38
  • \$\begingroup\$ got it."you should choose beta as worst case value to calculate necessary Base current." -great scott \$\endgroup\$
    – usmandroid
    Dec 10, 2021 at 11:46
  • \$\begingroup\$ you should choose beta as worst case value to calculate necessary Base current. Yes if you would want the transistor to operate in active mode, for instance, in an audio amplifier. No if you want the transistor to operate in saturation mode, which is the mode of operation when you want to use it as a switch. In that case you start with the lowest \$\beta\$, for example 50, calculate \$I_B\$ and then use 2x or 5x that value. So for saturation mode, assume \$\beta\$ = 10 to 20 (if smallest \$\beta\$ is 50). \$\endgroup\$ Dec 10, 2021 at 13:45
2
\$\begingroup\$

Yes and no.

If you take gain to be 100, then I base should be 0.0003A or .3mA or 300 ųA. You divided by a gain of 10 and got 3mA.

Your resistor calculation is correct based on that incorrect I base calculation.

But the thing is, if you are using a transistor as a switch in saturation, you want to make sure it's in saturation, so overdrive the base is better. So providing 3mA is better than providing 0.3mA.

If current draw is a concern, you could reduce that to 1 mA or so and still be in saturation.

\$\endgroup\$
3
  • \$\begingroup\$ Yes sir my bad. Thank you for your answer. How can I tell what is current Gain ? I assumed it's 100 but mistakenly I did calculations according to gain=10. If id do with gain=100 i get 14k base resistance and this doesn't seem right as all tutorial on youtube and web aren't using this high value \$\endgroup\$
    – usmandroid
    Dec 10, 2021 at 11:36
  • \$\begingroup\$ okay i got it. "you should choose beta as wrost case value to calculate necessary Base current." -great scott \$\endgroup\$
    – usmandroid
    Dec 10, 2021 at 11:46
  • \$\begingroup\$ @usmandroid yes, in your use case, you chose beta or Hfe gain as generously low. Doesn't have to be worst case. But if you look at the datasheet for the 2n2222 it should have multiple stats for gain based on current and voltage, and probably a graph/chart too. The actual gain and the saturation will vary. It's a bit of a black magic science. \$\endgroup\$
    – Passerby
    Dec 10, 2021 at 12:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.