Shop OBEX P1 Docs P2 Docs Learn Events
Controlling a lot of RGB LEDs — Parallax Forums

Controlling a lot of RGB LEDs

MioTheGreatMioTheGreat Posts: 9
edited 2008-06-28 20:59 in Propeller 1
Hi all,

I've got 120 RGB LEDs that I'd like to be able to control. They're in groups of 6. Each group of 6 will be displaying the same color, so I've effectively got '20 lights'. Because they have a common pin, I can't really put them in series with each other, so I have to drive the whole thing at low voltage.

The TLC5940 has some sample code for the Propeller, which makes it appealing for me to use.

I was thinking that with a TLC5940, I could take each group of 6 and control 5 of them with it. It has 16 channels, so I figure that if I put each of the colors in the 6-RGB LED groups in parallel, and drive it at 120mA, I'll use 3 channels per group, and thus 15 channels for 5 groups.

So I have 20 groups of 6 RGB LEDs, being controlled by 4 TLC5940's 60 outputs.

The G and B LEDs have a Vf of 3.2, so I can control them without any issue from the TLC5940. But the red only has a Vf of 2V. So I would need a resistor (Probably 1/2W, I'll have to calculate the value and dissipation out later) on the output for the red segments, right?

Does anyone see a problem with this setup, other than the fact that I'm going to need a pretty beefy power supply for it all?

Comments

  • LeonLeon Posts: 7,620
    edited 2008-06-27 16:58
    Maxim has some very nice chips for controlling LED arrays.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • Fred HawkinsFred Hawkins Posts: 997
    edited 2008-06-27 23:00
    are they common cathode or common anode?
  • MioTheGreatMioTheGreat Posts: 9
    edited 2008-06-27 23:02
    Ah, Smile.

    The TLC5940 is a current sink. My LEDs are common cathode. What was I thinking? Are there PWM driving constant current sources that work like the TLC5940?

    Ugh. I'm going to need more hardware to drive these, right?


    Maybe a PIC and a transistor array as an SPI slave to my propeller, with 3 current limitting resistors per LED. Let's see. That's 360 resistors. Ouch. Anyone have any better ideas?


    Wait. I could do this:

    (from transistor)
    -----------
                 \
                 /
                 \
                 /
                 |
       ---------------------
       |   |   |   |   |   |
      \ / \ / \ / \ / \ / \ /
       V   V   V   V   V   V
      --- --- --- --- --- ---
       |   |   |   |   |   |
       _____________________
                  |
                  |
                (gnd)
    



    Right?

    So 3 transistors and 3 resistors per LED group. 60 resistors and 60 transistors, along with two dirt-cheap PICs taking in SPI commands from my Prop and putting out the right PWM signal for each channel. That's not TOO bad.....


    On the other hand, this is a pretty stupid thing to do if one LED decides to heat up a little unevenly or something, draws more current than the others, and blows itself out. So that brings me back to 360 resistors. Ew.

    Post Edited (MioTheGreat) : 6/27/2008 11:37:53 PM GMT
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2008-06-28 01:14
    I have used the TLC5940 in several applications and have created some of the sample code in the Propeller/SPIN for the TLC5940.· On www.brilldea.com I have driver PCB that I created for RGB LED arrays.· You can check them out.

    Reread the datasheet a couple more times.· Since the chip does act as a current source, I am not sure you would need a dropping resistor.· All the installations I have done had the resistor because it was integral to the RGB LED product I was using, but I did some test at lower voltages without LED and didn't experience problems.· Hmmm....I would probably read through a couple of the TI application notes to review their schematics.

    Have you purchased your RGB LED product yet?· Sounds like you have since the said the LEDs are arranged in common Cathode form and you are sticking with that design constraint.· You may be able to put the transistor on the output of the TLC5940 to accomplish what you want, again check the application notes at TI's web site.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter

    www.brilldea.com·- uOLED-IOC, RGB LEDs, TLC5940 driver PCB
    www.tdswieter.com
    One little spark of imagination is all it takes for an idea to explode
  • MioTheGreatMioTheGreat Posts: 9
    edited 2008-06-28 16:41
    They're common cathode. I'm stuck with that.

    And it occurs to me that my original setup was a dumb idea anyway. It has the same problem: I'm relying on the LEDs to distribute the current evenly. That's too risky.

    I believe i'll need 3 resistors per LED, or a 3 dedicated channels per LED no matter what I do.

    So in the end, I'm going to have to use 360 resistors. I don't think I really have any other choice.
  • LeonLeon Posts: 7,620
    edited 2008-06-28 16:50
    Have you looked at the Maxim chips as I suggested? I think they will make it a lot simpler.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • MioTheGreatMioTheGreat Posts: 9
    edited 2008-06-28 16:54
    I looked, but I didn't really see anything that would help me. Plus, I can get a transistor array and a PIC for cheaper than the maxim chips.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-06-28 17:40
    You might consider using a current mirror to drive your parallel LED banks. This circuit shows how it could be done:

    attachment.php?attachmentid=54348

    The input to this circuit is a control current such as that from a current-sinking driver like the TLC5940. Assuming the transistors are adequately matched, the LEDs will each be sourced with a current equal to the control current, regardless of slight differences in their forward voltages. Remember also that the transistors are operating linearly (between fully on and fully off), so you will need to make sure the ones you choose are capable of the necessary power dissipaiton. To minimize power dissipation in the transistors, you might consider separate supplies for the Red and Green/Blue LEDs. It's cheaper to have an LM317 adjustable regulator output a low voltage than to have each transistor dissipate heat due to a large voltage drop.

    -Phil

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Still some PropSTICK Kit bare PCBs left!

    Post Edited (Phil Pilgrim (PhiPi)) : 6/28/2008 5:54:27 PM GMT
    700 x 307 - 4K
  • MioTheGreatMioTheGreat Posts: 9
    edited 2008-06-28 18:41
    Thanks Phil.

    So I think I've got two choices:

    A) The current mirror you suggested, which gives 7 transistors per color, or 21 per group, plus the current sink.
    B) Three transistors and 18 resistors per group, as well as 3 PWM outs per group (Probably a very simple program running on a $0.60 PIC as an SPI slave)

    I'm thinking that it's just going to be easier and cheaper to deal with option B. The current mirror is definitely an interesting idea and would allow for greater control if I wanted to change something, but I don't think that's a problem I'm going to face.
  • LawsonLawson Posts: 870
    edited 2008-06-28 20:59
    btw, resistor arrays in nice DIP and SIP packages can be found on Digikey and other places.

    Marty

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Lunch cures all problems! have you had lunch?
Sign In or Register to comment.