Go Down

Topic: Controlling 50+ RGB LEDS using Arduino (Read 4173 times) previous topic - next topic


Nov 11, 2012, 10:32 pm Last Edit: Nov 11, 2012, 10:50 pm by Freumar Reason: 1
Alright so I've finally gotten all my parts to build my own RGB LED Strip. I am using the following schematic:

Only I am extending it for 50+. I have:

12v / 6A DC Power Supply
50 RGB LEDs (Datasheet - http://www.noodlehed.com/ebay/datasheets/HH-1000CRGBW810.pdf)
470 and 510 1/2 Watt Resistors
3 NPN Transistors (Datasheet - http://www.datasheetcatalog.org/datasheet/kec/MJE13005.pdf)

When I wire it all up, the RGB LED is so dim you can barely see it lit. I've got each color connected to Pins 4, 8 and 12 into the Base, the light wired up to the collector and the emitter to the ground.If I remove the transistors and directly connect the light to just the power supply, the light works perfectly and is as bright as can be, leading me to believe I'm not understanding something about these transistors and how to control them using the Arduino. To turn them on I am just using digitalWrite(pin, HIGH).

Also I do not have an base resistors for the transistors, I'm not sure if that could affect it. If I need the, can anyone tell me how to calculate the resistance required??

If anyone can explain to me why my LEDs are barely turning on that would be so helpful. I'm so close to being finished and this is all that's keeping me from it :(

To elaborate since I forgot a little bit...I am just testing this with one LED currently. When that one LED is powered using my power supply, it is dim. When powered using the USB from the Arduino it is slightly brighter but not fully lit. This is confusing because shouldn't it be brighter with the higher voltage and current the power supply gives??

If any more information is needed please just ask and I'll be happy to answer!!


Are you running them from the 12V supply or from some unspecified 7.2 to 9V supply?  That number is needed for calculating the current limiting resistors.

At 20 mA each * 50 LEDs you'll need 1A per color so 3A total.  Or were you planning on running them closer to their absolute maximum rating: 50 mA.

The base resistors protect the Arduino from having too much current drawn.  At 5V you want a resistor greater than 125 ohms so 200 is a good choice.
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp


I am using the 12v 6A external power supply to power the LED. And yes, I calculated that 3A will be needed for 50 so I bought the 6A power supply. And for the base resistor, if it's 200 ohms at 5v, what would it be at the 12v??

I am only doing this with one LED so far so this is why it's confusing me why the light it dim. I could understand if my power supply wasn't strong enough for all 50 or the arduino couldn't power all them...but I've only tested this with one LED so far. The LED is not broken so it should be full strength like it is when I directly connect it to the power supply without the transistors =/

Just remembered too which could be useful. When the arduino is powered with a 9v battery the LED doesn't even turn on, but when powered through USB it's brighter, but still pretty dim. I know the USB supplies more current, but with only one LED this shouldn't make a difference =/


There is another problem here,  the specs for the transistor you are using say that the gain ( basically collector current to base current ) can be as low as 19.

You want the transistor to switch hard on.

This means that to switch 1 amp it would need a base current of 52 mA, which is too much for the Arduino .

I would rather use a power mosfet which needs virtually no gate current, and acts as a less than 1 ohm resistor when on.

As to the illogical symptoms your test setup is displaying, are you sure you have the transistor wired correctly ?  the base is on the left when you look at the writing side , with the legs downwards.


Nov 12, 2012, 03:05 am Last Edit: Nov 12, 2012, 03:08 am by Freumar Reason: 1
Yes, I'm sure I have it wired correctly, it's confusing the hell out of me too haha What you're saying makes sense that not enough current is being supplied to the transistor to turn it on. What is a MOSFET transistor? Does it work exactly the same way: base, collector, emitter...when base is supplied current it switches on? Would it be possible to use 6 of those transistors in total to make 3 Darlington pairs?? I'm new to using transistors so if any basic explanations could be given that would help so much.

I really appreciate the explanation regarding my transistors, very helpful in understanding them!!

Also if I do go for the MOSFET, what specs should I look for in handling 12V 6A? I'm assuming I'd need pretty good ones right?


I would go for a BUZ11 ( or equivalent ) , its way overkill, but was commonly used in TVs so should be available. It will stand 50 volts and pass 33 Amps !

An FET is like a voltage operated switch,   but has drain, gate, and source  in place of collector base and emitter.

You can Google it for the explanation.

Basically when you apply more than about 3 volts to the gate , the thing switches on and becomes a virtual short circuit  ( 0.03 ohm ) between the drain and the source.

You wont need a heat sink, it wont get warm.

It is normal to put a 100 ohm or so resistor in series with the gate, ( Google it, its for protection of the gate ) but will work without it as there is basically no gate current drawn.

The pin connections are the same as the transistor you are using, so you can just swap it.


Nov 12, 2012, 04:47 am Last Edit: Nov 12, 2012, 05:19 am by Freumar Reason: 1
Wow thank you so much for your help! Last question now is which MOSFET to buy. I would definitely go with the BUZ11 but I can't find any that would arrive here before November 28th :( I found similar ones and I'm wondering which would be best for allowing the Arduino to control the switching. I only need a max of 6A because thats the max of the power supply, so here are a few I found that could get here by Friday!!

http://www.irf.com/product-info/datasheets/data/irf630n.pdf (The NL model)

And out of those, will they work the same? Like supply 3v and it will switch?

Also, will MOSFET transistors allow me control PWM? I want to be able to fade between colors and control the brightness of each. Is this possible at all with any setup?? For example, analogWrite(led, 0) for off, analogWrite(led, 255) for on and analogWrite(led, 122) for half? This will allow color mixing and allow me to fade between colors and brightnesses!!

Thank you again for the help, it's been really useful in my understanding!!


Just remembered too which could be useful. When the arduino is powered with a 9v battery the LED doesn't even turn on, but when powered through USB it's brighter, but still pretty dim. I know the USB supplies more current, but with only one LED this shouldn't make a difference =/

Could it be that the Arduino ground is not connected to the LED ground?  Without that connection it would be hard for the Arduino to get any current to the transistor.
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp


I have the Arduino's Digital Output pins to the Base, the Power Supply's positive lead to the Anode of the LED and resistors in parallel to the RGB pins of the LED to the Collector then the Emitter is connected to the ground of the power supply. Do I need to connect anything else from the Arduino to the power supply? Should I connect the Emitter to both the Power Supply Ground and the Arduino Ground?? Or maybe just the Arduino ground? Won't this not allow a current through the circuit from the power supply?


Should I connect the Emitter to both the Power Supply Ground and the Arduino Ground??

YES!  The Arduino can't supply Base-Emitter current unless the Emitter is connected to the Arduino Ground and the power supply can'y supply Collector-Emitter current unless the Emitter is connected to the power supply ground.  Don't worry about connecting the grounds together.
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp


Hahaha oh wow...That sound pretty basic that I missed...I am trying this right away and letting you know if that works!!


It works perfectly now with one LED!! Thanks for diagnosing that really simple mistake, you saved me so much frustration!! And I'm still interested in the MOSFET transistors. When I reach higher currents, the transistors I have will need a bigger current to switch on than the Arduino can supply correct? Is it still worthwhile to switch over to MOSFETs? They seem to be exactly what I'm looking for to do the switching! If so, which of those 3 seem to be the best-fit or is there another one that is recommended other than the BUZ11??


Nov 12, 2012, 09:28 am Last Edit: Nov 12, 2012, 10:07 am by Boffin1 Reason: 1
The last one has typical 3v threshold voltage, the first 2 look like 4 v  so I would go for the last one.

Sorry I missed the grounds :-)  

Check AWOLs signature !


When I reach higher currents, the transistors I have will need a bigger current to switch on than the Arduino can supply correct?

Even with less, the Arduino probably shouldn't be supplying the current...

Is it still worthwhile to switch over to MOSFETs?

Is it working? No need to switch...
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)


Nov 12, 2012, 05:40 pm Last Edit: Nov 12, 2012, 05:41 pm by CrossRoads Reason: 1
When you get up to 3A , the MOSFETs will be a better way to go.
Where are you located?
I usually use digikey's search filter to find one.
What you want is:
- N-channel mosfet
- in stock
- logic level
- thru hole
then sort by cost
browse the resulting list, getting past the 1000 and 2000 qty prices,  looking for Low Rds (down in the 10's of milliohms) and low Gate Capacitance (for fast switching) with the needed power handling and package style that's comfortable to work with.

For example:

If you can't order from digikey where you are, then look for those kinds of parameters in the parts from the source you can order from.
It needs to be Logic Level so the MOSFET turns on full with 4.5-5V.  Otherwise, you will need some buffering in front of the MOSFET, the output of that buffer will need to able to go to 10-12V to turn a Standard MOSFET full on.
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

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131