image1 image2 image3

HELLO I'M LiNuS|WELCOME TO MY PERSONAL BLOG|I LOVE TO DO CREATIVE THINGS|I PRESENT MY WORKS ON VLSI AND EMBEDDED

3D LED CUBE



4*4*4    LED    CUBE

This Article Focuses on:
  1. Why 3D LED Cube is so Fascinating?
  2. Requirements.
  3. Construction of Cube's Body.
  4. Wiring the Cube.
  5. Programming the Cube.
  6. Working/Implementation video.


1. Why 3D LED Cube is so Fascinating?



                      3D LED Cube is constructed with Light Emitting Diodes(LED's).The LED'S are placed in an Orderly fashion in 3-Dimensional space which resembles the form of a Cube.These LED'S are now programmed to glow in some pattern's specified by the programmer.By programming the 3D LED Cube the different styles of LED glowing patterns can observed,so this pattern's of glow attract's the Interest of Human's on to the 3D LED Cube. 



                        These 3D LED Cube's can be used in Advertising to gather the attraction of Customers onto their Product.It can be Used as a Display device i.e., we can show a 3D-Structure of objects by glowing the LED's. They can be also used for Home, Office, Parlour, Restaurant, Hotel and other's interior decoration purposes. These 3D LED Cube's provides an interactive environment also,so it can be used in Teaching fields, forgiving Demonstrations also. This 3D LED Cube has the Capability of Bringing ILLUSION OUT OF THE BOX by programming(we can construct our own objects by glowing LED's through Programming).


2.  Requirements:(We construct a 4*4*4 Cube)

  1.  64 LED's ( mayn't be all same colors).
  2. Connecting Wires.
  3. 16  -  100 ohm Resistors.
  4. additionally, a Soldering Gun.
  5. a Cardboard.
  6. Arduino microcontroller.

3. Construction of Cube's Body:
  1. Take Cardboard and punch holes such as the Led's should pierce into that half-a-way.




     2.  Point the LED's Anode(+) and Cathode(-) and Fold the Cathodes of all LED's  as shown.


        3. Place the LED's in the Holes of Card Board and Start developing the Layer.


A Real image


     4. Developing Layer connections
                   Connect the Cathode's of all LED's in a layer by soldering their joints, leaving all anode's 
unconnected.


       5. After developing second layer similar to first layer, Solder the anode's of first layer to the second layer.

SIDE VIEW OF LAYER CONNECTIONS


        6. After soldering all columns of layer's, we will have 16 COLUMN Connections and 4 LAYER Connections.
           

4. Wiring the Cube's Body:

       For wiring Refer this Graph by imaging the Cube and this is also useful for programming.



Point all Column wires(all 16) as above .


Wiring Image

You can follow the above Wiring's for Cube construction or you can go with your own.
Use 16 - 100ohm resistors while going for column connections.
When you go with your own wiring's you should declare those as Output's while programming in void setup().

Real connected image




5. Programming the Cube:

 ***Here is some code,you can use this***
*You can also write your own code by the help of graph above* 
*****A LED BLINKS ONLY WHEN LAYER IS AT GROUND(0) AND COLUMN IS AT HIGH(1)*****

//columns
  int column[16]={22,23,24,25,26,27,29,31,33,35,37,39,41,43,45,47};
//layers
  int layer[4]={A3,A2,A1,A0};

  int time = 250;
void layerglows1();
void layerglows2();
void layerglows3();
void layerglows4();
void alloff();
void pattern1();
void pattern2();
void spiralpattern();
void turnallon();
void setup()
{
  //declaration of row pins
  for(int i = 0; i<16; i++)
  {
    pinMode(column[i], OUTPUT);
  }
  //declaration of layer pins
  for(int i = 0; i<4; i++)
  {
    pinMode(layer[i], OUTPUT);
  }
}
void loop()
{
 layerglows1();
 delay(500);
 layerglows2();
 delay(500);
 layerglows3();
 delay(500);
 layerglows4();
 delay(500); 
 alloff();
 delay(50);
 layerglows4();
 delay(500);
 layerglows3();
 delay(500);
 layerglows2();
 delay(500);
 layerglows1();
 delay(500);
 alloff();
 delay(50);
layerglows1();
 delay(250);
 layerglows2();
 delay(250);
 layerglows3();
 delay(250);
 layerglows4();
 delay(250); 
 alloff();
 delay(50);
  layerglows4();
 delay(250);
 layerglows3();
 delay(250);
 layerglows2();
 delay(250);
 layerglows1();
 delay(250);
 alloff();
 delay(500);
 for(int i=0;i<3;i++)
  {
    digitalWrite(layer[i],1);
  }
 pattern1();
 delay(1000);
 alloff();
for(int i=0;i<2;i++)
  {
    digitalWrite(layer[i],1);
  }
  digitalWrite(layer[3],1);
  digitalWrite(layer[2],0);
  
  pattern1();
  delay(1000);
  alloff();
  digitalWrite(layer[0],1);
  digitalWrite(layer[1],0);
  digitalWrite(layer[2],1);
  digitalWrite(layer[3],1);

  pattern1();
  delay(1000);
  alloff();
  digitalWrite(layer[0],0);
  digitalWrite(layer[1],1);
  digitalWrite(layer[2],1);
  digitalWrite(layer[3],1);
  pattern1();
  delay(1000);
  alloff();
  delay(500);
  spiralpattern();
  pattern2();
  delay(1000);
}

void layerglows1()
{
  for(int i = 0; i<16; i++)
   {
     digitalWrite(column[i], 1);
   }
  for(int i=1;i<4;i++)
 {
  digitalWrite(layer[i],1);
 }
digitalWrite(layer[0],0);

return;
}

void layerglows2()
{
  for(int i = 0; i<16; i++)
   {
     digitalWrite(column[i], 1);
   }
  for(int i=2;i<4;i++)
 {
  digitalWrite(layer[i],1);
 }
 digitalWrite(layer[0],1);
digitalWrite(layer[1],0);

return;
}

void layerglows3()
{
  for(int i = 0; i<16; i++)
   {
     digitalWrite(column[i], 1);
   }
  for(int i=0;i<2;i++)
 {
  digitalWrite(layer[i],1);
 }
 digitalWrite(layer[3],1);
digitalWrite(layer[2],0);

return;
}

void layerglows4()
{
  for(int i = 0; i<16; i++)
   {
     digitalWrite(column[i], 1);
   }
  for(int i=0;i<3;i++)
 {
  digitalWrite(layer[i],1);
 }
 digitalWrite(layer[3],0);

return;
}

void alloff()
{
   for(int i = 0; i<16; i++)
   {
     digitalWrite(column[i], 0);
   }
   for(int i = 0; i<4; i++)
   {
     digitalWrite(layer[i], 0);
   }
}

void pattern1()
{
  int a=250;
  
 /* for(int i = 0; i<16; i++)
   {
     digitalWrite(column[i], 0);
   }*/
   digitalWrite(column[0],1);
   delay(a);
   digitalWrite(column[1],1);
   delay(a);
   digitalWrite(column[2],1);
   delay(a);
   digitalWrite(column[3],1);
   delay(a);
   digitalWrite(column[7],1);
   delay(a);
   digitalWrite(column[11],1);
   delay(a);
   digitalWrite(column[15],1);
   delay(a);
   digitalWrite(column[14],1);
   delay(a);
   digitalWrite(column[13],1);
   delay(a);
   digitalWrite(column[12],1);
   delay(a);
   digitalWrite(column[8],1);
   delay(a);
   digitalWrite(column[4],1);
   delay(a);
   digitalWrite(column[5],1);
   delay(a);
   digitalWrite(column[6],1);
   delay(a);
   digitalWrite(column[10],1);
   delay(a);
   digitalWrite(column[9],1);
   delay(a);
  
}

void spiralpattern()
{
  turnallon();
  int a = 50;
  for(int i = 0; i<6; i++)
  {
    //clockwise spiralling
    digitalWrite(column[0], 1);
    delay(a);
    digitalWrite(column[1], 1);
    delay(a);
    digitalWrite(column[2], 1);
    delay(a);
    digitalWrite(column[3], 1);
    delay(a);
    digitalWrite(column[7], 1);
    delay(a);
    digitalWrite(column[11], 1);
    delay(a);
    digitalWrite(column[15], 1);
    delay(a);
    digitalWrite(column[14], 1);
    delay(a);
    digitalWrite(column[13], 1);
    delay(a);
    digitalWrite(column[12], 1);
    delay(a);
    digitalWrite(column[8], 1);
    delay(a);
    digitalWrite(column[4], 1);
    delay(a);
    digitalWrite(column[5], 1);
    delay(a);
    digitalWrite(column[6], 1);
    delay(a);
    digitalWrite(column[10], 1);
    delay(a);
    digitalWrite(column[9], 1);
    delay(a);
    
    //anti-clockwise
    digitalWrite(column[9], 0);
    delay(a);
    digitalWrite(column[10], 0);
    delay(a);
    digitalWrite(column[6], 0);
    delay(a);
    digitalWrite(column[5], 0);
    delay(a);
    digitalWrite(column[4], 0);
    delay(a);
    digitalWrite(column[8], 0);
    delay(a);
    digitalWrite(column[12], 0);
    delay(a);
    digitalWrite(column[13], 0);
    delay(a);
    digitalWrite(column[14], 0);
    delay(a);
    digitalWrite(column[15], 0);
    delay(a);
    digitalWrite(column[11], 0);
    delay(a);
    digitalWrite(column[7], 0);
    delay(a);
    digitalWrite(column[3], 0);
    delay(a);
    digitalWrite(column[2], 0);
    delay(a);
    digitalWrite(column[1], 0);
    delay(a);
    digitalWrite(column[0], 0);
    delay(a);
    //spiralling anti clock wise
    digitalWrite(column[0], 1);
    delay(a);
    digitalWrite(column[4], 1);
    delay(a);
    digitalWrite(column[8], 1);
    delay(a);
    digitalWrite(column[12], 1);
    delay(a);
    digitalWrite(column[13], 1);
    delay(a);
    digitalWrite(column[14], 1);
    delay(a);
    digitalWrite(column[15], 1);
    delay(a);
    digitalWrite(column[11], 1);
    delay(a);
    digitalWrite(column[7], 1);
    delay(a);
    digitalWrite(column[3], 1);
    delay(a);
    digitalWrite(column[2], 1);
    delay(a);
    digitalWrite(column[1], 1);
    delay(a);
    digitalWrite(column[5], 1);
    delay(a);
    digitalWrite(column[9], 1);
    delay(a);
    digitalWrite(column[10], 1);
    delay(a);
    digitalWrite(column[6], 1);
    delay(a);
    //spiralling out clock wise
    digitalWrite(column[6], 0);
    delay(a);
    digitalWrite(column[10], 0);
    delay(a);
    digitalWrite(column[9], 0);
    delay(a);
    digitalWrite(column[5], 0);
    delay(a);
    digitalWrite(column[1], 0);
    delay(a);
    digitalWrite(column[2], 0);
    delay(a);
    digitalWrite(column[3], 0);
    delay(a);
    digitalWrite(column[7], 0);
    delay(a);
    digitalWrite(column[11], 0);
    delay(a);
    digitalWrite(column[15], 0);
    delay(a);
    digitalWrite(column[14], 0);
    delay(a);
    digitalWrite(column[13], 0);
    delay(a);
    digitalWrite(column[12], 0);
    delay(a);
    digitalWrite(column[8], 0);
    delay(a);
    digitalWrite(column[4], 0);
    delay(a);
    digitalWrite(column[0], 0);
    delay(a);
  }
}
void turnallon()
{
  for(int i = 0; i<16; i++)
   {
     digitalWrite(column[i], 1);
   }
   for(int i = 0; i<4; i++)
   {
     digitalWrite(layer[i], 0);
   }
}

void pattern2()
{
  alloff();
  digitalWrite(layer[1],1);
  digitalWrite(layer[2],1);
  digitalWrite(column[0],1);
  digitalWrite(column[3],1);
  digitalWrite(column[15],1);
  digitalWrite(column[12],1);
}



6. Working/Implementation video:

          This following video is implemented with the above code. Have a look on this video you can digest the code easily and can construct your own code then.

                                









Share this:

CONVERSATION

0 comments:

Post a Comment