I need some advice on how to drive a 10x10x10 RGB LED cube. It basically comes down to 300 pins multiplexed 10 times for the 10 layers. My first thought was to use TLC5940's, but I tried a simple test of just turning all the pins on one on and off as fast as I could. However, there was noticeable flickering in the LED's, so I'm having my doubts. If I can't even achieve persistence of vision on 16 pins, how could I possibly do it with 300 multiplexed 10 times? Here's the code I used for reference (Note I was using a Teensy++2.0):

Thanks, I'll give this a try! I am still having serious doubts now about these chips being fast enough to drive the cube. Is there any hardware limitation here? Do I need to use an arduino due to acheive the kind of perfomance required to multiplex 300 pins across all 10 layers quickly enough for persistence of vision? If so, will these chips work with 3.3V inputs and 5V outputs?

Another idea/question: are there any chips out there that would support sending out the data to 3 sets of these chips at once (one for red, one for green, one for blue)?

I am still having serious doubts now about these chips being fast enough to drive the cube.

Well it is not the chip but the entire arduino.Also depending on how you do it the on / off ratio of the LEDs is not going to be very good, meaning the brightness will be compromised dramatically. You would have a 100 to 1 duty cycle. I have used a 4 to 1 duty cycle and found that quite limiting. You need to boos the current to the LEDs to compensate but the TLC5940 won't drive that much current even if yor LEDs can take it.

The SPI bus can send a byte in 17 clock cycles (see thread a couple of weeks ago). The Arduino runs at 16mHz so he can send that much data over 2000 times per second even with a bit of overhead for processing/sequencing.

He can cut the TLC5940's PWM cycle short at the end of each transmission, latch the PWM data and start on the next layer. With ten layers he can update the cube 200 times/sec. - a perfectly acceptable rate.

Well no, I was assuming, and said, that he was going to multiplex so that one column of one plane would be on at any one time. Now if you are going to drive it with 300 LEDs in one plane all on at the same time then yes it is only 10 to 1. However that means he will have to have 300 / 16 = 19 TLC5940 to drive it. While not impossible, there needs to be some signal buffering going on, proper construction and good layout. It is not something you are going to make on bread board.

Quote

It can drive 120mA per pin

Yes that is the current, now work out the power dissipation that will cause in the chip and you will find you can't run the chip at that current.

The SPI bus can send a byte in 17 clock cycles (see thread a couple of weeks ago). The Arduino runs at 16mHz so he can send that much data over 2000 times per second even with a bit of overhead for processing/sequencing.

He can cut the TLC5940's PWM cycle short at the end of each transmission, latch the PWM data and start on the next layer. With ten layers he can update the cube 200 times/sec. - a perfectly acceptable rate.

These calculations look correct, based on the fact that you can send a byte in 17 clock cycles. I'm a bit skeptical though, because adding a delay of more than 10 in the code above causes the lights to flicker/blink. I'd like to see where you found that, could you post a link?

Well no, I was assuming, and said, that he was going to multiplex so that one column of one plane would be on at any one time. Now if you are going to drive it with 300 LEDs in one plane all on at the same time then yes it is only 10 to 1. However that means he will have to have 300 / 16 = 19 TLC5940 to drive it. While not impossible, there needs to be some signal buffering going on, proper construction and good layout. It is not something you are going to make on bread board.

Maybe not a breadboard...but a perfboard, maybe? Last time I tried to make a large pcb at home using toner transfer it was a real challenge...I'm hoping not to have to resort to that again.

Yes that is the current, now work out the power dissipation that will cause in the chip and you will find you can't run the chip at that current.

You could if the supply voltages are very close to the LED voltages...

But realistically, no, you can't do 120mA per LED with a 5V supply.

OTOH if we assume an average 1.8V excess voltage per LED (ie. a 5V supply with R=2.2V, G+B=3.6V) you can do 60mA which is in the right ballpark for a project like this. Total dissipation per chip would be ~1792mW. The chip can do that easily.

Well in designing my 5x5x5 led cube, I used a 2 millisecond timer interrupt to set-up my scanning of the cube, so five levels at 2 millisec each gives me a 10millisec update cycle time and I detected no flicking at all. As far a ma drive level for the leds Vs scan rate, I simple used shift registers that contain built in constant current (sinking) output pins which made the whole brightness thing a no worry situation. Each 16 bit register (I used 2 series connected) uses a single 'programming' resistor to set the desired constant output current value for all the output pins (I set for 20ma) and the performance is great, led brightness is the same no matter if a single led or all 125 are being lite up.

I simple used shift registers that contain built in constant current (sinking) output pins which made the whole brightness thing a no worry situation.

RGB cubes are more complicated, they need PWM control for setting the colors...

Depends on how many colors you want to be able to display. Simple on/off to each RGB led terminals should be able to have 7 colors plus all off. It's kind difficult to obtain near infinite colors outputs as well as near constant brightness in the same scanning algorithm I would think and add a lot of complexity to the sketch for the desired pattern/display coding. I think simple on/off controls to the 3000 led elements is the way to go, certainly for ones first attempt.

Depends on how many colors you want to be able to display. Simple on/off to each RGB led terminals should be able to have 7 colors plus all off. It's kind difficult to obtain near infinite colors outputs as well as near constant brightness in the same scanning algorithm I would think and add a lot of complexity to the sketch for the desired pattern/display coding.

I'm not sure there's a massive difference in complexity between 7 colors and PWM. The wiring is almost identical, the software will be very similar (but with a lot more data).

it seems like he should probably make something smaller to get some practice with electronics, TLC5940s, Arduino programming, etc.

Let's face it. The OP is never going to make a 10 X 10 X 10 cube, it is one of those over ambitious things a newcomer wants to do. It is a lot more complex than just getting the right circuit and wiring it up. I wouldn't attempt this myself and I have got a bit of experience. I would say that there is over six months of work here.