LED Multiplexing...
Tim-M
Posts: 522
Hi All,
I'm looking for a bit of advice or experience regarding multiplexing LEDs on a Halloween costume for this fall. I think the project will be BS2 based and involve about 500 LEDs.
I'd like to use serial multiplexing ICs to simplify wiring and control code... something like AllegroMicro's UCN5833A which was discontinued in '05.
UCN5833A info. here:
http://www.allegromicro.com/en/Products/Part_Numbers/5833/
AllegroMicro also has the A6832 and A6833 devices as seen here:
http://www.allegromicro.com/en/Products/Applications/Lighting/displays_and_signage.asp
These are just my first thoughts... do any of you have advice for control of 500 LEDs? I'd settle for simple on/off control but dimming (PWM?) would be ideal.
Thanks,
Tim
Edit: I don't have alot of serial communication experience myself, so I'm wondering if there are issues or concerns with sending out strings as large as 32 bits at a time with a BS2, or if another/better way is recommended to get the job done.
Post Edited (Tim-M) : 8/20/2008 4:35:34 AM GMT
I'm looking for a bit of advice or experience regarding multiplexing LEDs on a Halloween costume for this fall. I think the project will be BS2 based and involve about 500 LEDs.
I'd like to use serial multiplexing ICs to simplify wiring and control code... something like AllegroMicro's UCN5833A which was discontinued in '05.
UCN5833A info. here:
http://www.allegromicro.com/en/Products/Part_Numbers/5833/
AllegroMicro also has the A6832 and A6833 devices as seen here:
http://www.allegromicro.com/en/Products/Applications/Lighting/displays_and_signage.asp
These are just my first thoughts... do any of you have advice for control of 500 LEDs? I'd settle for simple on/off control but dimming (PWM?) would be ideal.
Thanks,
Tim
Edit: I don't have alot of serial communication experience myself, so I'm wondering if there are issues or concerns with sending out strings as large as 32 bits at a time with a BS2, or if another/better way is recommended to get the job done.
Post Edited (Tim-M) : 8/20/2008 4:35:34 AM GMT
Comments
First you usually get a prefabricated 8X8 matrix which is equal to 64 leds. With proper power driver, you can use an SX28 or SX48 to do most anything you would like as a banner with dozens of these. You could have 8, 16, 24, or 32 led columns and endless length.
You cannot send 32bits at a time to the BasicStamp as it is an 8-bit processor. The Allegro is a nice chip, but it isn't the only way to build a panel. You can send four consecutive bytes. If you really want 32bit processing, the Propeller is a 32-bit processor. 8 bit processing is usually done with having several 8-bit latches setting up a column of 8, 16, 24, or 32 LEDs to be powered on all at once. That is the multiplexing that one has to use.
Multiplexing has two issues - the handling of the data AND the management of powering all the LEDs to appear seamless in their display. So far, your scheme is a bit vague. Are the 500 LEDs going to be in one panel or are you going to have clusters of LEDs located in many different places and things that are activated by triggers?
And why do you want or think you need serial communication? Or did you just see that the Allegro was a serial shift register?
Are you going to have a PC programed to feed data to the display in real time? If so, you have to program the PC as well. It might be easier to load whole images in large EEPROMs and forget using a PC.
The outcome is only as good as the details of the initial plan. And the plan should include a budget or you may just find it all too expensive.
Also, if you want a panel - how many colors and which colors? Here in Taiwan I see a lot of three color panels, but since they are Red, Green, and Yellow they really don't appeal to me. I would like a richer choice of colors and suppose that these panels were originally made for traffic control.
Finally, if you really want a panel -- you may be able to buy one second hand for far less than the cost of building one from scratch. Cash always comes into play. I have been wanting a 16x16 matrix for quite some time, but only recently found a kit for $33 USD. It works fine, but the microprocessor is a 89c51. So I have to learn the Assembly language for that device to modify it. There is no schematic. And, all the documentation is in Chinese- so I have to reverse engineer the board.
I have gotten used to the challenges as they really do make one fully understand the principles. But things do take longer when you have to find all the answers for yourself.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
It's sunny and warm here. It is always sunny and warm here.... (unless a typhoon blows through).
Tropically, G. Herzog [noparse][[/noparse] 黃鶴 ] in Taiwan
Post Edited (Kramer) : 8/20/2008 1:23:13 PM GMT
Thanks for your input.
I should have included more detail... First off, I'm not looking for a panel at all.· The LEDs are spread over the surface of clothing,·a costume, and the desire is to have control of each one for visual effects such as patterns and sequencing.· The project·will stand alone with no PC involved.· Power will come from batteries (type to be determined)·in a backpack.
I assume serial control simply because the number of LEDs used or driven, is so much greater than the number of Basic Stamp·outputs available.· Some type of interface is obviously·needed and I am aware of shift registers.· All data will be output from the uC except for a couple of control push buttons, so all communication is in the·output direction.
The plan is sound and not all that expensive because the two of us building it are donating the labor.· 500 LEDs, most of the same color, will cost less than $50, throw in a uC or two plus the interface electronics and the budget is still under control.
I posted the questions in case there is a better way to accomplish this other·than using shift registers and the community here is a great resource of information from so many varied backgrounds.· I have considered the Propeller as the uC for the project but I have yet to use one and am tending to fall back on what I know since the project is somewhat simple.
Tim
Edit: typos.
I understand that you are not looking for a panel but take a look at the work we have done with a Bicolor (tricolor) 64x32 LED matrix display:
http://forums.parallax.com/showthread.php?p=739950
I have even been able to cascade 2 of these displays to form a 128 x 32 LED matrix display with a faster 50 MHz resonator. I can't imagine wearing 500 LEDs as the current consumtion would eat up at least an amp or more. It would·not be long before your "batteries" would be·drained. That many LEDs really need a stable regulated voltage and constant current source.
I had worked on a project a couple of years ago with a BS2px and·about (110) CD4017 and·CD4081·ICs·that sequenced over 700 LEDs over a panel. Take a look and ask youself if you want to wear this many LEDs.
Good·Luck.
It's been long enough that I forgot about your Firehouse Project. There is alot of hand wiring work represented in that project, well done!
I understand the concerns about the number of LEDs and power consumption. The truth is that 500 LEDs is the worst case and reallity will likely be closer to 300... still a high number I realize. The costume design is beyond my control and is nearing final stages by those involved. To address the power consumption, I've advised that the lighting patterns should have few LEDs on at any given time. The wear or "on" time for the costume is fairly short and that makes a big difference too. Batteries will most likely be Sealed Lead Acid or Lithium Ion.
To keep things organized, flat and more comfortable to wear, the plan is to wire LEDs in groups and connect the groups back to the controls using ribbon cable.
Sounds to me like you guys think this project is nuts and maybe it is. I really do appreciate the help and am open to all ideas.
Tim
Tim
all my work is based on stuff the guys at brildea has done, so I can't take any credit. [noparse]:)[/noparse]
his stuff is in the customer application area, under living room controller..
my other costume is also featured there. under fursuit [noparse]:)[/noparse]
animatronic wings :>
If you can get it down to 256 LEDs then controlling with a 16x16 LED matrix may be a good answer solved with an SX48 proto board:
http://forums.parallax.com/showthread.php?p=649643
Tim
Since it is a costume, the Allegro chips may still be a bit of overkill. You don't need latches, but you do need the serial to parallel shift registers. You can put together 8 bit or 16 bit shift registers to get 32 bits of output or even more, like 40bits and so on. Each output can be attached to one LED.
PWM is not possible with the shift registers lighting the LEDs. You would have to take PWM directly from the BasicStamp and it tends to dominate processing resources. If you want it, the Propeller is a much better choice. You have 32 I/O pins and 8 processors. You can have feeds both to the shift registers for general dazzle and maybe 8 PWM channels to provide special effects to some LEDs.
A Basic Stamp has 16 output pins, so you could have 12 pins outputting 12 different strings of serial data to different shift registers and you could have 4 pins clocking the 12 shift registers at four different rates. That would have quite a bit of variety. I would consider putting it all on a cape, rather than having to wire a coat and pants with plug ins.
I guess it would be 12 strings of 40 LEDS by piecing together 40bit shift registers from small combinations. There are tons of ways to manage the output and much would best be done by trial an error. Having three speeds would be nice.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
It's sunny and warm here. It is always sunny and warm here.... (unless a typhoon blows through).
Tropically, G. Herzog [noparse][[/noparse] 黃鶴 ] in Taiwan
For ~300 LEDs:
74HC595's at 8 outputs each = 38 needed for 304 total outputs. How would you lay this out? Use multiple uCs with so many 595s per processor for manageability and speed?
I am attracted to the 595s for the reasons you point out of history and examples, but it feels overly busy and cluttered to me.
If I can use something like the Allegro 5833s, only 10 would be needed for a total of 320 outputs and this seems more manageable from the communications side of things.
This assumes that I could 'shift data out forever' to make it happen. Since you guys have experience with that part, maybe you would speak to it a little bit?
Tim
A battery can't do that for long so I power it with a quality mains to 5V 20A power supply.
Maybe think about using a 4017 and four 74HC595's to run up to 320 LEDs with half an amp.
You will probably need 10 transistors (or driver chip) to get enough current for 32 LEDs from the 4017,
and 33-ohm resistors between each 595 pin which drives one of 10 LEDs at a time, chosen by the 4017.
The LEDs would be in a grid circuit but not necessarily arranged that way if you are going to use a big spool of wire.
(Idea: use ribbon cables for each set of 8 or 10 LEDs, less mess!)
4017 is a unique self-decoded ten-counter which looks like a shift register when it controls LED's.
Only weird thing about it is the pin order is all mixed up.
I would use four in one chain, though you could have eight or more in a chain. The 8 bits of data that goes into the first one is moved to the second, then the third, then the fourth, and so on until it dies at the end of the chain.
Once an 8 bit pattern enters the chain it cannot be modified.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
It's sunny and warm here. It is always sunny and warm here.... (unless a typhoon blows through).
Tropically, G. Herzog [noparse][[/noparse] 黃鶴 ] in Taiwan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
It's sunny and warm here. It is always sunny and warm here.... (unless a typhoon blows through).
Tropically, G. Herzog [noparse][[/noparse] 黃鶴 ] in Taiwan
Don't rule out the TLC5940 IC. You can directly connect 16 LEDs without the need for current limiting resistors and have 4096 step grayscale on each individual LED. The TLC5940 is loaded with data over a single serial link to as many cascaded IC as you you wish.
Thanks for the help and good ideas guys! Sounds to me like this comes down to two main issues...
1. Which microprocessor for the brain?
- Need advice here since I don't have a concept of the time it will take to send the long serial strings given the number of outputs. I have yet to use an SX or Propeller, so will one of the Basic Stamps be fast enough for the job?
2. Which method or IC for an interface to the outputs?
- Lildi, I'll take a good look at the TLC5940. It would be fun to have dimming capability for more effect options and this looks promising.
- I like the tried and true 595s too, it would just take a bunch of them for the number of outputs desired.
Tim
Thanks,
Tim