Instructables

4x4x4 LED Cube Arduino

Featured
After seeing all the different instructables for Led cubes i was still left with a lot of unanswered questions.  So after reading everything i could find this is what i got. I decided to make the instructable after building it...so ill try to recreate the process the best i can.

This cube is different from others for many reasons:
1. It connects directly to your Arduino.
2. It uses few components, so its relatively inexpensive.
3. Runs on code that's easy to write. or you can use the ones provided.
4. Everything can be bought at your local Radio Shack

Parts Needed:
  • 64 diffused LED Lights (it cost a lot less to order 1000 off ebay for around $20) (Also i used 3mm LEDs, but 5mm or 8mm would work to)
  • 16 220 resistors 
  • 4  22k resistors 
  • 4 NPN type Transistors 
  • 1-2 Perfboard (The kind with the little copper circles) (you only need one if you are good at compacting your soldering unlike me....)
  • 1 Arduino (I went ahead and bought a MEGA so there's room to expand fro future projects, however UNO has just enough i/o ports)
  • Insulated 22 gauge Wire
  • some craft wire 
In all the cost of this cube is relatively low at around $100 (according to where you get your parts)
the Arduino was the most expensive part at around $60 For MEGA and i think a UNO is around $30.
So if you already have a Arduino the cost is brought down to $40.

Knowledge Needed:
  • Basic electronics and soldering
  • Be capable of following directions 
Read the ENTIRE instructable before building design options mentioned in last steps.

Original video:



New code 6-10-13:


 

 
Remove these adsRemove these ads by Signing Up
gamma_french6 months ago
Hello,

This looks awesome! I see the potential of 3-D signs, clocks, and the list of possibilities is endless!

If one makes an 8 x 8 x 8 matrix, would multiple Arduinos need to be cascaded?

Thanks,

Gamma
jtmanders (author)  gamma_french6 months ago
It would be a lot simpler to just use multiplex circuits to get the needed amount of I/O ports. Go look up chrs instructable.
nstancil9 months ago
would you need different resistors if you have to use some analog pins?
jtmanders (author)  nstancil9 months ago
I don't believe so...since you are using them as digital pins
Sandman.Gor10 months ago
Thank you very much
My son and I rode this hub and was very good.
garyfritz11 months ago
FYI my son built the cube and the LEDs lit very dimly. I checked the voltages and determined there was a 2.4V drop across the LEDs and a 2.4V drop across the switching transistors, so there was almost no voltage across the 220ohm resistors == very little current driving the LEDs. The transistors weren't getting enough base current to switch fully. I swapped out the 22kohm resistors on the transistors for 2200ohm and then the LEDs lit up nicely. Not sure why you didn't encounter this -- maybe different transistor characteristics. We used 2N4401.

Also, be aware that just soldering the LED leads to the LEDs below them makes for very fragile joints. We keep having connections break. You should really make a mechanical connection (e.g. twist the wires together) and then just use the solder for an electrical connection.
twan111 months ago
hello,Each layer independent of the line?(l1,l2,l3,l4?)
jtmanders (author)  twan111 months ago
I don't really understand the question... If you mean each layer has it's own pin, then yes
(removed by author or community request)
jtmanders (author)  DELETED_Tangz1 year ago
Hi, thank you!
If you mean like turning one led on and off that's fairly easy to do. For instance say we want to turn on the lower left hand led.
Do something like:

Void loop(){
digitalWrite(ROW1, HIGH)
digitalWrite(COLUMN1, HIGH)

By doing this only one LED Is getting both a power and a ground. So only one will come on.
Hope this helps,
markie1 year ago
Nice cube and a good instructable!
I'm wondering, if i build an 8x8x8 led cube.. do i have to reprogram the whole thing or can i use your program with a few modifications?

greetz mark :)
jtmanders (author)  markie1 year ago
Thanks!
I'm not really sure to be honest, but just tinker with it and see if you can get it to work. The first two codes (Cube sequence 1 and 2) are just for 4x4x4 i know because i wrote them. But the other ones can probably be edited up. like the 3x3x3 code i included i have been trying for a while to get to 4x4x4 and it somewhat works, with the exception of a few animations. if nothing else search around the internet there's countless codes out there to play with. I know chr (see link) has a really cool code on his instructable. however i don't know if it would work with my setup or not.
If you figure anything out please share it with me.
Good luck,
http://www.instructables.com/id/Led-Cube-8x8x8/
Thanks for your help! and i will let you know if it works for me :)
TomTin1 year ago
Hi, I build the cube according to your design. Only thing i did different is that i used a Darlington transitor array uln2803A instead of the transistors you use.
When i run the testprograms all leds induvidually light up. But when I run the full show when one led should be lit up, the whole column lights up.

Help please
jtmanders (author)  TomTin1 year ago
I don't really know how transistor arrays work. But if the whole columns are lighting up then that means your opening up all four grounds (layers)
Hanni431 year ago
Hi, don't think I worded my question right, I use the analog pins for # 14-19 ,my question is ,due have to program the analog pins to output as digital.. ?or can I load your libary in without programing the Analog pins ? Thanks for your time..
jtmanders (author)  Hanni431 year ago
Ok, as long as you specify in the code which pin is which layer/column then it should work. its all according to which code you try to put on there.

When you download the code from here there are Five different one there. The first two (_4x4_LED_Cube_Sequence_1 and _4x4_LED_Cube_Sequence_2) i wrote myself and use basic commands to make it run. The part that needs to be changed according to how you set up your cube is the first things on top.
The C stands for column and L for layer. Refer to step 4 for column and layer numbers. This is what it looks like when you first open it.
int C1 = 13;
int C2 = 12;
int C3 = 11;
int C4 = 10;
int C5 = 9;
int C6 = 8;
int C7 = 7;
int C8 = 6;
int C9 = 5;
int C10 = 4;
int C11 = 3;
int C12 = 2;
int C13 = 1;
int C14 = 0;
int C15 = 14;
int C16 = 15;
int L1 = 16;
int L2 = 17;
int L3 = 18;
int L4 = 19;

so all you must do is change these. For example, change C15 to A0 rather than 14. as far as what part of the cube to put on the analog pins it does not really matter. For simplicity, i would just put C15 = A0, C16= A1, L1= A2, L2= A3, L3= A4, L4= A5.

In the other three codes just look for where the code specifies rows and layers and change them. Not all of them are in the same place or format. All are located before the Void setup.

Hope this helps. If you have anymore questions feel free to ask.
Good Luck!
Hanni431 year ago
Great instr ,have it almost finished ,great directions.Using an Uno & have just enough pins with the analog .Digital from 1 - 13 then have to use analog ,AO-A5 my question is which of the cube would you use the analog . Thanks very much for sharing your project..
Awesome ible man!! One of my first arduino projects was a 3x3x3 led cube. Led cubes have amazed me so often and in so many different ways. I had to unsolder my led cube after it barely survived two trips via public transport to the local museum for a tinkering festival. I was asked to place it at the Arduino section and it got more attention than the talking head and the roving robot made from an rc toy.
Again, I love your amazing instructable!!
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!