Another beginner's question about RGB LEDs

I know there’s a lot of information on the site about connecting multiple LEDs to an Arduino, but after reading through I’m still confused. If anybody could explain it to me in really basic terms, that would be great!

I want to connect somewhere between 60 and 100 RGB LEDs to an Arduino, using PWM to control the colour and brightness. I don’t need to be able to control the LEDs individually - they will all be the same colour at the same time.

I’m confused about how to physically connect them up. Presumably I’ll need some sort circuit or chip to drive the LEDs (because there are so many of them and they will draw too much current) and some resistors? And three sets of them, one for each colour channel?

As you can probably see, I’m a complete beginner when it comes to the hardware side of things.

Thanks in advance for your help.

thats actually quite interesting, im fairly new myself, so please, for my own good - correct me if im wrong… but from what i knw, the arduino cant handle running that many rgb led’s…

hey guys,

The first step here is to get a single rgb led up and running. Create a proof of concept, ie colour and brightness should be perfectly working, then its just a matter of scaling everything up.

Report back when you’ve done that.

I am just starting a project where I will be incorporating 50 RGB LEDs. My plan is to use 3 MAX7221 LED drivers to control them. It will be a challenge cause I know people have tried to get 3 MAX7221s in the past and failed. Each MAX7221 can control upto 64 LEDs. My plan is to use one for each channel (R,G,B).

Unfortunately the MAX7221s don’t have PWM. Therefore I can really only get my RGB LEDs to a few colours. This is fine for my application but I don’t know about yours. If you do need the PWM you are going to need an multiplex IC - some sort of shift register or led driver, that also allows for PWM. One option is the TLC5940 chip. Each chip has 16 extra PWMs

I haven’t shilled recently, so I guess I should jump in here and recommend my own product, ShiftBrites. You can click on the flashy lights in my signature to see what they are.

Edit: I mean for individual controlled lights. To control a lot of lights at the same time, I have a different product waiting in the wings.

Presumably I’ll need some sort circuit or chip to drive the LEDs (because there are so many of them and they will draw too much current) and some resistors?

Each LED in the RGB LED needs its own resistor, so that’s three resistors per RGB LED. As the Arduino won’t power many you need a transistor for each colour. However your application means that instead of lighting just 1 LED per transistor you can put lots of LEDs and resistors in parallel in the transistor’s load.
As you only need 3 PWM outputs to define the colour and all LEDs are at the same colour then you have no need for any output expanders on the Arduino.

I want to connect somewhere between 60 and 100 RGB LEDs to an Arduino, using PWM to control the colour and brightness. I don’t need to be able to control the LEDs individually - they will all be the same colour at the same time.

Woops! did not see that! In your case Mike’s suggestion should work.

TIP-120 Power Darlington’s are popular with the Arduino crowd. They can get you 5A per color channel if you use 3 of them. That’s theoretically about 5A/.020A = 250 LED’s per color channel maximum. I’d imagine those transistors would get fairly hot, so heatsinks would be required.

I have some I bought from the guy at moderndevice.com, but I haven’t had a use for them yet. This is just coming from the data sheet, I bet someone else can give you more information.

How you drive them will greatly depend on what you have available for power supply options. 100 RGB LEDs is roughly like 300 of any other kind. If each one pulls 20mA, then you will need roughly 20 watts or more from your power supply for just the LEDs. Red LEDs usually require 2.0-2.2 volts each, blue and green are typically 3.4-3.7 volts each. Check the specs for yours to be sure.

Driving LEDs in series is the best way to assure uniform brightness. However 100 red LEDs would need over 200 volts, and the blue and green ones would need more than 360 volts! At the other end of the spectrum, driving them all in parallel requires the lowest voltage, but then you’re looking at about 6 amps of current and 300 resistors!

Somewhere in the middle would be best. :slight_smile: Here’s two (of many) possible ways to handle it.

20 sets of 5 LEDs in series per color. All 20 sets in each color are then connected in parallel. You’ll need a 24VDC/1.5A power supply (easy to find). Each set of 5 LEDs will need one resistor, for a total of 60 resistors. You’d need three TIP120s or IRF510s, plus the surrounding circuitry to control them.

10 sets of 10 LEDs in series per color. All 10 sets in each color are then connected in parallel. You’ll need a 40VDC/750mA (48VDC may be easier to find) power supply. Each set of 10 LEDs will need one resistor for a total of 30 resistors. The same TIP120s or IRF510s to control them. 48 volts is the highest you should go unless you know how to handle high voltage circuitry.

And I realize I only spoke to powering them. This doesn’t touch on how to control them from the Arduino. Part II maybe. :wink:

All good stuff from the posts above.

Just a point, I used RGB LEDs controlled through the PWM on my Arduinocaster and I found that the current requirements of each colour were vastly different. I ended up putting 220R in the red, 512R in the blue, and 910R in the green to get something close to a white when they were all on full.

Oh man, I know what you mean. I did a circle of eight different color LEDs on my desk fan and they all had different value resistors. It’s esp bad if you need them all the same brightness and/or not at full brightness. You really have to experiment with the resistor values sometimes.

Thanks for all your replies. There’s a lot to think about there! Sorry I’ve not been back to the thread sooner - I’ve been away for quite a while.

Somewhere in the middle would be best. Here’s two (of many) possible ways to handle it.

20 sets of 5 LEDs in series per color. All 20 sets in each color are then connected in parallel. You’ll need a 24VDC/1.5A power supply (easy to find). Each set of 5 LEDs will need one resistor, for a total of 60 resistors. You’d need three TIP120s or IRF510s, plus the surrounding circuitry to control them.

Thanks for that koyaanisqatsi. I think that first suggestion of 20 sets of 5 LEDs is the way I’ll go. Would I just be using three of the Arduino’s PWM outputs, one for each colour, each connected to a TIP120 or IRF510 (which I know nothing about yet!)?

Would you mind giving me some more details about how I’d connect this up?

Thanks again to everyone for your help.

Damn! I hate it when I do that. >:(

So after going back over the thread, I’ve discovered a serious flaw in my reasoning. You can’t run RGB LEDs in series because they have a common pin.

As was stated by dardude, Grumpy_Mike’s solution is the way you’re going to have to do this. You’ll need a lot of resistors and a 5v power supply that can handle a LOT of current.

What’s wrong with the 3x MAX7221 solution ?

You can set 16 brightness levels for the whole matrix (via software) and adjust color mixing with the external current set resistor (ISET).
This resistor might be replaced with a digital potentiometer ( http://www.arduino.cc/en/Tutorial/SPIDigitalPot ) for more options. ISET should be 9.53k or greater (40mA per LED).

This would spare you from having resistors for every single LED as the MAX provides a constant current.