introLED Cube 4x4x4
introLED Cube 4x4x4
Knowledge list:
Component list:
Running a wire to the anode of each led would obviously be impractical, and would look really bad.
One way to get around this, is to split the cube into 4 layers of 16x16 LEDs.
All the LEDs aligned in a vertical column share a common anode (+).
All the LEDs on a horizontal layer share a common cathode (-).
Now if i want to light up the LED in the upper left corner in the back (0,0,3), I just supply GND (-) to the upper layer, and VCC (+) to the
column in the left corner.
If i only want to light up one led at a time, or only light up more than one layer at the same time.. this works fine.
However, if I also want to light up the bottom right corner in the front (3,3,0), I run into problems. When I supply GND to the lower layer and
VCC to the front left column, I also light up the upper right led in the front (3,3,3), and the lower left LED in the back (0,0,0). This ghosting
effect is impossible to workaround without adding 64 individual wires.
The way to work around it is to only light up one layer at a time, but do it so fast that the eye doesn't recognize that only one layer is lit at any
time. This relies on a phenomenon called Persistence of vision.
step 3Making the cube, template
Soldering grids of 4x4 LEDs freehand would look terrible!
To get 4 perfect 4x4 grids of LEDs, we use a template to hold the them in place.
I wanted to make the cube as easy as possible to make, so I chose to use the LEDs own legs as much as possible. The distance between
the lines in the grid was decided by the length of the LED legs. I found that 25mm (about an inch) was the optimal distance between each led
(between the center of each led that is!) to enable soldering without adding or cutting wire.
Find a piece of wood large enough to make a 4x4 grid of 2,5cm on.
Draw up a 4x4 grid of lines.
Make dents in all the intersects with a center punch.
Find a drill bit that makes holes small enough so that the led will stay firmly in place, and big enough so that the led can easily be
pulled out (without bending the wires..).
Drill the 16 holes.
Your ledcube template is done.
Create a layer:
Put in the LEDs along the back and along one side, and solder them together
Insert another row of LEDs and solder them together. Do one row at a time to leave place for the soldering iron!
Repeat the above step 2 more times.
add cross bracing in the front where the led rows are not connected.
Repeat 4 times.
Put one layer back in the template. This will be the top layer, so choose the prettiest one :)
Put another layer on top, and align one of the corners exactly 25mm (or whatever distance you used in your grid) above the first layer. This is
the distance between the cathode wires.
Hold the corner in place with a helping hand and solder the corner anode of the first layer to the corner anode of the second layer. Do this for
all the corners.
Check if the layers are perfectly aligned in all dimensions. If not bend a little to adjust. Or re-solder of it's the height distance that's off. When
they are perfectly aligned, solder the remaining 12 anodes together.
Repeat 3 times.
i
step 6Choosing resistor values
There are two things to keep in mind when choosing a resistor value for your leds.
1) The LEDs
2) The AVR
You also don't want to exceed the maximum current your leds are rated to.
I used 220 ohm resistors on my cube. This gave me about 12mA per led.
The RS-232 interface is optional. and can be omitted. That is IC2 and all the components connected to it. Future firmwares will enable PC
communication..
Start by laying out all the components on you circuit board in a layout that enable all the components to connect with a minimal amount of
wires. If everything fits, solder the circuit.
I won't give any more instructions on this, as the circuit probably will look very different from cube to cube, depending on the size of the
circuit board etc..
Information on how to wire the cube to the controller circuit is in the next step.
i
last photo ←
step 8Wire up the cube
Pictures explain this better than words. Please see the pictures.
You can use my code, write your own or build on my code and make more effects.
If you make your own effects, please send me the code. I'm eager to see what you guys make!
If you want to use an ATMega32 instead of the ATMega16, just change the mcu setting in the Makefile and recompile (type make). If you use
the m32 and don't do this step, the cube won't boot properly (the red and green lights will keep blinking forever).
You should now have a file named main.hex in the source directory.
The next step will show you how to get that code into your cube.
http://savannah.nongnu.org/projects/avrdude/
http://www.ladyada.net/make/usbtinyisp/
http://www.adafruit.com/index.php?main_page=index&cPath=16
My examples will be on an Ubuntu Linux system. The procedure should be pretty much identical on
Windows, but I can't help you with that. If you use another programmer, read thet manual for that
programmer and avrdude.
First off, Let's just see if we can make contact with the AVR.
By now, the cube should reboot and start doing stuff. It will be running at 1mhz (very slowly) using it's
internal oscillator. And some of the leds won't work, because some GPIO ports are used for JTAG by
default.
To enable the external oscillator and disable JTAG, we need to program the fuse bytes:
run "avrdude -c usbtiny -p m16 -U lfuse:w:0xef:m"
and "avrdude -c usbtiny -p m16 -U hfuse:w:0xc9:m".
Be carefull when doing this step! If you get it wrong, you can permanently destroy your microcontroller! If
you are using another microcontroller than the ATMega16, be sure to read the datasheet carefully before
changing the fuse bytes!
After writing the correct fuse bytes, the cube should reboot and start operating at regular speed
with all leds operational.
i
last photo ←