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 2860Next »

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!5 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];
}
}
}

piddy0504 made it!15 days ago

I finally got round to finishing my cube and what a challenge its been.It currently runs on the 328P but i purposely left room on my board for it to be not to much hassle to upgrade to the Atmega32,but that is for a later date.I used Kynar wire through out my build as i think it is easier to solder and easier to keep track of where everything is going.Debugging was not to much of a pain as i tested all component before i soldered in place,however i still needed to replace 1 transistor and 4 LED and a couple of cold solder joints.Now its on to try and understand the code better so that i can add some real effects although i suspect this is not going to be as easy as the build.

IMAG0265.jpgIMAG0264.jpgIMAG0239.jpgIMAG0224.jpgIMAG0219.jpgIMAG0255.jpgIMAG0262.jpg

NICE JOB for a hand wired board! The cube is nicely made too. You can really tell when someone truly dedicates themselves to their work.Running Kynar to the layers is probably causing some dimming, but likely not enough to be an issue.

Hi again my cube has developed this strange problem.Looking from the front all led on back plane are lit although not at full brightness.However if i touch any metal part of the cube with my finger this problem goes away.I have tried everything to sort this out but no success.Any help as to what the issue might be would be appreciated.

Well, it's hard to say depending on what side of the cube you are assigning the designation "front". What I suggest you do is go to my "revisited" instructable and load in my code with the Power On Self Test (POST) and record the POST and put it on youtube so that I can see and diagnose the cube accurately. Get the code at http://www.instructables.com/files/orig/FKR/WRLW/H... (rename it to Arduino Beta Code.ino)

Thank you for your reply and help it is very much appreciated.I have uploaded the video for you to see hope it can shed some light on the problem.Also i have now just noticed that the Text effect runs from left to right i hadnt noticed this before now as i had not used these effects until now so i hope that its just a matter that i have the cube connected wrong way round.The video link is below.

https://youtu.be/GPgvDqq_ut4

What you call the front, is actually the back. Turn your cube around 180 degrees. It's actually the front plane that's screwing up (first bit of each 574 chip)

Easiest way to check is by checking continuity from pin 2 of the ATmega328P chip and pin 2 of ANY 74XX574 chip.

That is to say, the connection from the ATmega328P pin 2 (PD0 - RXD) and your incoming bus PIN 2 of the 574's (bit 1 or bit 0, depending on if you count 0 to 7, or 1 to 8). I think you will find it is floating / not connected.

A MILLION THANK'S you were spot on(once again) problem was no continuity from 328P RX pin and male header connecting it.I resoldered the connection and BINGO problem gone.Bonus,my cube is now positioned properly on the base.So Thank You once again for without your support for this project i'm certain there are many many people who have taken on the build who would still be struggling to complete it.

Thanks. This is why I created the Power On Self Test. It looks simple, but if you know how to interpret it, it's an invaluable tool for diagnosis.

Cheers thank you for kind words and of course your code,it has given me hours of pleasure and i am really happy with the finished product.I used your method of bringing the anode to the side of the LED as i think i worth the time and lends to a far neater build of the cube,although i used a different method for bending.Also i bought some LED samples before i settled on ones i was happy with and was happy to pay extra for quality.Turns out that the kynar is not an issue on the layers as i was concerned about it having read on some post that i might be a problem.The next step is to upgrade to the 32 and that will be another learning curve.Video quality on the link below is poor but i will give you a glimpse of it working.

https://www.youtube.com/watch?v=AB4YSmCuXQ0

amac_pt9 days ago
Hi,
First of all thank you for this project and all your instructions.

I started my project but I made a huge mistake... I changed anodes with cathodes :((((. So I've anodes on layers and cathodes on columns...

There's any solution to solve this mistake ? (Different from to build led cube again)

Thanks

There is - but it's some work, and a bit of recoding too. You will want to contact me by private message here so that I can give you my private email so we can coordinate this "repair".

Hi !
thanks for your answer. I decided to unmount the cube and do it again, it's a 5x5x5, so it was not so difficult to rebuild it.
ahmedcarpon10 days ago
Hello
Thank you for the project, excellent work.
Can i use ic 74595 instead of 74574?

You're basically asking if you can plug your 25 pin parallel printer cable into a 3 or 4 pin serial port. The short answer is NO - not in THIS circuit with THIS code.

Could you DESIGN a cube using this chip? Sure, you could design a cube and write all the code for a cube using this chip, the same way you could completely replace the parallel port in a printer with a serial port.

fake_cross12 days ago

Hello. I can not solve the problem, please help.

We have a minus (ground, GND) is common to a single layer (ie, all 64 LEDs hanging on one GND), power is supplied to the eight anodes (ie, taken separately column), and so for each column.For example, consider the work of two columns - I want to ignite in the first column of the 1st and 2nd LED, and the second column, only 1st LED.

How is it done? If power is supplied to the entire column, and minus (ground, GND) We submit on 1st and 2nd layer (ie. On the 1st and 2nd LED).

In such a situation should be lit and 1st and 2nd LED of both columns. It turns out that I can not light a single column on 1st and 2nd, and the second only 1st?

Thanks!

The layers are never connected to ground at the same time. We only ever draw 1 layer on the cube at a time, the we disable the outputs, load the data for the next layer, connect only that layer to ground, and re-enable the outputs. This is all done so quickly that it LOOKS like the whole cube is on, but in truth 2 layers are never enabled at the same time.

wojtek1332817 days ago

Snake 3D running in this cube:

http://www.youtube.com/watch?v=ERbs70HvVRs

power0001 month ago

hi , i have made CRR's led cube but something very strange is happening

there are led lighting that must not light. I have change emmitter with collector , i have use only one 2n222 as uperTech-IT says but nonthing good.

What have you used, atmega or arduino?

The Arduino is also ATmega in that the processor is an ATmega328P.

Most people prefer the ATmega32/32A/32L for this project though.

i use atmega

and of course i have place 8 pull up resistors on collectors ,6.2k

finally it works! there were many short circuits and tow transistor had electrik leak

Glad you got it all up and running! Hope to see a video of your cube in action!

https://www.youtube.com/watch?v=nrtCB4ZH8oo

1-40 of 2860Next »