I was trying come up with something impressive to write about, after having the blog dormant since July. I tossed around a lot of different ideas… Although I haven’t been writing, I’ve been dabbling in a number of different projects. None of them are really in a state I’m ready to write about. That brings me to something I saw a few months ago on MAKE:. Bre and associates had constructed a simple 3x3x3 led cube, re-purposing a POV toy to drive the leds.
I figured this would be a good easy project I could finish in a day, so I drilled out a piece of pine board and set to soldering up some 3mm leds. I wasn’t very careful, so the little matrices look kind of ugly, but it all works and you can’t see the wires in the dark!

It didn’t take very long to toss three of these nine led matrices together. Assembling them into a twenty-seven led cube was a bit trickier. I used some gator clips to hold parts of the cube while I soldered it. Eventually I finished all the connections and had a passable cube with fairly even spacing.

Assembling the matrix is a pretty straight forward task. All you really do is tie all the cathodes together. Each matrix will become one row in the finished cube. Electrically, the cube is built as a 3×9 array, three rows and nine columns. You could probably build it the other way around, anode rows and cathode columns, but it is easier to sink a large current than source it. I think the MAKE: software only lights one led at a time, since they’re relying on the microcontroller to both source and sink current. My design is a bit different. The mcu sources current to each anode column, and N channel fets sink current for the entire row. The N channel is easily able to sink a few amps, so the cube can light an entire row at once without having to multiplex the individual leds.
In order to keep the PCB layout simple, the connections are spread all over the place in terms of the registers inside the pic. It would have been cleaner to organize eight of the nine columns as a single 8bit register on the pic, leaving only one bit left over to deal with. Instead, I’ve created symbols for each column, and set them individually from 9bit numbers.

Each anode column is current limited by a 75 ohm resistor. The value chosen was rather arbitrary, since the leds have such a low duty cycle, a lower value would have afforded me more brightness when the cube is battery powered. I can tweak the brightness a bit in the software, changing the scan rate the rows are multiplexed at.

That’s pretty much it. I’ve found there’s not a lot you can do with only 3x3x3 and 1 color, but it’s still kind of fun. Trying to think in three dimensions while drawing the animation frames is kind of tricky. I started with excel, but that wasn’t very useful – I spent more time copy and pasting formulas than I did ‘drawing’. Luckily my buddy Dan helped me out with that. He whipped up an awesome little php script that lets you draw animations 27 leds at a time, and it formats the resulting numbers so I can copy and paste them right into the code.
There’s a few videos of the cube doing various things on my Youtube Channel. Here is perhaps the most interesting one so far.
Thanks for reading, and Happy New Year!

maran said:
cool project dude.
Just want 2 know how u program it in asm?
Daverrr said:
Very cool man.
thelulz.net » Happy New Year Extra said:
[...] sent in his LED cube matrix. The LEDs are wired in a matrix, so he can actually address them [...]
LSK said:
This should get multicolored LEDs and become a surreal Rubik’s Cube.
Dustin said:
I love these cubes. I have a new respect for them. My two partners and I build an 8x8x8 one-color matrix for an engineering class project. I wrote most of the 700 lines of C code, but they spent over 18 hours assembling the matrix. I guess the solderer did eventually get feeling back in his fingers.
eli from iran said:
hi
i’m realy eager to know more about your program and leds
i began a project like it but occured with some problems in its mechanic and programing
i wonder if you could help me
i worked with avr micros and bascom programing
i’m waited for your help
so thanks
gabriel said:
can you send me the .asm file please.
gcirvini@gmail.com
thanks
LED Cube | PyroElectro - News, Projects & Tutorials said:
[...] controlling the snake movements between LEDs. Don't miss the video of it in action. PyroFactor: Read Permalink | Email This [...]
jay-r said:
can i ask the complete details the partlis the schematic and the code of this project?