Instructables
loading
loading
Picture of LED Cube 8x8x8
Create your own 8x8x8 LED Cube 3-dimensional display!

We believe this Instructable is the most comprehensive step-by-step guide to build an 8x8x8 LED Cube ever published on the intertubes. It will teach you everything from theory of operation, how to build the cube, to the inner workings of the software. We will take you through the software step by step, both the low level drivers/routines and how to create awesome animations. The software aspect of LED cubes is often overlooked, but a LED cube is only as awesome as the software it runs.

About halfway through the Instructable, you will actually have a fully functional LED cube. The remaining steps will show you how to create the software.

A video is worth a thousand words. I'll just leave it up to this video to convince you that this is the next project you will be building:


I made this LED cube together with my friend chiller. The build took about 4 days from small scale prototyping to completed cube. Then another couple of hours to debug some faulty transistors.

The software is probably another 4-5 days of work combined.

 
Remove these adsRemove these ads by Signing Up

Step 1: Skills required

Picture of Skills required
At first glance this project might seem like an overly complex and daunting task. However, we are dealing with digital electronics here, so everything is either on or off!

I've been doing electronics for a long time, and for years i struggled with analog circuits. The analog circuits failed over half the time even if i followed instructions. One resistor or capacitor with a slightly wrong value, and the circuit doesn't work.

About 4 years ago, I decided to give microcontrollers a try. This completely changed my relationship with electronics. I went from only being able to build simple analog circuits, to being able to build almost anything!

A digital circuit doesn't care if a resistor is 1k ohm or 2k ohm, as long as it can distinguish high from low. And believe me, this makes it A LOT easier to do electronics!

With that said, there are still some things you should know before venturing out and building this rather large project.

You should have an understanding of:
  • Basic electronics. (We would recommend against building this as your very first electronics project. But please read the Instructable. You'll still learn a lot!)
  • How to solder.
  • How to use a multimeter etc.
  • Writing code in C (optional. We provide a fully functional program, ready to go)
You should also have patience and a generous amount of free time.

1-40 of 2886Next »
eccoecco13 days ago

Hi, I'd like to recreate the cube but on a large scale and would just like to know if it's possible to string together christmas lights or perhaps made of layers with something like this: http://www.canadiantire.ca/en/pdp/gazebo-net-lights-melbourne-collection-0523088p.html

If you build the right driving circuit (remember to use opto-couplers if using high voltage, such as triac output optocouplers tied to triacs if using 120V AC for the lights). It will be quite an undertaking, but possible.

Thanks for the reply. There's a hacklab here in Toronto that I'll take your suggestion to as i'll need it "translated". Thank you though.

Instead of soldering so many times with your arguably flawless technique :D somebody can also use a stripboard: http://en.wikipedia.org/wiki/Stripboard

Or you could use one of my cube base boards coupled with my improved construction method at http://www.instructables.com/id/CHRs-8X8X8-LED-Cube-Revisited-with-improvements/...

CIMG2863.JPGCIMG2875-2.jpg
Onurrr410 days ago

Hi , I'm a 17 year old high school student. Did your project , but I would be glad if you help 'and encountered an error . "Plane boing " effect on the horizontal burning at the same time passing 1-3-4-5-6-7-8 not as alone as 2 and 2, respectively . When voltage is Applied separately from the power supply to the sort order is burned separately. I would appreciate if you can help, thanks again .

make a video because I cannot understand what you mean.

use the power on self test from my arduino beta code in the revisited instructable http://www.instructables.com/id/CHRs-8X8X8-LED-Cube-Revisited-with-improvements/step10/How-do-I-modify-the-software-Questions-Answers-and/

TEXHO3 days ago
Hello, from Russia! I have one question: I started made cub 8.8.8 and interval for 23-25mm it's very small, cub = 160.160.160 mm, how max intervals I must make do it? Led one to one that on your videos. Distance from man and cub ~ 4 meter. Thank you! Sorry for my English.

That's about the size of my cube. From that distance it should still look OK, but you can of course space them out as much as you want running stiff wire between them - but you may lose the effect if the spacing is too great.

dvbergeryesterday

Love your work.

Something I'm not following is your LED calculation. Most blue 3mm led's that I see have a forward voltage of 3 or 3.4 volts. With a 5V supply, a 3.4 volt LED and a 100 ohm resistor, aren't we going to draw 16mA per LED [5-3.4=1.6/100=.016a]. You suggested you shouldn't go over 50/8 = 6.25 mA per LED. While 16mA stays beneath the 25mA of the latch chip, don't 8 of them give 128mA exceeding the 50mA ground sinking ability of the chip?

What am I missing? Is that a 4.4v LED-> 5-4.4/100 = 6.25mA??

Little help would be appreciated!

Best,

David

So many have asked this, and nobody reads the comments for the answer first.

This is why I created an entire step discussing this in my "revisited" instructable. Please read the page at http://www.instructables.com/id/CHRs-8X8X8-LED-Cube-Revisited-with-improvements/step13/More-Improvements-the-2N2222-/

DrewP49 days ago

Sorry for the basic question, but do you have to have both the USBtinyISP and the RS232 to program the cube, or would one of them work by itself? Thanks!

The RS232 is not used to program the chip - it's for letting the cube be controlled by a serial device such as a PC instead of running as a standalone device.

danieltos9 days ago

I have made an oddly shaped cube - 14 x 6 x 6 cathode layers. Is it correct that I need 12 multiplexers to run the 504 leds? Since there are 84 anodes + 6 cathodes (90 / 8 "multiplexer channels" = 11.25)

I guess I need two tc138 too then?

I am also wondering if I can use 74HC573 instead of 574?

Thanks for the help!

The math for the matrix on that is going to be strange to say the least, but you are going to need at least 11 demultiplexers assuming a parallel layer control which is what we use here...we don't use the demultiplexers to control the layers, so it's 84 outputs, not 90, and yes, using two 138's will make life easier - your MSB (most significant bit) will go into an active low enable on the first chip, and an active high on the other, with the 3 data bits going in parallel to both chips. As for the chips, one is level triggered, one is edge triggered. In this specific circuit, I don't think you would see a difference, but if you want to be sure, use the 574.

Anesa21 days ago

Hi, I have some problem with the cube's programming. I installed the driver and the usbtinyisp can communicate with the chip. But when I tried to set the cube, in the cmd i read something like "change ... 0i ... (y/n)". I writed "n" and from this moment, when I try to communicate to the Atmega 32, the cmd tell me "connection failed, rc=-1"

You are going to need to be much more precise in exactly what you are typing, exactly how it's hooked up etc. The more vague you are, the less we can help.

I'm sorry for the lack of information, but I am new in the world of programming and I'm trying to learn.
I have built two cubes at the same time, 4x4x4 and 8x8x8. The target was to test the programming on small cube, and after programming the 8x8x8 cube.
For programming the small, I downloaded the driver and WinAVR. I connected the USBtinyISP to the cube and I started the programming procedure according to tutorial and everything worked well. During the procedure for set the fuse bytes, the cmd it gave me an answer like "change 0 with __ (y / n)" (unfortunately I have not annotated the exact wording) and I said "n". From that moment I can't communicate with the chip (initialization failed, rc = -1)

again, you are not indicating your exact commands, and WinAVR commands are command line based and don't allow for Y/N inputs, so I need to know EXACTLY what you did and with what program or command to even begin to know whaere ytou went wrong

I used the cmd of my pc and not WinAVR for programming. Unfortunately I did not write the text that appeared, so I can't give more information. My idea is that the USBtinyISP has some problem.

It's WINAVR that allows the command line commands required to program the chip (such as MAKE and MAKE INSTALL etc.) if you want to compile your own code - otherwise you need AVRDude or AVRDudess (GUI for AVRDude) to transfer pre-compiled code - so the question is - what commands did you use EXACTLY (because a 0 vs an O can be a huge problem etc) and what was the exact response of the command used. If you don't remember, then try the command again, and screenshot or write down the responses. Once I can see exactly what you are doing, and exactly what the response is, then I can help. If you don't have the necessary software, you can download my complete collection of warez for this project at www.supertech-it.com/RAMP.zip - you can also visit my "revisited" instructable and check out the troubleshooting sections.

Thanks!!!! Now I try again and also look yours instructable

if you download my command base from the CD I supply with my boards, I would highly suggest you use Init_AVR again. If you don't have my CD, I suggest downloading it at www.SuperTech-IT.com/RAMP.zip

SebastianI21 days ago

hello, I have a question 74hc574 pin 1(OE) serves to connect and to where , thanks

İ made that cube but have 2 problems.first one leds arent shiny.second one cube stopping to work.used atmega32a

You are going to need to be much more precise in exactly what you are typing, exactly how it's hooked up etc. The more vague you are, the less we can help.

Could I use a USB-to-Serial FTDI breakout (https://www.sparkfun.com/products/9716) in place of the RS232-to-Serial chip? This would eliminate the need to run the cube off of an older Serial port/computer. I would also have to change the crystal, too. Any thoughts?

What is easiest is to use a USB to TTL serial adapter/dongle (about 2 bucks on ebay) and completely eliminate the MAX232 chip, connecting the adapter's TX line to the ATmega32 RX line (pin 14) and the RX line of the adapter to the TX line of the ATmega32 (pin 15) and ground to ground.

If you change the crystal of the ATmega, you need to change the speed in the MAIN.H of the code, or the serial won't work.

For example, 16MHz crystal with 38400 baud looks like this

// Define USART stuff

#define FOSC 16000000

#define BAUD 38400

#define MYUBRR (((((FOSC * 10) / (16L * BAUD)) + 5) / 10) - 1)

this section of the code makes using another crystal or a different baud rate very easy (not sure what the max baud is before you start getting errors)

My PC boards are designed to connect to USB to TTL adapters as I found this to be much easier than trying to find a computer with a serial port, or spending what it costs to get a USB to RS232 adapter.

Remember - the serial input is NOT FOR PROGRAMMING THE ATmega32 chip. It is only for running animation sequences from the PC (using PROCESSING or a similar language) and sending the cube frames to the cube serially.

TTL Serial.jpg

Could I just use the FTDI breakout from Sparkfun (above) instead of getting a different USB-TTL serial dongle? It looks like it does pretty much the same thing. The reason why I ask is because I already have the FTDI breakout for other projects.

Thanks for the help!

If you already spent the money on that one, sure. Same deal - TX to RX, RX to TX, and GND to GND. Ignore the other connections.

I just like the other dongles because they are only a buck.

http://www.ebay.ca/itm/USB-To-RS232-TTL-Auto-Converter-Module-Converter-Adapter-For-Arduino-S9-hv2n-/301019253456

my inital thoughts was upgrade to the 32 n i bought one but now you hav sorted all de probs with that i thik my next project has to be the rgb version for me building the circuit and putting it together that way is what i like doin problem is i need a good schematic.Any thoughts on that

I reference 2 RGB LED projects that I based my circuit on, and each of those projects have full schematics and circuit explanations.

You may want to consider the amount of work that my board replaces though...LOL

RGB Ver3 Rev5.1 with UNO Eliminators.jpgwired mess RGB cube 3.jpg

Sure your board does replace a lot of work and i would be interested in purchasing one depending on the price as i don't really have alot of spare cash at the moment.What do the cost.

visit TheLEDCube.com for pricing and ordering

Still interested in buying 1 of your boards

Hello, will I have the same problem you would not send it to me already in the file with extension .sch? Please send me email apple367@me.com

iwanmanew made it!28 days ago

https://youtu.be/6gkPlRrB8fo - mine cube ! Thanks for the great tutorial!

11180000_10207216045066079_1651041717_n.jpg

I want to start saying that this guide is totally awesome!! Following it i made my own LED Cube and it's fantastic! Now i'm trying to upload some effects. All is going well, but i have some problems with the 60th step. I'm running my cube with an arduino uno, and all effects work fine! But the shrink_grow effect (the woopwoop works!) is giving me some problem because i can't shrink the cube down to each of the 8 corners, even though i tried all the combination beetwen the ROT and FLIP parameters. The code screeshots aren't completed so i wrote the last part of the code by myself. I hope the problem are some rows of code written in the wrong way. Can someone help me please?

Thanks a lot and congrats again for the great work done!!

In void loop() I call the sub in this way:

for(int ii=0;ii<8;ii++)
{
effect_box_shrink_grow (1, ii%4, ii & 0x04, 450);
}

this is the code i'm using:

void effect_box_shrink_grow (int iterations, int rot, int flip, int delay)
{
int x,i,xyz;
for (x=0;x<iterations;x++)
{
for (i=0;i<16;i++)
{
xyz = 7-i; //this reverses counter i between 0 and 7
if (i > 7)
{
xyz = i-8; //at i > 7, i 8-15 decomes xyz 0-7
}

fill(0x00);
delay_ms(1);
cli(); //disable interrupts while the cube is being rotated
box_wireframe(0,0,0,xyz,xyz,xyz);

if (flip > 0) {mirror_z();} //upside-down
if (rot == 1 || rot == 3) {mirror_y();}
if (rot == 2 || rot == 3) {mirror_x();}

sei(); //enable interrupt
delay_ms(delay);
}
}
}

Hi i have this effect running also on the Uno im no expert with code (far from it) but this works for me,also this is not my code i just can't remember where i got it from to give you the link or the credit to the person who wrote it,but it's worth a try.

Call it in loop as below

unsigned char ii;
for (ii=0;ii<8;++ii)
{
effect_box_shrink_grow (1, ii%4, ii & 0x04, 1000); // (int iterations, int rot, int flip, int delay)
}

Define it as below

void effect_box_shrink_grow (int iterations, int rot, int flip, int delay)
{
int x, i, xyz;
for (x=0;x<iterations;++x)
{
for (i=0;i<16;++i)
{
xyz = 7-i; // This reverses counter i between 0 and 7.
if (i > 7)
xyz = i-8; // at i > 7, i 8-15 becomes xyz 0-7.

fill(0x00); delay_ms(1);
cli(); // disable interrupts while the cube is being rotated
box_wireframe(0,0,0,xyz,xyz,xyz);

if (flip > 0) // upside-down
mirror_z();

if (rot == 1 || rot == 3)
mirror_y();

if (rot == 2 || rot == 3)
mirror_x();

sei(); // enable interrupts
delay_ms(delay);
fill(0x00);
}
}
}

you also need to add these functions

void mirror_x (void)
{
unsigned char buffer[8][8];
unsigned char y,z;

memcpy(buffer, (char*)cube, 64); // copy the current cube into a buffer.

fill(0x00);

for (z=0; z<8; ++z)
{
for (y=0; y<8; ++y)
{
cube[z][y] = flipbyte(buffer[z][y]);
}
}
}
// Flip the cube 180 degrees along the y axis.
void mirror_y (void)
{
unsigned char buffer[8][8];
unsigned char x,y,z;

memcpy(buffer, (char*)cube, 64); // copy the current cube into a buffer.

fill(0x00);
for (z=0; z<8; ++z)
{
for (y=0; y<8; ++y)
{
for (x=0; x<8; ++x)
{
if (buffer[z][y] & (0x01 << x))
setvoxel(x,7-y,z);
}
}
}

}
// flip the cube 180 degrees along the z axis
void mirror_z (void)
{
unsigned char buffer[8][8];
unsigned char z, y;

memcpy(buffer, (char*)cube, 64); // copy the current cube into a buffer.

for (y=0; y<8; ++y)
{
for (z=0; z<8; ++z)
{
cube[7-z][y] = buffer[z][y];
}
}
}

1-40 of 2886Next »