Build your own LED cube
This month’s featured Gadget Master is provided by an old favourite of the blog, Peter Griffiths. He shares all the details necessary to build your own 5 x 5 LED cube.
Construct your own programmed light display
Once again, the project is fully documented in terms of parts and the build process, and Peter provides a number of photos to help navigate construction.
The project also includes a ready to program HEX file with some demo cube animations and also the source code. The firmware implements a simple macro drawing processor command set, so if you’ve got some programming skills you can create your own animations for the cube, says Peter.
Although the project uses a PCB, the original prototype was constructed on a prototype pad board so if you’re not able to make your own PCB it’s still possible to make this project yourself.
Do a search on YouTube and you’ll turn up literally dozens of video clips of LED cubes, small 3x3x3 cubes, bi-colour, RGB and mono cubes, amazing 16 x 16 x 16 RGB cubes. However, very few show you how to make one and provide the firmware.
The cube described on this page uses a 5 x 5 x 5 matrix of single colour LEDs. This is a good size to experiment with as the number of LEDs required at 125 keeps the cost down, doesn’t take too long to assemble and just fits onto a eurocard sized PCB. The power requirement is under 1 amp and the use of just one colour keeps both the hardware construction and control software fairly simple.
Peter provides a full circuit description:
The LED cube is made up from 125 LEDs arranged into 5 layers of 25 LEDs each. The display itself is multiplexed so instead of requiring 125 connections it requires one to each of the five layers and 25 to each LED in a layer making a total of 30. The cube is refreshed by a software interrupt routine with each layer active for 2ms, so the entire cube is refreshed every 10mS (100Hz). This results in a display with no visible flicker.
Only 8 I/O lines are needed to control the LED drivers for the cube which allows a tiny 14 pin PIC 16F688 microcontroller to control the whole cube. This micro has an internal 8Mhz clock and 4Kwords of program memory.
Each of the LED layers is arranged in a 5 x 5 matrix and controlled by a transistor in an emitter follower configuration connected to the LED anodes. When the respective layer control output from the PIC goes high the base of the transistor is held at +5V and the emitter sits approximately 0.7 volts below this. The transistors used are BC637 NPN transistors, if an alternative is used it should be of similar specification, have an Ic rating of at least 1 amp and check the pin out.
A HEX file is ready to program directly into a PIC 16F688. There is a zip file that contains the source code which you can modify or just view to see how it works. If you are going to modify the code, however, Peter recommends you download and install the Microchip MPLAB IDE which will allow you to edit, modify and program the PIC seamlessly. Note that a pre-programmed PIC is availble from an on-line shop
The full URL for the project is picprojects.org.uk/projects/lc/index.htm