Driving A 10x10x10 RGB Cube

Grumpy_Mike:

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.

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

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.

Grumpy_Mike:
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.

Yep, it's an awful lot of chips+wires. No arguments there.

mnpumar:
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?

To simulate the final LED brightness/flicker at 100Hz you need to turn the LED on for 10ms then off for 90ms. Putting "delay(10)" in that code doesn't do that.

nb. Any code which doesn't synchronize to the TLC5940's PWM cycle won't represent the final result.

mnpumar:
I only need to drive the LED's at 20mA or less, so this shouldn't be a problem.

Normally you drive them harder to compensate for the fact that they're only on for 1/10th of the time.

LEDs have a power rating (watts) and a maximum 'pulse' current (mA), see the datasheet for your LED for details. You can go higher then 20mA so long as you don't exceed either of those ratings.

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.

Lefty

retrolefty:
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...

fungus:

retrolefty:
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.

Lefty

retrolefty:
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).

retrolefty:
I think simple on/off controls to the 3000 led elements is the way to go, certainly for ones first attempt.

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

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.

Just thought i'd throw this in, im using a HEF4067BP to drive 8 x 7 seg displays, it's a 1 of 16 channel switch

http://www.nxp.com/documents/data_sheet/HEF4067B.pdf

Grumpy_Mike:
I would say that there is over six months of work here.

I don't know if it's that much ... maybe a month of snipping/soldering and another of programming.

What major problems do you see in the electronics? I don't really see any apart from switching 15A of power on/off quickly (Separate 5V PSU with lots of capacitors on the output? Thick wires for all GND connections?)

fungus:

Grumpy_Mike:
I would say that there is over six months of work here.

I don't know if it's that much ... maybe a month of snipping/soldering and another of programming.

What major problems do you see in the electronics? I don't really see any apart from switching 15A of power on/off quickly (Separate 5V PSU with lots of capacitors on the output? Thick wires for all GND connections?)

Having built a 5x5x5 cube, while finding designing, building, debugging the hardware challenging it was at least something I enjoyed and progress was mostly trouble free. The software was another kettle of fish however. The basic scanning of the cube was pretty simple but I found that the 'creative part' of coming up with interesting pattern shows was so very very tedious and very time consuming and I soon lost interest after defining about six basic patterns including a simple random pattern using a RNG. What I really longed for was a PC based GUI pattern editor that I could use to 'visually' build patterns, scan by scan, and then be able to upload the pattern into the arduino driven cube. But of course my PC software skills would never allow me to write such a application. So now when I watch cube being demonstrated on U-tube or wherever, I've really come to appreciate the artistic effort that some have mastered. So in effect the software is the biggest overall factor is the quality of the finished project.

Lefty

What major problems do you see in the electronics?

As you said:-

from switching 15A of power on/off quickly

(Separate 5V PSU with lots of capacitors on the output? Thick wires for all GND connections?)

If it were only that simple.

Grumpy_Mike:

(Separate 5V PSU with lots of capacitors on the output? Thick wires for all GND connections?)

If it were only that simple.

Four power wires to each layer (at the corners...)? Decoupling on each one?

Grumpy_Mike:

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.

Excuse me, but you don't know me well enough to make that judgement. First of all, I have a degree in Electrical Engineering and I have a very good work ethic. When I decide to do something, I do whatever it takes to accomplish my goals. I've already made an 8x8x8 cube and fabricated my own PCB at home. The kind of things we are discussing here are not the kind of things that one learns in college, they are specific to a platform I am currently unfamiliar with. I am asking for advice from people who have more experience in areas I do not, that doesn't mean I'm stupid or unwilling to put the work in myself. I've already bought most of the parts, fabricated a jig, and straightened most of the wires. I expect this project to take a few months, and I'm ok with that. I'm here to learn and I'm willing to listen to your advice, but please don't make such unfair assumptions.

Excuse me, but you don't know me well enough to make that judgement.

True I don't but I have answered enough questions to make a guess.

First of all, I have a degree in Electrical Engineering

Fine so do I.

that doesn't mean I'm stupid

I never said, nor implied you were. However some of your responses suggest that you have less experience than you are implying you have by your last post.

I've already bought most of the parts

That is what worries me. You need to make a realistic prototype of a tiny corner of what you plan, run it at the rate the real thing will run before you know if your design is feasible.

I've already made an 8x8x8 cube

Good so you know what is involved with 500 LEDs, now you want to scale it up to 3000. Scaling up is not easy, you don't just make more. There are lots of things to consider with switching so much current so quickly. I would have thought the TLC5940 was not the best choice as you have to synchronise the multiplexing to the refresh rate.

Best of luck with your project. Please post in the exhibition section when you have it working.

Grumpy_Mike:

What major problems do you see in the electronics?

As you said:-

from switching 15A of power on/off quickly

(Separate 5V PSU with lots of capacitors on the output? Thick wires for all GND connections?)

If it were only that simple.

15A!? Please double check your math. Each layer is 10x10, with 3 pins per LED, for a total of 300 pins. Each pin will drive a max of 20mA, 300x20mA = 6A. I'm planning to use this power supply to drive the LED's: 5V 10A switching power supply : ID 658 : $29.95 : Adafruit Industries, Unique & fun DIY electronics and kits. With large enough decoupling caps between Vcc and Gnd on each chip, this shouldn't be an issue. Not really sure what your issue is here. I also bought high power mosfets rated for 100V and 40A to handle the switching. http://www.irf.com/product-info/datasheets/data/irf5210pbf.pdf I probably won't be running the LED's at the full 20mA anyways, since it might be too bright to look at.

That is what worries me. You need to make a realistic prototype of a tiny corner of what you plan, run it at the rate the real thing will run before you know if your design is feasible.

I plan on building a 4x4x4 with a scaled version of the circuit and to practice different techniques of assembling the cube. However, it's hard to tell from a smaller version if something this large will work because I won't be hitting the same limitations.

Good so you know what is involved with 500 LEDs, now you want to scale it up to 3000. Scaling up is not easy, you don't just make more. There are lots of things to consider with switching so much current so quickly. I would have thought the TLC5940 was not the best choice as you have to synchronise the multiplexing to the refresh rate.

I thought they would be a better choice than shift registers because I have to chain together a large amount of IC's. I used shift registers for my 8x8x8. If I use shift registers I would need to drive a much faster clock through the board to manually handle the PWM. What do you think is the best choice and why?

Best of luck with your project. Please post in the exhibition section when you have it working.

Will do, but getting there will not be trivial, and I appreciate the guidance from those who are more experienced in this area than I am. I'm considering making a build thread to document my progress for those who are interested.

Having built a 5x5x5 cube, while finding designing, building, debugging the hardware challenging it was at least something I enjoyed and progress was mostly trouble free. The software was another kettle of fish however. The basic scanning of the cube was pretty simple but I found that the 'creative part' of coming up with interesting pattern shows was so very very tedious and very time consuming and I soon lost interest after defining about six basic patterns including a simple random pattern using a RNG. What I really longed for was a PC based GUI pattern editor that I could use to 'visually' build patterns, scan by scan, and then be able to upload the pattern into the arduino driven cube. But of course my PC software skills would never allow me to write such a application. So now when I watch cube being demonstrated on U-tube or wherever, I've really come to appreciate the artistic effort that some have mastered. So in effect the software is the biggest overall factor is the quality of the finished project.

Lefty

I'm a verification engineer, so my job involves both hardware and software, so I'm not really worried about the software side. I will make a GUI for this, and I have a few other ideas planned as well. That being said, what I am concerned about is the low-level code on the MCU to handle the multiplexing of all the layers. There are libraries available that I can adapt to my needs, but I don't know if they will be fast enough to handle what is essentially a 300x10 matrix.

That being said, what I am concerned about is the low-level code on the MCU to handle the multiplexing of all the layers. There are libraries available that I can adapt to my needs, but I don't know if they will be fast enough to handle what is essentially a 300x10 matrix.

I don't think you have anything to worry about on that issue. I can't prove it with math right now but you only have to be a little faster the human's eye perseverance which is pretty wimpy, and a 16 Mhz 328p can push a lot of bits in the time required, I would have little fear in that. As I said I used the Mstimer2 interrupt library to setup a basic 2 millisecond 'window' to shift out all 25 bits via the shift registers for each level. You will have to shift out 300 bits per heart beat and then switch to the next level, so maybe a 1 millisecond interrupt window to shift 300 bits. You may have to work with direct port manipulation commands for the output data shifting rather then using digitalWrite() commands, but I think you will be OK.

So look up POV timing and do some math on bit shifting. I too certainly would want to have a handle/confidence on that before applying solder to 1,000 RGB leds. :wink:

Lefty

Another thing that crossed my mind is where you are going to store the data for multiplexing the cube. With the equivalent of 3000 LEDs storing 12 bits per LED is going to take 4500 bytes. Cutting this down to 1 byte per pixel still gives 3K which means you will have to use a Mega.

Simulating it should be easy enough, you don't need to build a cube, just have one TLC5940, one power FET and then drive it as if there were 19 chained TLC5940s and 10 FETs, then you can see if you can get the data and spit it out fast enough. The eye is often more sensitive to point sources of illumination flickering than to diffused areas.

The 15A figure came from fungus. I think he was allowing more than 20mA per LED.

I probably won't be running the LED's at the full 20mA anyways, since it might be too bright to look at.

Are you sure with a 10 to 1 on / off ratio?

With large enough decoupling caps between Vcc and Gnd on each chip, this shouldn't be an issue.

Lets hope you have a good scope.

Not really sure what your issue is here.

Well it's your issue actually but switching that much current at that frequency on the end of long wires one of the issues will be radio frequency emission causing interference to the controller. There will also be problems caused by reflection of signals at impedance discontinuities ( the end of the line ) , and ground bounce, are just three that immediately spring to my mind.

Grumpy_Mike:
Another thing that crossed my mind is where you are going to store the data for multiplexing the cube. With the equivalent of 3000 LEDs storing 12 bits per LED is going to take 4500 bytes. Cutting this down to 1 byte per pixel still gives 3K which means you will have to use a Mega.

Aware of this, using a teensy++2.0 right now, but will probably switch to an arduino duo if i can get my hands on one. Also, I plan to send the data from my computer to the mcu in real time before i try hard-coding some into the chip.

Simulating it should be easy enough, you don't need to build a cube, just have one TLC5940, one power FET and then drive it as if there were 19 chained TLC5940s and 10 FETs, then you can see if you can get the data and spit it out fast enough. The eye is often more sensitive to point sources of illumination flickering than to diffused areas.

That's true, great idea! I will give this a try as soon as I get my transistors in next week.

I probably won't be running the LED's at the full 20mA anyways, since it might be too bright to look at.

Are you sure with a 10 to 1 on / off ratio?

I plan on seeing how it looks and adjusting the current to my liking. The experiment you suggested would be a great way to experiment with this.

Lets hope you have a good scope.

I do :slight_smile:

Not really sure what your issue is here.

Well it's your issue actually but switching that much current at that frequency on the end of long wires one of the issues will be radio frequency emission causing interference to the controller. There will also be problems caused by reflection of signals at impedance discontinuities ( the end of the line ) , and ground bounce, are just three that immediately spring to my mind.

I know its half the LED's, but I've seen functional RGB 8x8x8's that didn't have these issues. I think you may be over thinking this a bit with the radio frequency emissions. I'm planning to use push-pull's on the clock/data lines because of the large traces and fanout. Ground bounce? Maybe...but if I use separate supplies for the LED's and the IC's, then I don't see too big of an issue here.

Grumpy_Mike:
I would have thought the TLC5940 was not the best choice as you have to synchronise the multiplexing to the refresh rate.

No, that's what makes the TLC5940 the perfect choice. You have complete manual control over the chip, the PWM clock, etc.

mnpumar:
15A!? Please double check your math.

I assumed you were going to drive the LEDs at more then 20mA

mnpumar:
I probably won't be running the LED's at the full 20mA anyways, since it might be too bright to look at.

At 10:1 ratio, 20mA is like running them at 2mA. Not very bright.

mnpumar:
I'm a verification engineer, so my job involves both hardware and software, so I'm not really worried about the software side.

It's statements like this and the previous one that makes me (and Mike) think you don't know what you're talking about. The initial code you posted, along with the 'problems' it had suggest you're a noob at programming. It doesn't add up with somebody who's built/programmed a working 8x8x8 cube.