Go Down

Topic: Driving Multiple LED's with a Transistor from 1 pin (Read 712 times) previous topic - next topic

M0Dark

Hi. I am looking to make a Nano flash several sets of LEDS in a sequence. I believe that the attached circuit should accomplish the switching of 1 set, with the switch shown being an Arduino Nano. They are actually 12 LED's and Resistors per channel but that isn't going to change anything other than the current draw from the 5v source when on, as far as I know. Each LED requires ~15mA and has a Vf of ~1.8 to 2.1 V.
I believe I can use an 2N2222 or S0850 Transistor to do the switching of the LED chain.

Please can someone with more knowledge confirm I am correct (or otherwise).

Many thanks for your help.

septillion


That will work.

Only the "Each LED requires ~15mA" is a bit sketchy. The led doesn't require a thing ;) It's what you set up to flow through it with the resistor. And a common led has a absolute max of 20mA. But 0,5mA through a led will work fine. 5V with a drop of 2V across the led gives (5V - 2V) / 150Ω = 20mA aka on the border of the led.

So 12 leds will draw 12 x 20mA = 240mA. Do note an Arduino cannot supply this on the 5V line if supplied via the barrel jack. And when powered from a computer it's on the border as well.
Use fricking code tags!!!!
I want x => I would like x, I need help => I would like help, Need fast => Go and pay someone to do the job...

NEW Library to make fading leds a piece of cake
https://github.com/septillion-git/FadeLed

M0Dark

Thanks for that.
Maybe I'll double (or Higher) the resistors in the LED bank.
Also it (the LED Bank) will be externally powered with a supply suitable for at least an amp.

DVDdoug

That looks like it should work.     You might need to lower the value of R9 to make sure the transistor saturates "hard".  And if the transistor gets hot you may need to add a heatsink or switch to a beefier T0-220 packaged transistor.



...I'd recommend you breadboard/prototype the circuit with one LED, then with one "set" of LEDs before building the whole thing.

allanhurst

#4
Apr 17, 2018, 05:56 pm Last Edit: Apr 17, 2018, 05:59 pm by allanhurst
Something like a BC337 may work better (1A rating) Use 150R as the drive resistor.

Or better still a logic level mosfet such as a IRLZ44N or FQP30N06L

Allan

M0Dark

Please forgive my ignorance, but why is a mosfet better than the transistor?

Also after brightness testing the yellow LEDs I found I could take them in series pairs with up to a 220 Ohm Resistor on each without becoming too dim for what I want.

This means that the power draw on the chain drops by a huge margin. So should help my Batteries last longer, correct?

Grumpy_Mike

Quote
but why is a mosfet better than the transistor?
Because you loose less power through it. A FET has a turn on resistance, that is when it is on there is a small resistance through it, normally a small fraction of an ohm.
A transistor has a turn on voltage, that is the voltage across the collector and the emitter, this in in the range 0.7 to 2V depending on the transistor.
When you work it out it means the FET can switch a lot more current without getting hot and eventually burning up.

Quote
So should help my Batteries last longer, correct?
Yes.

Go Up