3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

The 4x4x4 LED cube (Arduino)

The 4x4x4 LED cube (Arduino)
In this instructable I will show you how to make a 4x4x4 LED cube that will be controlled by an Arduino Demulionove. now yes you might say" that Arduino has only 14 I/O pins well also the 6 analog pins can be used as pins 15,16,17,18,19,20. that way giving us enough pins (16 columns + 4layers = 20 I/O pins)

This instructable is made for those who know how to solder (well) and how to program the Arduino. Also I will be providing detours to skip sum steps so if you see (Detour available skip to __ Step) you can follow if you are to lazy to do that.

 
Remove these adsRemove these ads by Signing Up
 

Step 1Get the materials

Get the materials
«
  • DSC09021.JPG
  • DSC09026.JPG
  • DSC09028.JPG
To start of you will need these materials:

Mandatory
-- 64 LED (color optional) **
-- Arduino Demulionove
-- Wire

Optional
--32 male pin strip
--PCB prototype board
--Fine Grit (400 +) sand paper

Your choice
-- 64 resistors or 16
you can get 64 resistors which will help by keeping all the lights at the same light out put regardless of how many are on but it will be considerably more work.

Tools:
--Computer
--Soldering Iron
--Solder
--thin nose pliers

**Color is optional but use this website to find the right resistor for your leds http://led.linear1.org/led.wiz (I got Green so I used 100 ohm resistors)
 
« Previous StepDownload PDFView All StepsNext Step »
78 comments
1-40 of 78next »
Apr 14, 2012. 8:45 AMgibsoncrazed14 says:
I'm brand new with arduino and i was curious to how you would upload the code on to it? any help will be appreciated. Also great work.
- Thanks
Mar 12, 2012. 4:34 AMstringstretcher says:
http://www.instructables.com/id/3X3-LED-Cube-Programming-tips-Arduino-based/
Feb 24, 2012. 10:21 PMalsetalokin says:
Well, I built a cube (from a different instructable) and uploaded the .pde, and it runs, and appears to make the correct patterns, I think... but I can't make heads or tails out of the pattern making strings. There are some weird brightness variations too.

There are sixteen "B0000" groups per line. One would think that each group corresponds to a vertical column, and the 0s and 1s indicate the plane, and whether the light is on or off.

But that's not how it seems to work for me, and I can't figure it out.

The java applet on makecode.html always prints the same line, sixteen B1111s, no matter what boxes I have checked. The only thing that changes is the duration number, which does correspond to what I enter in the box. But everything else is always B1111s.

Can you please help me understand the pattern strings?
Feb 27, 2012. 7:01 AMajvdmeij says:
I tried it in Safari and Chrome on a Mac and they work. I just saw that it didn't work in Firefox. I also tried it in Windows: IE also didn't seem to work. But Safari for Windows does the trick and I think )although I did't try) that Chrome will also work on a Windows computer.

I made the code in Dreamweaver and I will try to make it Cross-platform compatible but I can't promise anything: I am just an amateur!
Mar 2, 2012. 12:16 PMnaylson says:
ei grande me da awe umas dica como fazer ou me vende um
Feb 21, 2012. 1:57 PMajvdmeij says:
I have just built the cube and it is working great. You can see it here: http://www.youtube.com/watch?v=TwlSijShbbc 

Making the code for great patterns is kind of difficult, so I made a little Javascript program to make designing them more easily. It basically works as follows. You see four squares: the first square is the front layer, the second, the one behind that, the third the one behind that and the last is the back layer. You can set the LEDS on or off and when you have made a pattern, and have set a time in a text box, you can write it to a text area. Then make another one, and another one and.. When you are finished, you can copy the contents of the text area and paste it in the Arduino Code. Then go for it!

Try it here: http://home.kpn.nl/ajvdmeij/makecode.html. If you want the source code, you can copy it or tell me and i will mail it to you.

Have fun!

twitter.com/arjanvandermeij
Feb 19, 2012. 1:48 AMtboultwood1 says:
Thank you ever so much for a great tutorial, i just made a 3x3 3mm red because I had no other LEDs :S So I just ordered a bag of 100 Blue! Thanks again and hope to see more of you in the future.

Trevor B
Dec 30, 2011. 6:28 AMvishalapr says:
I am making another cube and this time I am confused on the resistors bit...

I have a question...I am using these LEDs...

http://www.ebay.pl/itm/110783289032?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649#ht_1456wt_1139

I have resistors of all the values from 1 ohm to 1 mega ohm....in 10's ....
So which resistors will I need to use for those LEDs? The cube is connected to an arduino nano...

plz help :)
Jan 18, 2012. 3:36 PMawang8 says:
100ohm resistors should work.
Jan 11, 2012. 1:52 PMBruno Silva Pinheiro says:
Please, could you post pictures of the links in Arduino, would help greatly.
Oh, and if you have the electronic circuit, would be great.

Thank you.

Great project, congratulations!

Jan 8, 2012. 2:42 AMjwgillon says:
If anyone has expanded on the code, please post it!
Feb 4, 2011. 12:54 PMsupernova12 says:
This cube is awesome, I just built it as my first project with my new arduino and it works great :). Thanks so much for the code, I honestly couldn't be bothered writing all the patterns myself.
Jan 7, 2012. 1:21 AMjwgillon says:
Great instructable! Could you post the java app in its current state?
Nov 22, 2011. 7:12 AMjoris14 says:
Do you have finish the program that generate the code ?
It will be very helpful for me.

(sorry for my bad english)
Dec 18, 2011. 7:00 AMvishalapr says:
Could you help me with how the code works plz ? I get that we change the binary values for the LEDs and I can do that quite easily, but what does the rest of the code do? The instructions and help lines on the file don't really tell me what they are and why they are even there and not just the whole 10101 thing...

By the way,
This ible is awesome! It helped me a lot! Thx for the ible!
Dec 14, 2011. 10:42 AMDARKEG0 says:
Can you post picture how you connected all this to arduino please it would really help
Nov 27, 2011. 6:34 AMmarkie says:
Hi,
my english is not so good but this link helped me alot with my led cube ..

http://www.imagesco.com/led/LED%20Cube%20Instructions.pdf

gr mark
Nov 5, 2011. 2:22 PMjoris14 says:
Great instructable, Very cool project to do.
Nov 1, 2011. 11:09 AMvishalapr says:
I am done with everything, making and running the code and everything worked smoothly, but to change animations how can I program the cube? Becaues the last step is a bit hard to understand as I don't seen to know what u are talking about, how can I change the program to light up a certain LED at a time, or a couple of LEDs at a time?

Thanks
Dec 8, 2010. 3:46 PMemihackr97 says:
i dont understand, doesn't Arduino only have 3 GROUND PINS??
how cmoe you connect 4 different wires to it, please answer.
Jul 18, 2011. 2:03 PMlookwhatjoeysmaking says:
yes it only has 3 gnd pins.althoght you can use the digital pins as gnd to.
To set a pin to GND:

pinMode(pin,OUTPUT);

digitalWrite(pin,LOW);

i thought the same thing at first but then someone helped me so.
Nov 1, 2011. 10:54 AMvishalapr says:
Im still a little confused, I got everything figured out, but how can I ser the 4 pins (LedPin1 , LedPin2, LedPin3, LedPin4) to Gnds?
Thanks
Jul 19, 2011. 1:11 PMemihackr97 says:
Thanks, I knew it all ready, but didn't knew it back then.
Dec 8, 2010. 5:30 PMMike32526 says:
the 4 diff coms are so you can turn on an individual level with out turning on that whole colum of leds just the one on that level u wish to come on


Mike
Dec 8, 2010. 7:21 PMemihackr97 says:
yeah, i know that, but, arent the Level pins supposed to be ground???
as far as i know, those pins can supply V out but not gnd, in confused.
Do you understand me??? can you explain me how these work??
Dec 8, 2010. 8:34 PMMike32526 says:
All your pin on ur arduino can be manipulated to do any thing for example +5v (HIGH) or 0 volts (LOW) (gnd) by useing somryging like: digital.Write(2,LOW); Or something of that nature to tell the pin hey go gnd or go positive, Dont do this as a power Source!! As this will blow i/o pins and/or the micro processor( the brain of it) Leds pull very little so they are semi safe to use. The resistor is to protect the arduino from the led pulling to much as it limits the power it can draw from the pin.

The i/o pins are very universal in use i begin to love my arduino more and more every day!!

Mike
Dec 9, 2010. 8:02 PMemihackr97 says:
thanks for the explanation, I thught that telling the pin to go LOW just disconnected it, but now I understand.
also, I think that the resistor is not to protect the arduino, but the LEDs, since they are normally 3v and the Arduino is 5.
Dec 10, 2010. 5:49 AMMike32526 says:
the led will pull alot of milli amps as well possible to over load the i/o pins capable out put so the resistor limits how much it can pull. yes also protects led but the i/o pin isnt capable of suppling enough ma to blow the led any faster...
Dec 11, 2010. 10:51 AMMike32526 says:
Post some videos id love to see it i to hope to make one that big i mave accomplished the 4x4x4 and is great
Nov 1, 2011. 6:12 AMJiax says:
I don't get how you connect wires to arduino.
My leds will just blink as random and not in order when I use the code. 'Cause I wired them up just randomly. Which ports should I be using?

There is something I do wrong, but I don't know what. Please help!
Sep 11, 2011. 12:28 PMdunnos says:
I finally figured out the code :) it's really well written! I've been wanting to learn bitmath :)

Still I don't understand 2 things:

1) EndTime = millis() + ((unsigned long) DisplayTime) * TIMECONST;
why this unsigned long?
2) #define TIMECONST 20 // multiplies DisplayTime to get ms - why not =100?

..
why not?
Aug 5, 2011. 11:25 AMForgerOfPie says:
If you need resistor values for your LEDs, ledcalculator.net is a great resource.
Jul 17, 2011. 8:44 AMQtechknow says:
How do you connect all the layers into columns?
May 7, 2011. 2:37 PMmichaeljudge says:
Can anyone provide a link to the source code? Also does the cube have to be set up a certain way? Thanks in advance.
Mar 14, 2011. 8:27 PMTheWaddleWaaddle says:
*Duemilanove
Feb 21, 2011. 8:25 PM4and20chars says:
I love this instructable but I have a few questions. The first is, why did you not use transistors on the cathodes. The second question is how did you calculate the resistor needed for each LED? Lastly, without resistors on the ground pins, is the arduino still protected or are they only needed with transistors. Sorry for the long list, theses were the only things I was unsure of after scouring the internet. Thanks.
1-40 of 78next »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
28
Followers
2
Author:forte1994