Pages: [1]   Go Down
Author Topic: multiplexing for 4X4X4 LED cube  (Read 1670 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am using 3 4051 8-channel de/multiplexers to run a 4X4X4 LED cube and am using LEDs that run 3-3.6V at 20ma. I am not sure what the best (and hopefully cheapest smiley-money) way to do this is. Help would be greatly appreciated. smiley
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 631
Posts: 34506
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Using a 4051 analogue multiplexer for switching outputs is a rubbish idea, there are no latches and only one LED can be on at any one time pushing up your required refresh rate and cutting down the brightness.
Logged

Netherlands
Offline Offline
God Member
*****
Karma: 7
Posts: 657
A naughty mind is a joy forever.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Most cubes work with the Persistence of Vision principle, none of the leds are on at the same time.
By switching 'm fast enough, it seems all are on at the same time, we humans are just too slow to
see the difference. In the same way film is nothing more as a bunch of pictures shown at a high enough
frequency.

A 4051 seems like a difficult chip to use for a cube, since you only can address one of it's outputs at
the same time. One led can there for never be on for more as 1/64 of the time using a 4051. It usually
also is used to multiplex a signal and not really to drive much power.

Since only one in 64 can be illuminated at the same time you'll need a lot of speed to keep
the persistence of vision real and.... Leds are on for such a short period of time that they'll
hardly be able to see. Try analogWrite(4) on a led you'll be using to see what the maximum
brightness of a led will be.

It's quite common to drive a cube Layer-wise. Using a 16bit shiftregister (or 2 8-bit ones) you can
turn on/off all 16 leds of a layer at the same time before going to the next. With 4 layers that makes
it possible to switch on each led for 1/4 of the time and get a brightness 16 times as high.

Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6637
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

There are many possibilities, here are some of them:

1. Drive the LEDs from a 64-bit shift register, no multiplexing. 3 Arduino pins needed (clock, data, and reset) - or 2 if you can get by without reset. Has the advantage that the Arduino doesn't have to do anything when the pattern is not changing.

2. Use a 16-bit shift register to capture the data for a whole layer, then multiplex the 4 layers. 7 Arduino pins needed (clock, data, 4 layer lines). The layer lines will need buffering so as to drive up to 16 leds at once.

3. Drive the 64 leds as if they are an 8x8 multiplexed array. 11 pins needed if you use a 3 to 8 line demultiplexer to decode the common lines, which may also serve to boost the current driving capability so drive up to 8 leds at once.

(3) probably uses the least hardware if you can spare 11 pins and don't mind having the Arduino doing the multiplexing.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6637
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

PS - if you want to try the shift register approach, take a look at the TLC5940 combined 16-bit shift register and LED driver, see http://www.ti.com/lit/ds/symlink/tlc5940.pdf. This chip can drive LEDs without the series resistors because it regulates the LED current itself.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks for all the help!!!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

on the TLC5940 combined 16-bit shift register and LED driver, would you mind giving an example of how this would work?
Logged

Southern California
Offline Offline
God Member
*****
Karma: 5
Posts: 539
I like blinky lights
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Here's an example:

http://www.arduino.cc/playground/Learning/TLC5940

Chris
Logged

http://en.wiktionary.org/wiki/magagna <-- My last name.  Pretty apt.

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks much smiley-grin
Logged

Pages: [1]   Go Up
Jump to: