Common cathode leds in serie and parallel

Hi,

First of all, I'm new to electronics and I want to use Arduino for a project. I want to use Arduino to control 99 RGB leds. I want them all to change color simultaniously or flicker, or fade, or whatever (but I don't need to address them individually)

Some online led calculator told me that the best way to do this using 12V is by making 33 parallel connections of 3 leds in series.

But I have no idea how to put 4-pin leds in series (or parallel for that matter), all I find online is how to do it with 2-pin leds. And my other question is if I'll be able to do what I want, just with the Arduino board, or do I need extensions? (or is there some other kind of board that is better suited for this?)

Normally with 2-pin LEDs series is…

12V—LED—LED—LED—RESISTOR—DRIVER

Parallel, all red LEDs, repeat for other colours.

|—LED—LED—LED—RESISTOR—|
12V—|—LED—LED—LED—RESISTOR—|—DRIVER
|—LED—LED—LED—RESISTOR—|
|—LED—LED—LED—RESISTOR—|

But presumably these LEDs have a common anode and three cathodes (or vice versa), in which case I can’t see how you could put them in series. I also don’t see that it matters much, I think you have to connect all 99 anodes together, all 33 blue cathodes together etc and have three drivers, one for each colour.

|—BLU—RESISTOR—|
|—BLU—RESISTOR—|—DRIVER
|—BLU—RESISTOR—|
|
12V—|—GRN—RESISTOR—|
|—GRN—RESISTOR—|—DRIVER
|—GRN—RESISTOR—|
|
|—BLU—|
|—BLU—|—BIG RESISTOR—DRIVER
|—BLU—|

The resistors could be combined into one large one per colour (as I’ve done with the blue LEDs) depending on the current used.

just with the Arduino board, or do I need extensions?

The Arduino will do just fine, but it will need “extensions”, specifically three drivers to sink the current from 33 LEDs.


Rob

thanks for your reply :)

Could you give me some information about those 3 drivers I need? Type, here I find them, what they cost?

Thanks in advance.

33 x say 20mA (what is the current of the LEDs?) is 660mA, so any largish FET or transistor would do I think. There are special driver chips but for what is effectively just 3 LEDs I think there's no need.

However, having said that, the ULN2801 would do the job and be neater, it is rated at 500mA per output but it has 8 outputs so you can use 6 of them in pairs or split your LEDs into groups of 16 and 17 and use 6 outputs seperately.


Rob

Allegro makes a 16 bit constant current latched LED driver.

I'm not sure the full current rating it would support, but it essentially removes the need for the current limiting resistors, you use on resistor to set the current you want to limit it to and it limits the current on each pin to that value.

http://www.allegromicro.com/en/Products/Part_Numbers/6276/

you couldn't do it in series because you have only one cathode for all 3 colors. if it were in series would essentially be connecting all three anodes to the cathode of the prior led, thus making it an expensive white LED. for 3 RGB in parallel, you'd connect the cathodes, and connect the anodes for each color separately. in other words three sets of 3 anodes you'd need to adjust the current you put out because putting them in parallel draws more current (60mA vs. 20mA)

how many you need to control at any one time. take a look at the hypnocube, they don't use the constant current driver, but rather the 74hc595 and separate resistors, but the concept remains the same, they have 4 cathodes for 16 RGB LED's (one for each layer of 4), and 12 anodes (4 columns of each color) this is repeated 4 times to make essentially 4- 4x4 matrices. it varies the color by sucessively pulsing the three different anodes of each LED at different frequencies to make it appear the colors between red green and blue. As for the code, it would be pretty long because for each apparent change of color, you'd need to put in numerous instances of the same sequence to vary the colors. it is probably much less work to figure out varied pattern with a math function rather than a data table that would take a lot of data entry for a relatively short pattern. you can increase the hold time for each data set, but the more you do that the more flicker will be noticeable. there was a thread by retrolefty, for an 8 cube of single color, or 512 led's; if they were RGB it would be essentially 1536 led's. your 99 LED's is really 297 LED's if you want to be able to control each LED independantly. if you control more than one per out put you can cut this down. you were saying three at a time. I'd look at the datasheet for the drivers to see how much current it can handle per output.

one risk you run doing three in parallel, is if one of the 3 fries, the other 2 will likely fry not long after because the current will still be allowed to flow as if there were 3 there and thus overloading the other 2. this is rare but not unheard of, especially if overheated during soldering.

If you are going for the same color for all the led's at one time the FET would work, but from what I understand you want more than just a 7 color (red, green, blue and combinations thereof) if you do just want the basic colors, it would be best to do them individually, with current limiting resistors for each color of each led. I guess I'd need a better Idea what effect you are trying to accomplish. RGB LED's aren't cheap, and to make the most of them I suggest playing around on a small scale before going full scale.

I hope this doesn't overwhelm you, there is unlimited potential with the arduino, I just don't want you to get discouraged by biting off too much on your first project with something that can become costly quickly.

-CR

first of all what size led are you talking about? The high power 1W 350mA ones or the small 20mA ones?

what are you trying to light with them? or is it for a display of some sort

you won't be able to wire them in series without using 6pin leds where you have the + and - for each die (color)

if you are using the high power ones then i would use a CC driver and they are ones for common anode or cathode that can be controlled with an arduino

if you are using the small 20mA ones you can just use resistors (one on each color on each led) it will be a lot of soldering

if you want to use 12v you may want to check out flexible led strips or modules as they already have 3x 6pin RGB leds wired in series thus making it easy to connect to (as long as they fit what you are trying to do)

350mA, are you building a new fremont street for vegas? just kidding, it would be great to get a better idea as to what you have in mind. RetroLefty has a pretty good thread on an 8x8x8 single color cube. but that may not be what you're going for. If you think about it, it's a similar concept in that each layer of the cube is like eight - 64 pin common cathode LED's, each one independantly addressable.

not to confuse things,

-Carl

A question for Rob- looking a the data sheet for the 2801, would the 2803 be better suited for this application since it is for 5V. just curious, I don't know how much it really matters, I haven't used them very much,

-Carl

There's a nice tutorial on darlington arrays by grumpy mike, regarding heat dissipation, something to keep in mind.

http://www.thebox.myzen.co.uk/Tutorial/Power_Examples.html

peace- Carl

My plan is to buy around 100 RGB leds (5 mm 20~25 mA) ones. And I want to make 1 long strip (or maybe split it into parts) and be able to control them all at the same time with my laptop. Like making them all orange, or making them fade through the RGB spectrum (not just the basic colors), maybe flashing, ...

The 3x33 (series x parallel) idea was just because I thought it would be easier that way.

So you can't connect them in series it has to be parallel with a common anode or cathode. Just treat it like any heavy load and use one or more transistors or FETs. You need to use PWM outputs to get them to fade.

would the 2803 be better suited for this application since it is for 5V

Yes the 2803 would be better as it has internal base resistors so that saves some components.

This application is effectively to drive 3 LED, just big ones, so the drive parts count is nothing either way, a single 2803 or three FETs.


Rob

My plan is to buy around 100 RGB leds (5 mm 20~25 mA) ones. And I want to make 1 long strip (or maybe split it into parts) and be able to control them all at the same time with my laptop. Like making them all orange, or making them fade through the RGB spectrum (not just the basic colors), maybe flashing, ...

The 3x33 (series x parallel) idea was just because I thought it would be easier that way

if you haven't purchased the LED's yet perhaps one of those LED strips like they use to trick out cars, unless you like soldering

i would have to agree with Carl. For $4-6/ft you can get the RGB Flex Strip with SMD RGB leds pre-soldered and wired in series with a resistor ready to go for a 12v power supply and all you would need is a logic level mofset (one for each channel) to control it with the arduino

I wanted to practise soldering/wiring etc. But apparently RGB leds are too hard to start off with, I think I'm going to try with single color leds first :)

Thanks everyone for your help.

yes single color ones would be much better:-) and you can wire them in series with a resistor. and after a hundred of them you will be able to solder with your eyes shut :)