2x2x2 LED CUBE

Hey Guys, here we are using 8 Red LED’s, a Arduino Uno Microcontroller, shift reistors, 6 resistors and 2 NPN transistors to make 2*2*2 LED Cube.

Please support us on YouTube also. Like Share and Subscribe to our channel : https://youtube.com/c/RatnasRoboLab

Total Materials

components

Assembling

The construction of LED CUBE is very simple. At first we have to connect 4 cathodes with each other in each plane of the 4 LED’s. Same thing we have to do with other plane with other 4 LED’s. Finally connect the anodes in each plane respectively.

Connect Resistors and Transistors

We have 4 columns and 2 rows. Each column is connected with 150 ohm resistor and each row is connected with 1K ohm resistor using NPN Transistors.

Connect Shift Resistors and Arduino

Now we have to control 6 outputs (4 columns and 2 rows) so we need 6 wires through Arduino but instead of that we are using a shift resistor (74HC595) IC and we can control 6 outputs using only 3 inputs (Data, Clock and Latch) of shift resistors. Not only 6 outputs, we can control any no of outputs using only 3 pins using shift resistors.

Circuit Diagram

2x2x2 LED CUBE

Code

/*
Ratnas Robolab "Created by Ratnadeep"
*/
int dataPin = 4;    
int latchPin = 5;  
int clockPin = 6;   

byte leds = 0;

void setup() 
{
  pinMode(latchPin, OUTPUT);
  pinMode(dataPin, OUTPUT);  
  pinMode(clockPin, OUTPUT);
}

 void snd(byte a)
{       
digitalWrite(latchPin, LOW);
shiftOut(dataPin, clockPin, MSBFIRST, a); 
digitalWrite(latchPin, HIGH);
 }

void loop() 
{
   //    Q7     Q6     Q5    Q4      Q3      Q2    Q1    Q0
    //  LOWER   -  -   *    -  -    -  =    =  -    *    HIGHER
    
 for(int i=0;i<6;i++)
 {
      snd(B00000000);
       delay(50);

      snd(B10001001);
   delay(100);
      snd(B10010001);
   delay(100);
      snd(B11000001);
   delay(100);
         snd(B10000101);
   delay(100);
 }
 for(int k=0;k<5;k++)
 { 
  snd(B01011101);
   delay(500);
    snd(B11011100);
    delay(500);
 }
for(int j=0;j<3;j++)
 {
          snd(B00001001);
   delay(200);
     snd(B11000000);
   delay(200);
  snd(B00000101);
   delay(200);
        snd(B10010000);
   delay(200);
      
       snd(B01000001);
   delay(200);
        snd(B10001000);
   delay(200);
        snd(B00010001);
   delay(200);
        snd(B10000100);
   delay(200);
   
 }
 for(int l=0;l<20;l++)
 { 
   snd(B00000000);
    delay(50);
  snd(B11011101);
   delay(50);
   
 }
}

Do you want to support our videos ?
https://www.buymeacoffee.com/ratnasrobolab

Support Our Channel By Shopping parts from Amazon !

Video Components

1. My Camera : https://amzn.to/3L9Nzyb
2. Camera Stand Tripod : https://amzn.to/3Lwo1gd
3. T Bulb : https://amzn.to/3AtLk43
4. Boya Mic : https://amzn.to/3HbTrGc
5. Wall mount stand for Camera and other Mounting Accessories : https://amzn.to/41GLTTR
6. Overhead phone stand : https://amzn.to/442KrwP
7. upReale Professional 11″ inch LED Ring Light with 7 Ft Tripod Stand Combo : https://amzn.to/3V8HXJa

Further Readings

If you liked this article, then please subscribe to our YouTube Channel. You can also find us on InstagramFacebook and Twitter.

READ – CONNECT – BOOST – CREATE