January 7, 2011

4 Min Read
The longest Instructable ever

Regular readers will know that I’m a big fan of Instructables.  Nearly every email I get from them has something interesting in it.  The latest one has an Instructable posted on January 1 for an 8×8x8 LED cube.  There are lots of 3D cubes on Instructables but this one really stands out because it’s so much larger and because with 73 steps it’s a pretty good electronics tutorial as well.

Controller

The cube is controlled by an AVR 8 bit microcontroller.  An Arduino would have been a logical choice, but then you wouldn’t get to learn about soldering to protoboards.  You might also chose to use in I2C I/O expansion part to get the I/O necessary for all those LEDs, but then you wouldn’t get to learn about TTL decoders and latches. The authors really went for the most basic and cheapest implementation possible, and it shows, with a total BOM of $67.  Of course it’s a lot more work and time spent to build it that way, but here at Gadget Freak HQ, economic efficiency is not a primary consideration!

The cube is driven in a multiplexed fashion, with one layer at a time illuminated.  Like a CRT (raise your hand if you remember CRTs) the layers are refreshed fast enough that the LEDs appear to be on continuously although they’re actually only driven with a 1/8 duty cycle.

Each layer has all 64 cathodes connected together, and each anode is connected to its own driver.  This requires 8 high current drivers, to select each layer in turn, and 64 lower current drivers, to select each LED within the layer.

The 64 anode drivers are created from 8 74HC574 8 bit latches along with a 74HC138 3-to-8 decoder to generate 8 latch selects from a 3 bit port.  In this way 11 digital I/O lines from the microcontroller can provide the 64 needed drivers for the LEDs in a layer.

The authors also investigate using shift registers.  This could be done with a single I/O port by chaining them all into one 64 bit  register but that would probably be prohibitively slow since the shifting would all have to be done in software.  Instead the authors use 8 I/O ports, one to each 8 bit shift register.  This only requires 8 shifts to load all 64 bits.  In the end the authors went with the decoder/latch scheme but provide schematics for both options.

LED array

The LED array is constructed in a similar fashion to other LED cubes, but with an array of this size it would be easy to end up with something leaning or misshapen.  The authors made a jig for creating the layers by drawing out a full size array on a board and drilling holes to hold the LEDs while they are being soldered.  Each cathode wire is bent over to connect to the cathode of it’s layer neighbor, and each anode is left pointing straight up so it can connect to the anode of the LED directly above it.

Software

The authors wrote some display software that runs right on the AVR.  These are simple effects like moving planes, growing and shrinking boxes, and moving text displays.  For more complex effects they connect the AVR to a PC, which does the calculations and renders into an 8×8x8 array, which is sent serially to the AVR (of course they built their own RS-232 cable).  These animations include 3D wave functions, fireworks, and of course Conway’s Game of Life in 3D.

Improvements

How could the cube be improved?  The driver could be simplified and made with fewer I/O pins by doing additional multiplexing.  For example the rows and columns of each layer could be multiplexed, reducing the microcontroller I/O requirements to3 bits for each dimension:  X,Y, and Z.  However that would be much slower, affecting the refresh rate for the cube, and each LED would have a duty cycle of 1/64 instead of 1/8, making them much dimmer.

You could substitute a more powerful microcontroller, like an mbed, for example.  Then all of the effects could be kept on the microcontroller, and you’d be able to telnet to it, or twitter to it, or design your effects in a browser via a WWW server hosted on the microcontroller.

The circuit could be simplified quite a bit by using an LED driver.  The TI TLC5947 is a good one that I have used.  It provides  24 channels, each individually dimmable via PWM. It has an SPI interface that allows you to specify a unique 12 bit PWM value for each channel, 4096 different brightnesses in all. Three of those would give you dimmable control over every LED in each layer, and would only require 2 pins of microcontroller I/O for the SPI port.

You could build the cube out of RGB LEDs.  Keeping the same layer multiplexing scheme, this would require 192 drivers for all of the anodes in a layer. 8 TLC5947s would drive all of these LEDs, although wiring them all together would be a challenge.

The main improvement I would make would be to build a PCB rather than use the protoboard.

Of course, all of these improvements would detract from the back-to-basics spirit of the original.

Steve Ravet

Design News Gadgeteer

Sign up for the Design News Daily newsletter.

You May Also Like