250individually addressable LED ribbon (no matrix)

Hi, I've been searching for ages on how to complete a childhood dream to make a LED ribbon and control each LED individually with my Arduino, I'm talking about 250 LED's to light up my christmas tree.

Some (very noobish ideas); - solder them together on a wire and end up controling them with 250 relays - using something I've found on this blog - using DMX?? (not sure how though)

Any help would be much appreciated :-)

Thanks for reading!

Thys

You could use a lot of multiplexers (I'm still a novice in that area, so you'll have to ask someone else), or several Arduino/ATMegas. I would prefer the latter, because they're realatively cheap (about 5 bucks for one with the Arduino Bootloader), and they're small. Obviously, you only get ~20 Outputs per ATMega, so you'd need at least 13, unless you decide to use Multiplexers, in which case you could control many more.

Another idea is to only control segments of lights (ie, instead of controlling all lights together, control 5-10 at a time). Doing this would reduce your need for Output pins.

Using either example, you'd still need a way to power it, because it's dangerous (and probably impossible) to draw that much power from the Arduino. I would use Transistors, such as the 2n2222 or PN2222, but you could use relays as well.

Good luck! :D

Some details you left out:

  1. What kind of LEDs? RGB? Single-color?

  2. How fast do you need to change them?

  3. Do you want to vary the intensity? Or just turn them off and on?

There are several chips people are already using to control LEDs with the Arduino (i.e., there's sample code you can use as a starting point), but they have different features, so which one is best depends on your goals.

Ran

Even though your LED's aren't physically in a square pattern, you could still wire them up in a matrix form, and it would greatly reduce the amount of components that you would need. Using 250 relays seems really impractical. I would look at either multiplexing or wiring them up like a matrix (which is just another form of multiplexing).

17 shift registers like this, daisy chained together, and the whole thing could be setup on ~3,4 arduino pins

The shift registers can be driven with the SPI port for faster throughput, this would enable you to control dimming. Having 250 wires seems a bit impractical, though.

Thank you guys so much for all the replies!

to answer some questions:

@TchnclFl: thx for the ATmega tip, any idea on how to program them with my arduino?

@Ran Talbott: 1. Single Color white 2. reasonable reponstime (let's say max 1 second latency) 3. Just turn them off and on

I just want to have a ribbon of LEDs and say to a specific LED to be on or off, charlieplexing only allows 1 LED at the time, I would have to be albe to get every LED some sort of state: on or off so that for example LED 3, 28, 59 and 149 are on and all the rest are off

@DMan: yeah, the relays idea was never my favorite, is there a way to wire them up in one long matrix?

@ Osgeld: sounds interesting, can you tell me more on howto work with shift registers? Is it possible to control 17 shift registers from 1 arduino (found this tutorial for shift registers) how do I control more than 2, and is it possible this way to control specific LEDs (like nr 43: on, nr 89: on, nr 12: on, and the rest off)

@tika: I don't see how I got much choice than to use 250 wires, or is there?

thanks again for the replies :-)

Theres a tutorial for shiftregisters here:

http://www.arduino.cc/en/Tutorial/ShiftOut

@ Osgeld: sounds interesting, can you tell me more on howto work with shift registers? Is it possible to control 17 shift registers from 1 arduino (found this tutorial for shift registers) how do I control more than 2, and is it possible this way to control specific LEDs (like nr 43: on, nr 89: on, nr 12: on, and the rest off)

the shift registers you would be dealing with would be serial in / parallel out, for one you set a bit high or low and toggle the clock (i say toggle cause you could litterly control this with 2 toggle switches) that bit shows up on output 8, when you send a second bit down the line the 2nd bit shows up on 8 and bit one moves to output 7 ect

when you chain them together they just keep shifting down the line, so if you have 2 8 bit registers, you set and toggle 16 times and so on

using different bit patterns you can control the state of every output pin in the chain, without increasing arduino pins

You can also look to the M5451 Chip.

Drives 35 LEDs with one resistor in constant current mode.

You can use 1 pin for a clock on all of them, and the remainder of pins as data. That means using the 6 analog and 12 digital IOs (Leaving Serial IO alone) you could have 17 of these Chips from one Arduino.

That'd give you 595 individually addressable channels. No POV tricks either. Internally these chips have a shift reg and and a constant current limiter.

Just remember to work out your power supply properly. 595 LEDs for ex at 15ma = 8.9A

Since these are Christmas tree lights, you need to design them to deal with the usual Christmas tree light hazards. Like the dog or ca munching on them, or somebody stepping on the string or rolling a chair over it while you're decorating the tree.

That's part of the reason I'm suggesting you break them into modules, like existing light strings are.

First, pick your shift register. Make sure that it's one that has a serial output from the high bit so you can "daisy chain" them together. While it's tempting to go with one that has lots of LED outputs, remember that you have to run separate wires from the chip to each LED in the string, so you probably want to trade off making more strings to reduce the number of wires and keep the bulk down.

Next, pick a connector for chaining the strings together. You need to have 5 connections: power, ground, serial data, clock, and load. Keep in mind that 250 LEDs means that you'll have as much as 5 Amps flowing through the power and ground wires, so don't use a connector that can't handle a pretty fat wire. I'm thinking maybe 5-pin DIN connectors, because you can get them in an unobtrusive black, but make sure their contacts are rated for 5A. You might also look into using nylon Molex style: not as pretty, but cheap, reliable, and readily available.

The total length of the string will probably exceed 20 feet, which is a long way to go with a standard TTL signal. You may need to insert one or two "repeater" modules (with a simple digital buffer chip) in the string to make sure you get a clean signal all the way to the end (another reason for "going modular": it's easy to make a module with the same connectors that can be inserted wherever needed).

A couple of people have already mentioned shift registers specifically designed to drive LEDs. They cost more, but remember that they save you from needing to include current-limiting resistors. That's a big plus when you're wiring hundreds of LEDs into dozens of modules.

Ran