Go Down

Topic: Led cube efficiency (Read 6058 times) previous topic - next topic

henkiej

Hello everybody,

I am starting to build a led cube of 8x8x8.
I have read some articles about creating more outputs for my arduino and i think using shift registers is the best solution for me.
This is going great and i have now 2 shift registers combined so i can turn on 16 leds independently.

At this point I bumped into one problem.
Every led uses a wire of its own, this wire can't touch another in order for the led to work independently.
How do I set up the cube? Do I have to pull a wire to every single led in the cube?
This would mean that there will be a lot of wires heaping up in the frame..

In some examples you can see that all the leds are attached to each other and i don't see any wires.
If I attach my leds to each other I don't see how I can use them independently.

Is there something i'm missing about the shift registers?

CrossRoads

You are missing "multiplexing".
In many cubes, the LEDs are arranged in columns and then layers.
In each of ther 64 columns, all the cathodes are connected together.
In each of the 8 layers, all the anodes are connected together.
Then you have a PNP or P-channel MOSFET to supply 64 x 20mA to any one layer of anodes at a time, and 8 shift registers to sink the current from the (up to) 64 LEDs that you want on.
Cycle thru all 8 layers rapidly leaving each layer for 2.5mS so the entire display is refreshed 50 times a second and looks flicker-free (1/50 = 20mS, /8 = 2.5mS) . Persistence of vision will trick the eye into not seeing the rapid changes. Use SPI.transfer to send the 8 bytes out to the shift registers.
Use a part like TPIC6B595 so that all 8 LEDs can be together and the resulting 160mA does not overwhelm the part (74HC595 is only good for 70mA total for the whole device).
During the ~2.495ms of non-datashifting time (takes 4-5uS to shift out 8 bytes), you can be doing other stuff.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

raron

Like this

But how you wire it up (be it 2D or 3D), is ofc up to you. One thing to keep in mind is that if you use row/column scanning in your 8x8x8 cube, it could be rather dim. Because each row (or column) would be on for 1/64th of a frame time, as there are 64 rows (of 8 LED's) total.

CrossRoads

The potential for dimness is why I suggested turning on whole layers at a time, so they are on 1/8th of the time.
The drawback is needing a bigger power supply, 1.28A. Not that big I suppose, easily provided by a wallwart.
http://www.dipmicro.com/store/DCA-0520
8 logic level, low Rds, P-channel MOSFETs to source current
http://www.digikey.com/product-detail/en/NDP6020P/NDP6020P-ND/1055922
8 TPIC6B595 shift registers to sink current
http://www.digikey.com/product-search/en?pv69=80&k=tpic6b595&mnonly=0&newproducts=0&ColumnSort=0&page=1&quantity=0&ptm=0&fid=0&pageSize=25
64 resistors sized to allow up to 20mA (typical max) for the LEDs you select.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

PaulRB

CrossRoads' suggestion is an excellent one. If you want to go one stage further and have individually dimmable LEDs, or just reduce the number of shift registers from 8 to 4 (and reduce the current-limiting resistors from 64 to 4), you could also look at TLC5940.

Paul

CrossRoads

Lot more data needed to send out for TLC5940 tho. Lot more.
Can also do PWM on the TPIC6B595 OE/ for dimming.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

PaulRB


Lot more data needed to send out for TLC5940 tho. Lot more.
Can also do PWM on the TPIC6B595 OE/ for dimming.

Yes, 12 times more data. But SPI.transfer is fast, isn't it?

TLC5940 also around 3~4 times more expensive than TIPC6B595.

But if you want individual dimming, it would be the way to go. Using pwm on oe input of tipc6b595 would allow only overall dimming of the cube.

But maybe the op doesn't care about dimming anyway...

henkiej

Thanks for the fast reply's!

It is important that the leds can be used seperately, not a whole layer at once.
The cube will have to switch the leds very fast and has to switch leds simultaneously too.

The TLC5940 would be more confinient as PaulRB sayed but CrossRoads sayed it needs more data.
My question is can it handle the fast switching?

For example, the whole cube must be switched on and off from bottom corner to the opposite top corner within 1,5 seconds.
(It has to look like a wave so a lot of leds will be switched on simultaneously, otherwise it would be impossible withing 1,5 seconds).

What would be your advice?

CrossRoads

Do you need 4096 levels of brightness control? Probably not. Stick with the 8 TPIC6B595s to start, send out 9 bytes of data 50 times a second (9th byte to control the PNP/P-channel MOSFETS for switching the anode current). With a little bit of smarts in your building, you can always replace the 8 shift registers with 4 TLC5940's at a later time as your coding skills improve.
I don't think anyone wires up cubes with 8 layers worth of drive circuits. That would be a wiring mess as you indicated originally, and mechanically a challenge to assemble.
You can still turn each LED on/off individually - send out 1 high and 63 lows for a layer, only 1 LED will turn on. Persistence of vision will provide the illusion to the eye.
This is a pretty good site to see what you are getting into.
http://www.jameco.com/Jameco/workshop/JamecoBuilds/4x4x4ledcube.html
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

CrossRoads

Here's another example
http://www.jameco.com/webapp/wcs/stores/servlet/Product_10001_10001_2169539_-1
Read the parts list - includes Uno R3, 8 shift registers, and one 3 to 8 decoder (which can be replaced with another shift register)
This one uses 74HC574 to source current to the columns, and NPN transistors to sink current from each layer.
http://www.ti.com/lit/ds/symlink/sn74hc574.pdf
As you can see the 74HC574 is not rated to provide 20mA for 8 outputs, so brightness will be limited.
Using PNP or P-channel MOSFETs to source current to each layer and TPIC6B595 to sink current from each colum will allow full 20mA per LED if desired.
You can use PWM on the shift registers OE/ pin as well to provide 0-255 levels of brightness control also.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

PaulRB

#10
Aug 06, 2013, 10:05 pm Last Edit: Aug 06, 2013, 10:07 pm by PaulRB Reason: 1
What we're saying is, whether you choose to use tipc6b595 or tlc5940, the Arduino will be capable of  switching every one of those 512 leds on and off 50 times per second with ease. In fact that will probably take only a few percent of the available processing speed.

It doesn't sound like you need to individually dim the leds, so I think you should go with the 8 x tipc6b595 for simplicity of design even though it will mean more chips and resistors.

As CrossRoads suggests, you will need to control which of the 8 layers is being multiplexed at any instant. An ordinary 74hct595 can be used for that and daisy chained to the other shift registers. This  last shift register will need to drive 8 x pnp transistors or p channel fets. These need to be capable of handling 1.2A, which is more than the standard ones like bc327 can handle. I don't have a recommendation for this but I'm sure someone else will...

Paul

CrossRoads

NOT 74HC595 - that part sucks for current source or sinking, 70mA total for the part, just 8-9mA per IO.
TPIC6B595 much better.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

PaulRB

#12
Aug 07, 2013, 07:53 am Last Edit: Aug 07, 2013, 08:05 am by PaulRB Reason: 1
How about tip125 as the anode-side switches? They have max current of 5A and current gain of 1000. So for a 1.2A collector/emitter current, the base current would need to be 1.2mA. A base resistor of 2K2 would give a base current of 2.3mA, more than enough to saturate it. As it would be driving the common anode layers, one at a time, a 74hc595's current sourcing abilities would not be an issue.

CrossRoads

NOT 74HC595 - that part sucks for current source or sinking, 70mA total for the part, just 8-9mA per IO.
TPIC6B595 much better.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

PaulRB

Sounds like we may be getting confused over our recommendations. Allow me to re-state them as I understand:

For the cathodes: 8 x TIPC6B595 shift registers, daisy-chained (+64 suitable series resistors). 74HC595 not suitable for this due to overall chip current limits.

For the anodes: 1 x 74HC595 (also daisy-chained to the TIPC6B595s), driving suitable pnp transistors or p-channel fets. 74HC595 OK here as it won't need to sink/source much current - just enough to drive one transistor/fet at a time. It appears to me that 8 x TIP125 would be suitable (with 2K2 base resistors), but this needs confirming or a better suggestion.

Paul

Go Up