Sunday, 27 May 2012

4x4x4 LED Cube

I decided to make a LED Cube, based on Arduino and as minimalist and cheap as possible. In total the build was probably about €10 and took a couple of hours (mostly of soldering). Complete with a rat nest's of point to point wiring underneath (photos after the jump).


Materials bought:
  • 64 LEDs (I picked up 100 blue 3mm LEDs for €3 from ebay) 
  • Atmega168, or similar microcontroller (€3 from Radionics) 
  • Medium size PCB Protoboard (around €2 from ebay)

All of the below items I had bought in bulk before, but probably wouldn't cost much more than 3 or 4 euros altogether (when sourced cheaply):
  • 16Mhz crystal 
  • Button 
  • Switch 
  • 4x 100Ω resistors 
  • 2x 10kΩ resistors 
  • PCB terminals 
  • Female pin headers 
  • 2x 22pf capacitors.
  • Solder
  • Low gauge wire
  • Contact lens cases (for the feet)

The Build:

The build process was quite similar to most of the other 4x4x4 LED cubes out there, such as this one:
(Not My Instructable, I don't own anything, just linking for reference)

However, in my cube, the columns are low and the layer pins are high. This wasn't really planned and doesn't matter too much either way, except for the code later on. There are 16 column pins and 4 layer pins, with the resistors on the layer pins. This uses up all of the atmega168's 20 IO pins.

I wanted to add the button to allow different modes to be selected when the cube is powered on, this turned out to be really awkward, but after a while I managed to get it to work. The code designates the buttons pin to input in the setup, gets the number of presses (to select which mode to run) and then reassigns that pin to output. This lets me have input, while not needing to upgrade to a MCU with more pins or use a shift register.

The Code:

I haven't finished coding it yet, but here is a simple sketch with 6 modes:
The column and layer levels can be set by changing the variables at the start, as can what level the button is tied to. I just programmed the MCU with my Arduino Uno acting as an ISP, here is a guide:

Here's a video of each of the six modes.


  1. This comment has been removed by a blog administrator.

  2. This comment has been removed by a blog administrator.