5
\$\begingroup\$

I'm a sculptor, not an EE, but I'm trying to incorporate controllable LEDs into a piece that I'm working on, and I could use some advice figuring out a practical approach. I'd like to be able to control 12 separate channels (the piece is a dodecahedron) of RGB strips, and that means I'll need 36 PWM outs, which is more than I have access to on an Arduino. As far as I can tell I'll need a shield, something like TLC5940 Breakout - though that only gives me 16 PWMs so I'd need to daisy chain three of them, which I know can be done, but I'd like to know what issues might result. Something like Brilldea LED Painter might also be a solution, but I'm relatively pressed for time, so something pre-assembled would be a nice perk.

I'm new to this, so I'm not sure of the accuracy of what I just said, but hopefully some of you can fill me in on what might be a reasonable approach. Thanks for your help.

\$\endgroup\$
2
  • \$\begingroup\$ But you really need to drive all the strips and all the colors independently? If you find a rule that decreases the number of variables, you can make it simpler. \$\endgroup\$
    – clabacchio
    Commented Feb 22, 2012 at 8:02
  • 1
    \$\begingroup\$ It's an art project, so I don't "need" to do anything. But yeah, in an ideal scenario (and it sounds like it's a realistic scenario) I'll be able to drive each strip independently in order to create the effects that I want. Scaling back will restrict the visualizations I can create. \$\endgroup\$
    – the_koo
    Commented Feb 23, 2012 at 8:25

7 Answers 7

4
\$\begingroup\$

In my opinion, your approach in using this breakout board by sparkfun sounds really good :)

The big advantages are that this board provides 16 PWM channels that are programmable via a daisy chainable serial interface, all led inputs are easily accessible and easy to keep track of.

Also - you probably know already, if you plan on using Arduino, a library that will help you manipulate the driver already exists.

In case you didn't, you should also check out their project home

Since you said that you are pressed I think this solution would allow you to work fast and easy in order to get those leds up and running the way you want them to - Good luck with your project! :)

\$\endgroup\$
5
  • \$\begingroup\$ The LED painter looks perfect for his project. \$\endgroup\$
    – joeforker
    Commented Feb 22, 2012 at 15:38
  • \$\begingroup\$ Thanks, I like the look of the TLC5940. In fact, the LED painter actually uses three of them (NT, as opposed to RHB on the breakout). As best I can tell, the painter is dividing the colors across the three drivers, whereas with the breakout the channels wouldn't be divided. Can you tell me if there are disadvantages to either approach, and more importantly, which would be harder to program for? Thanks for all the help! \$\endgroup\$
    – the_koo
    Commented Feb 23, 2012 at 8:15
  • \$\begingroup\$ (part1): Yes you are correct, the LED painter splits RGB among the three TLCs, but there is no reason you can't use the breakout boards in the same way, in fact, I think this is a really good idea. Reagarding the breakout board you probably already know that in the pics the 0,1,2 ... 15 connectors are the way they are in order to accommodate RC servo connections. One GROUND, one BATTERY (+5V) and one PWM output. When wiring, you will only need to use the PWM output, and of course the GROUND from one board (provided that GROUND is common for all 3 boards). \$\endgroup\$
    – Dan
    Commented Feb 23, 2012 at 12:18
  • \$\begingroup\$ (part2): About advantages and disadvantages ... I think that spliting the colors would allow you to work much more oraganized and that's a really good thing, from both software and hardware point of view, other than that, I can't think about something to say like "this is much better because..." Finnaly, spliting RGB over the 3 TLCs, using the breakout boards looks like the way to go from my point of view. LED painter is also great, but they're out of stock :) \$\endgroup\$
    – Dan
    Commented Feb 23, 2012 at 12:18
  • \$\begingroup\$ The main reason to drive each color on its own TLC5940 is so you can drive each color with a different amount of current (all the constant-current sinks on a single TLC5940 will sink the same amount of current). It is not more difficult to program one way or the other. \$\endgroup\$
    – joeforker
    Commented Feb 23, 2012 at 14:25
6
\$\begingroup\$

There is a fancy Arduino library for doing PWM through shift registers, called ShiftPWM. It was developed more or less specifically for what you are wanting to do (control lots of RGB LEDs with an Arduino). I saw this on Hack-a-Day several months ago. It looks very cool and boasts the potential to control 768 LEDs (or 256 RGB LEDs) at 5-bits (i.e. 32 brightness levels) per color channel (i.e. >32000 possible colors). I'm looking forward to using this library at some point myself. And it's only going to take up three pins on your Arduino - for serial, clock, and latch to the initial shift register (in the chain). This library is meant to drive something like the 74HC595 shift register, which is hell of a lot cheaper than the TLC5940.

\$\endgroup\$
3
  • \$\begingroup\$ The TLC5940 is not "a hell of a lot more expensive" than the 3 74HC595 shift registers (purchased in small quantities) that you would need to replace it, and the TLC5940 uses the same number of pins and takes a lot of timing constraints out of the microcontroller. \$\endgroup\$
    – joeforker
    Commented Feb 22, 2012 at 21:52
  • \$\begingroup\$ To get 256 brightness levels, does one really need to feed the shifters 256 times per frame? Some other approaches would seem to allow one to get by with a lot less. \$\endgroup\$
    – supercat
    Commented Feb 22, 2012 at 23:40
  • \$\begingroup\$ I like this idea, but I have enough financial support that cost of the TLC5940 shouldn't be much of an issue. I'd also like to have 256 levels as I'm writing a program that will convert motion (it'll be converting data from a Kinect) into a color, so having a bigger range makes the algorithm more interesting. Thanks though. Might still be useful. \$\endgroup\$
    – the_koo
    Commented Feb 23, 2012 at 3:36
3
\$\begingroup\$

You don't need PWM. Any output (IO) pin on a microcontroller will work.

A PWM lets you set a duty cycle (on/off time) then repeats this indefinitely, which results in a variable brightness. IO pins can be turned on and off based on a timer to achieve the same result. The PWM is technically more precise and can change faster than the IO pins, but the human eye can't see the difference. The result will be exactly the same.

So you need a microcontroller with 36 IO pins.

\$\endgroup\$
4
  • 2
    \$\begingroup\$ If you're trying to avoid external hardware, it would also have to be able to sink enough current to drive those 36 LEDs... \$\endgroup\$
    – joeforker
    Commented Feb 22, 2012 at 15:37
  • 1
    \$\begingroup\$ Yup, 100 Hz or so would be plenty fast to produce no visible flickering. The clock on an Arduino runs at 8,000,000 Hz, so you can do this in software. \$\endgroup\$ Commented Feb 22, 2012 at 21:08
  • \$\begingroup\$ That's useful to know, but my Arduino still doesn't have 36 output pins, so I still need to figure the best way to string together all those pins. Thank you though! \$\endgroup\$
    – the_koo
    Commented Feb 23, 2012 at 8:21
  • \$\begingroup\$ @the_koo: Arduinos are pretty small -- perhaps you could find room to squeeze in 3 or 4 Arduinos, each one controlling a few of the RGB strips. Or perhaps upgrade to a Arduino Mega 2560 which has 54 output pins. \$\endgroup\$
    – davidcary
    Commented Feb 24, 2012 at 0:02
1
\$\begingroup\$

(Apologies for advertisy post but couldn't see any way to contact user directly) I manufacture a 48 channel DMX dimmer designed to drive LED strips, which may give you an of-the-shelf solution. email me via whitewing.co.uk

\$\endgroup\$
1
\$\begingroup\$

Another option you may want to consider is:

http://thingm.com/products/blinkm

I have no connections to this company, I have just used the product.

\$\endgroup\$
0
\$\begingroup\$

I would suggest using controlled-current shift registers and allowing the current-control wire to be CPU controlled (possibly by including one or more non-current-controlled shifters in the chain and having them control resistor dividers). If you want 6-bit brightness control, and a maximum reload speed of 10 times the PWM rate (e.g. a max of one reload per millisecond to achieve a 100Hz frame rate), I would suggest that the six bits of each PWM value be divided among six shift buffers (so bit N of buffer B would be bit B of LED N's brightness). Then every 10 cycles, the reload pattern would be:

Cycle 0: Load all shifters with buffer 5, full current
Cycle 1-3: Keep same data in shifters
Cycle 4: Load all shifters with buffer 4, full current
Cycle 5: Keep same data in shifters
Cycle 6: Load all shifters with buffer 3, full current
Cycle 7: Load all shifters with buffer 2, half current
Cycle 8: Load all shifters with buffer 1, quarter current
Cycle 9: Load all shifters with buffer 0, 1/8 current

This approach would allow the average current to be set from 1/80 of the maximum peak to 63/80 of the maximum peak, in units of 1/80, using a reload rate that's only 10x the frame rate. If one wants 256 brightness levels, one could add reloads at 1/16 and 1/32 current (12 reloads per frame instead of 10). That would allow the average current to be set from 1/384 to 255/384 with only a modest increase in reload rate.

\$\endgroup\$
0
\$\begingroup\$

This http://www.adafruit.com/products/306 could be an option. It has 32 RGB addressable lEDS per strip and you can cut the strip (yeap these a tutorial for that) so you place them

\$\endgroup\$
2
  • \$\begingroup\$ Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. \$\endgroup\$ Commented Feb 22, 2012 at 21:09
  • \$\begingroup\$ I'm not trying to address individual LEDs on one strip. I need to address a whole bunch of separate strips. \$\endgroup\$
    – the_koo
    Commented Feb 23, 2012 at 8:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.