-1
\$\begingroup\$

I'm using the transistor (NPN bjt 2N4401) as a switch to light up 20 leds (leds use 2v 20mA) (my power source is 6V).

How to calculate the base resistor? enter image description here

\$\endgroup\$
  • 4
    \$\begingroup\$ Can you compute the required collector current? \$\endgroup\$ – jonk Nov 21 '17 at 21:54
  • 3
    \$\begingroup\$ Can you look up the range of beta at said current in the datasheet? \$\endgroup\$ – winny Nov 21 '17 at 21:59
  • 3
    \$\begingroup\$ I still cant get past 6V and TTL..... \$\endgroup\$ – Trevor_G Nov 21 '17 at 22:01
3
\$\begingroup\$

20 LEDs times 20 mA each is 400 mA collector current.

Divide that by the current gain to get the minimum required base current. This transistor is specified to have a minimum gain of 100 at 150 mA, and 40 at 500 mA. We will have to go with the 40 value.

(400 mA)/40 = 10 mA, which is the minimum required base current to sustain the required collector current.

Now find the voltage across the base resistor. You say one end will be driven to 6 V. The other end will be the B-E drop above ground, let's say 750 mV. That leaves 5.25 V across the resistor.

By Ohm's law (5.25 V)/(10 mA) = 525 Ω. However, that results in the absolute minimum required base current. I'd use a 470 Ω resistor at least to get some margin.

Now use the above method to work backwards and see what the base current will be, then check that the digital output can support that. If not, you need a different topology with more gain.

In this case, I'd use a small N-channel FET that can be turned on fully with regular logic level voltages, like the IRLML2502. You drive its gate directly from the digital output without a resistor, it's source to ground, and its drain to the bottom ends of the LED strings.

\$\endgroup\$

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.