How do I control a 4x4 led cube with an Arduino Duemilinove? None of the 'Ibles I've seen can help me?

maewert6 years ago
Looking at https://www.instructables.com/id/LED-Cube-4x4x4/step2/Multiplexing/, it appears that the design uses 16 output pins to control each of the 16 LEDs within a level and 4 more output pins to select the level.  The Duemilinove does not have this many (20) output pins.

The basic design is that the 16 pins supply a ground to the LEDs within the level that the user wants to turn 'on' and one of the 4 level outputs is set High to enable the LEDs in the level (I could have the revearsed but it is the same principle).  These four level outputs are set one at a time.  Since the design uses the MEGA which has plenty of output pins, there is enough to directly drive each level with an output pin.  If you wish to use the Duemilinove instead, then you might want to include a 2 to 4 line demultiplexer (such as the 74HC139).  Using this device, instead of needing 4 output pins for the level selections, you would only need two.

That brings us down to 18 output pins, which is still too many for the Duemilinove, but the same technique of using 2 to 4 line demultiplexor could be used to reduce the number of output pins to drive the LEDs in each level.  In the end the project could only need 12 output pins (or even fewer but this is enough to stop here for the Duemilinove).

The software would require a change as well, and the thing would kinda work like a television scanning beam, the software would very quickly scan through each of the LED groups lighting them briefly before moving onto the next group.  Doing this very quickly and the human eye will see the LEDs not as blinking but as on solidly (it has be at least 20 hertz or the eye will see the blinking, the faster the better). 

Since the LEDs are on for a short period of time they won't be very bright.  For this reason when we turn them 'on' we can actually drive them beyond their recommended limits since the ON time is so short.  This will increase their brightness... (not sure how this affects their livespan, depends on how hard ya kick them when ya kick them on.)

Best of Luck