loading
*Note* This project is done by students from Singapore Polytechnic
4x4x4 LED Cube

This fun pet project is using Arduino with 64 LED to display any patterns of your choice.
This idea was giving by our Final Year Project Supervisor, Mr Teo Shin Jen. 

Components used :
1 Arduino
64 5mm LED of any of your favorite colour
Blue Tack (To stick the LED on for easier soldering)
Wire
Molex Pins and headers.

The tools and components were provided by our FYP supervisor Teo Shin Jen.

Instructions:
1. Solder up 4x4x4 LED together
2. Connect up the pins to Arduino
3. Code used







Step 1: Soldering the 64 LED Together

Concept of this LED Cube :

(First layer of the cube is from the bottom and the fourth layer of the cube is at the top)
Layer 1 and layer 2 positive side of the LEDs are connected.
Layer 2 and layer 3 negative side of the LEDs are connected.
Layer 3 and layer 4 positive side of the LEDs are connected.
Layer 1 and layer 4 negative side of the LEDs are connected.

All in all, the total number of pins this 4x4x4 LED cube used is 16.

Soldering of the 64 LEDs :

Start by soldering layer by layer. Bend the negative/positive side of each LED and join them together. Place the LED upside down and stick them on BlueTac so they are stable upright. (Easier to solder)
After finishing up 4 layers, join them up using wires and solder everything on a strip board.
This strip board will act as a shield for the Arduino.

Step 2: Connect Up the Pins to Arduino

Arduino Pins

Basically, all the digital pins of the arduino are going to be used and 2 analog pins (A0 and A1) will also be used.
The positive side of layer 3 and layer 4 will be digital 0-3
The negative side of layer 2 and layer 3 will be digital 4-7
The positive side of layer 1 and layer 2 will be digital 8-11
The negative side of layer 1 and layer 4 will be digital 12-13 and A0-A1 

(If you want to make the wires look neater, you can use molex pins to connect the wires to the shield)

Step 3: Code Used

void Light (int);

void setup() {                  
  for (int i=0; i<16; i++)
    pinMode(i,OUTPUT);
}

void loop() {
 
 Light(1);
  delay(50);
  Light(0);
  delay(50);
  Light(2);
  delay(50);
  Light(0);
  delay(50);
  Light(3);
  delay(50);
  Light(0);
  delay(50);
  Light(4);
  delay(50);
  Light(0);
  delay(50);
  Light(3);
  delay(50);
  Light(0);
  delay(50);
  Light(2);
  delay(50);
  Light(0);
  delay(50);
  Light(1);
  delay(50);
  Light(0);
  delay(50);
  Light(2);
  delay(50);
  Light(0);
  delay(50);
  Light(3);
  delay(50);
  Light(0);
  delay(50);
  Light(4);
  delay(50);
  Light(0);
  delay(50);
  Light(3);
  delay(50);
  Light(0);
  delay(50);
  Light(2);
  delay(50);
  Light(0);
  delay(50);
  Light(1);
  delay(50);
  Light(0);
  delay(50);
 
}

void Light(int x)
{
  switch (x)
  {
    
    case 1: PORTD=B11111111;
              PORTB=B00000000;
              PORTC=B000000;
              break;
             
    case 2: PORTD=B00001111;
              PORTB=B00110000;
              PORTC=B000011;
              break;
             
    case 3: PORTD=B00000000;
              PORTB=B00111111;
              PORTC=B000011;
              break;
             
    case 4: PORTD=B11110000;
              PORTB=B00001111;
              PORTC=B000000;
              break;
             
   
  }
}


By changing the binary you can get different LED to light up.
The default binary is PORTD = B11110000;
                                      PORTB = B00110000;
                                      PORTC = B000011;

So if you wan specific LED to light up u have to invert that particular bit of the binary.


Step 4: Final Product


<p>Maybe could interest to somebody the following link:</p><p><a href="http://www.lanzanos.com/proyectos/led-cube-4x4x4/" rel="nofollow">http://www.lanzanos.com/proyectos/led-cube-4x4x4/</a></p><p>Translated by google:</p><p><a href="http://translate.google.com/translate?sl=es&tl=en&js=n&prev=_t&hl=es&ie=UTF-8&u=http%3A%2F%2Fwww.lanzanos.com%2Fproyectos%2Fled-cube-4x4x4%2F&act=url" rel="nofollow">http://translate.google.com/translate?sl=es&amp;tl=en&amp;js=n&amp;prev=_t&amp;hl=es&amp;ie=UTF-8&amp;u=http%3A%2F%2Fwww.lanzanos.com%2Fproyectos%2Fled-cube-4x4x4%2F&amp;act=url</a></p><p>Thank you.</p>
I have also made a 4x4x4 led cube inspired by you and i need help to display my name &quot;J ATIN&quot; on cube , can you please help me in making the code?http://www.youtube.com/watch?v=5gODIqwUPEk <br>
<a href="http://www.youtube.com/watch?v=5gODIqwUPEk" rel="nofollow">http://www.youtube.com/watch?v=5gODIqwUPEk</a>

About This Instructable

10,980views

13favorites

License:

More by DYSeow:"Solar" Air Conditioning My 4x4x4 LED Cube 
Add instructable to: