RaspberryPi controlling 600 LEDs - Need suggestions

Description of your first forum.

RaspberryPi controlling 600 LEDs - Need suggestions

Postby Chris813 » February 1st, 2013, 5:04 am

Hello all! I've been a long-time fan of hack a day but this is my first forum post and first micro-controller project; so go easy on me, lol.

I recently purchased a 600 LED blossom tree that stands about 7' in my living room. http://www.amazon.com/Philips-Feet-Lighted-Blossom-Holiday/dp/B009JR5LOA

My project goals are to control all of the LEDs individually, including brightness, via a Raspberry Pi. Once working, I'll be using a webcam to automatically map each LED's location in 3d (x,y, & z coords). In essence, it will be similar to a 3d led cube when complete.

It would be nice to have a relatively easy setup which can display 30-60 fps. I know little about micro-controllers, I2c, etc. but I do have a good understanding of electricity, linux, computer programming, and serial connections.

I already have the tree w/LEDs, included power supply, and a Raspberry Pi. I've been thinking MAX6955AAX+ (http://www.mouser.com/ProductDetail/Maxim-Integrated/MAX6955AAX+/?qs=sGAEpiMZZMvbyeSUH4qH%2fOk8JopE47NB) or maybe a Peggy 2LE (http://shop.evilmadscientist.com/productsmenu/tinykitlist/157)

Anyone have experience with these components or other recommendations? Thanks in advance!
Chris813
 
Posts: 5
Joined: January 2nd, 2013, 3:50 pm

Re: RaspberryPi controlling 600 LEDs - Need suggestions

Postby semicolo » February 1st, 2013, 10:34 am

But the leds in this tree are already wired and you can't control them individually, it means you have to rewire everything, is that ok?
User avatar
semicolo
 
Posts: 269
Joined: December 13th, 2011, 3:32 pm

Re: RaspberryPi controlling 600 LEDs - Need suggestions

Postby Chris813 » February 1st, 2013, 11:17 am

Correct.
Chris813
 
Posts: 5
Joined: January 2nd, 2013, 3:50 pm

Re: RaspberryPi controlling 600 LEDs - Need suggestions

Postby st2000 » February 2nd, 2013, 12:24 pm

Holy Moly that's a project.

Assumptions:
1. LED's are all wired together. No individual control.
2. LED's are only white. Think I've seen some trees where the color changes.
3. Tree plug directly into 110 volts. Indicating the LEDs are wired in series each with it's own resistor. So they are like Christmas light and do not need a power supply.

You're not going to like this, but I would recommend you practically start over. Get a "blank" tree and some of these LED strings:

https://www.adafruit.com/products/322

You don't need anything as powerful as a RaspberryPi. You can control these using an Atmel based controller like an Arduino. And they can be programmed to display what ever color you wish.

---

I can see you are not moved. Ok, let's see what you have got your self into. You want to control 600 white LEDs. They are probably super bright so can not be powered directly by any processor. Here, let's use these for an example:

https://www.adafruit.com/products/754

These (which may or may not be like yours) run on 3V at about 20mA. Ok, so to light up 600 of these you need a power supply that is 3V at 12 amps. To be safe we might want to double that. So 3V at 24 amps. Or 72 watts. Hum.

It is likely that in any design you use, you will use a resistor in series with the LED. In such a case you can use a higher voltage power supply and drop the difference across the resistor. Like use a 5V supply and drop 2V across the resistor and the other 3V across the LED. If the expected current is .02A then, to drop 2V, you can try using a 100ohm resistor.

Most people are going to use a MOSFET transistor to switch on and off a high current LED. Here is a web page that talks about controlling LEDs for a Stop Sign Costume:

http://systembus.com/110621/%5BnRF24%5Ddiyembedded2/www.sparkfun.com/tutorials/205.htm

Half way down the page you see a schematic which includes 2 resistors and a FET. He is controlling 9 LEDs that draw about 400mA all together. You want to control each LED individually. So you need to adjust the resistor in series with your LED according to your power supply and the current your LEDs will draw. So, for every LED you have, you need to buy 2 resistors and a FET and wire this all in someplace on the tree. Then you need to bring back 600 wires to the RaspberryPi. Which, BTW, does not have 600 GPIO pins.

That's too much work. What else is there?

Well, there is what you suggested. Using the Maxim IC. A quick look says you should be able to control 18 LEDs? So that puts you at 4 chips. You could place them around the tree and wire back the LEDs to the chips.

Note, this is something very similar to that string of LED in the first link above.

Are there other ways of doing this? Yes, you can try building a matrix and wiring up each of the 600 LEDs to coordinates in that matrix. That way you only need two times the square root of the number of LED worth of switching circuits. It's a bit tricky to design using FETs, but it should be possible. So a matrix of 30 by 20 should give you control over 600 LEDs. Of course you can only light up one LED at a time. Not so different from the way a TV screen is scanned. But you realize to get a frame rate of only 30 FPS you would have to plow through your matrix at a rate of 18000 LEDs a second.

Are there other ways? I can think of a few more bizarre ones. But I think the most sane is to go with the 1st link above.

-good luck
st2000
 
Posts: 1251
Joined: February 3rd, 2011, 6:10 pm

Re: RaspberryPi controlling 600 LEDs - Need suggestions

Postby k-ww » February 2nd, 2013, 1:04 pm

ST2000: I beg to differ on one point - you can turn on either 20 or 30 LED's at a time with a 20x30 matrix, not just one. The computation time to setup each block of LEDs goes up, but the update rate goes down, while the brightness [duty cycle] increases to either 3.3% [20 LEDs at a time] or 5% [30 LEDs at a time].

The design tradeoff would be power supply size vs # LEDs on at once.

To get the number of pins needed down, I would use several 1/8 decoders [138's] to decode 32 select lines from only 5 output port bits, and use 30 of the decoded outputs to drive P channel MOSFETs to pull the anodes of 20 LEDs to +5, and use 20 N channel MOSFETs [each connected to an output port bit] to pull the cathodes to ground.

BTW: This is more the way an LCD panel is scanned [many rows or columns in parallel], rather than a TV.
User avatar
k-ww
 
Posts: 1117
Joined: February 17th, 2011, 10:47 am

Re: RaspberryPi controlling 600 LEDs - Need suggestions

Postby Chris813 » February 2nd, 2013, 5:16 pm

Thanks guys! I now realize I should have been more specific and added more info.

To clarify, I only need help controlling the LEDs via the Raspberry Pi. The main reason for using a Pi, instead of something smaller, is so that I can dynamically map each LED's location in 3d via a web cam; i.e. map x & Y for each LED, move camera 90 degrees from center of tree, map again, and then compute z axis. This same technique could be used to create a house-sized matrix in the future. I would also like to control the tree via wi-fi web app or maybe make it interactive with opencv. I know... I'm asking a lot here. Thanks in advance for the help! :)


I understand that the entire tree will have to be rewired. Currently, it's powered by an AC wall-adapter which outputs 24v @ 1.25a:
Image

The LEDs seem to be cheap and standard. They are single color (white) and only as bright as a standard LED; not like an LED flashlight:

Image

The LEDs appear to be these: http://www.electron.com/led-5mm-cool-white-599xw7c.html


Also, the tree is broken into 6 branches containing 100 LEDs ea:

Image


I have not disassembled the tree to see how it's wired and what resisters it's currently using.

The Maxim IC chip seems like it would do the job with 5 of them but I'm not entirely sure how to hook them up. Given that, it seems like wiring each light individually into a Peggy 2 and connecting it the the Pi's GPIO serial or I2C is the way to go here. However, there are no specs on power input or output.
Chris813
 
Posts: 5
Joined: January 2nd, 2013, 3:50 pm

Re: RaspberryPi controlling 600 LEDs - Need suggestions

Postby st2000 » February 3rd, 2013, 12:36 pm

Still, a big project. But if you like tinkering and are good at wiring things up - let's have a go.

I see what k-ww is saying. Instead of just one you could light up a column or row of LEDs at a time. Just which depends on how you wire up your series resistor. Only 1 LED per resistor or your LED's brightness will start to fluctuate according to how many are lit.

So you think your LEDs run at about 3.4V and draw about 20mA. Your power supply is 24V at 1.25A. And you examined the LEDs and believe they are in groups of 100. And each group is being delivered 24V? If they were all in series that would only be .24V across each LED at most. So that's not it. It's probably more like 20 groups in parallel of 5 LEDs in series with, let's see, 150 ohm resistors next to each LED. What ever it is you are going to have to figure out the particulars. You are looking for the particulars so that you can re-use as much of the things you already have as you can. It won't be much fun if you end up replacing all the series resistors because you picked a power supply which had an inconvenient voltage.

So, we are making a lot of assumptions. So please check on them fist.

Iff your LEDs are 3.4V at 20mA with 150 ohm resisters for each LED, that would translate into 3.4V + (.02A * 150) = 4.9 volts. Close enough to 5 volts that you could probably get by with a 5 volt regulated power supply. At this point you should probably measure the voltage across the LEDs and across the LEDs and the resistor. This so we know we are on track and can backwards-engineer / re-purpose this project successfully.

If you go with the matrix you could conveniently light up as many as, say, 30 LEDs at the same time. That's 30 * .02A = .6A. Add the RaspberryPi and what ever else you decide to use. Then double current that to be safe.

If you go with your Maxim chips, it sounds like you could light them all up at one time. Now you need to be very careful as your power supply and your wiring will have to be able to handle the hight currents. 600 * .02A = 12A just from the LEDs.

I'm confused as to how you are rendering a normal raster with a random cluster of lights. I would think the mapping is only created once. Afterwards the processor would only need to determine the brightness at the position of the LED in space and either light it up or not. And I'm not sure I understand the need to map the LEDs from two different vantage points 90 degrees apart. Usually the effect is only good if viewed from the vantage point of the camera used when creating the initial mapping.

-good luck
Last edited by st2000 on February 5th, 2013, 1:00 pm, edited 1 time in total.
st2000
 
Posts: 1251
Joined: February 3rd, 2011, 6:10 pm

Re: RaspberryPi controlling 600 LEDs - Need suggestions

Postby Chris813 » February 4th, 2013, 9:00 am

I'll start measuring the voltage and figuring out what's going on there. Also, I was planning on writing code to display effects in 3d rather than raster images. 600 pixels is pretty low resolution for the size of the tree so I guess time will tell what works and what doesn't.
Chris813
 
Posts: 5
Joined: January 2nd, 2013, 3:50 pm

Re: RaspberryPi controlling 600 LEDs - Need suggestions

Postby st2000 » February 5th, 2013, 1:08 pm

I was planning on writing code to display effects in 3d rather than raster images. 600 pixels is pretty low resolution for the size of the tree so I guess time will tell what works and what doesn't.


Keep in mind that 600^(1/3) is between 8 and 9. So even if you had a perfectly formed cube, you wouldn't be able to much better then an 8 by 8 by 8 LED cube display:

http://www.youtube.com/watch?v=6mXM-oGggrM

I would go for 2D for now.
st2000
 
Posts: 1251
Joined: February 3rd, 2011, 6:10 pm

Re: RaspberryPi controlling 600 LEDs - Need suggestions

Postby st2000 » February 10th, 2013, 10:20 am

User (here) thor17 posted about a chip you might be interested in. It appears to be a good candidate if you go for a matrix design. Look for HT1632C chip specifications on the web.
st2000
 
Posts: 1251
Joined: February 3rd, 2011, 6:10 pm

Next

Return to General Talk

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 2 guests