Tuesday, 5 February 2019

How to Make a LED Cube at Home

Amazing 3x3x3 LED CUBE using PIC16F877A microcontroller
Here we are going to design simple 3x3x3 LED CUBE and connect it to PIC16F877A to get different patterns.

COMPONENTS: PIC16F877A controller PIC KIT 3
BREADBOARD 1 220 ohm RESISTORS (9) 1K ohm RESISTORS(3) 27 LED(GREEN,RED and YELLOW) BC547 TRANSISTORS(3) (USED AS SWITCH) 9V BATTERY(1) SOME WIRES


Let's see how to make 3x3x3 led cube at home

Step 1:
JUST DRAW NINE POINTS WITH EQUAL SPACE  THEN MAKE HOLES LIKE BELOW IMAGE USING ANY THINGS LIKE STRONG PAPER OR PARCEL BOX ANY MATERIAL


Step 2:
MAKE SMALL CURVE ON LEDS NEGATIVE SIDE LIKE BELOW IMAGES




Step 3:
PLACE RED LED ON ALL NINE HOLES

Step 4:
CONNECT AND SOLDERING ALL LEDS POSITIVE SIDE

CONNECT ALL  3  LED PATTERN USING HARD WIRE OR OTHER

CONNECT 3LED PATTERN WITH BELOW THINGS ANY HARD WIRE
THIS 3 PINS CONNECTED TO PIC MICROCONTROLLER

CONNECT LED CUBE ON BOARD

SOLDERING ALL 9 NEGATIVE PINS OF LED AND 3 POSITIVE PINS OF LED
STEP 5:
SOLDERING WIRE WITH ALL PINS

CONNECT ALL COL PINS(C1,C2,C3,C4,C5,C6,C7,C8,C9) WITH BREADBOARD

CONNECT 220 OHM RESISTORS THROUGH COL PINS
BC547 TRANSISTOR

PIC16F877A 
RB0,RB1 AND RB2 CONNECTED TO BC547 TRANSISTOR BASE PINS THROUGH 1 K OHMS RESISTOR

CONNECT ALL COL PINS WITH PORT C AND PORT D

BATTERY CONNECTED TO ALL COLLECTOR PINS AND ALL EMITTER PINS CONNECTED TO GROUND
CONNECT  12V DC ADAPTER TO PIC BOARD

STEP 6:
FLASH YOUR PROGRAM USING PIC KIT 3

3x3x3 LED CUBE PROGRAM USING PIC16F877A

TOOL:
 MPLAB WITH HI-TECH COMPILER

/* DATE: 3/1/2019  AUTHOR : SURESH  PROJECT: HOW TO MAKE 3x3x3 LED CUBE AT HOME*/

#include<htc.h>
#define _XTAL_FREQ 20000000 //20Mhz osillator value
int msdelay();
int i=1,j=0,k=0;
volatile unsigned char           OPTION_REG          @ 0x081;
void main()
{   
TRISB=0x00;
TRISC=0x00;
TRISD=0x00;
    while(1)
    {
PORTB=0x01;
PORTC=0xFF;
RC6=1;

for(i=0;i<3;i++)
{
PORTB=((PORTB) | (0x07) & (PORTB<<i));
for(j=0;j<8;j++)   
{
RC6=1;
PORTD=(0x01<<j);
PORTD=~PORTD;  // TOGGLE PORT D
msdelay();
}
PORTD=0xFF;
RC6=0;
msdelay();
}
for(i=0;i<3;i++)       
{
PORTB=((PORTB) | (0x07) & (PORTB<<i));
PORTD=0x00;
msdelay();
}

for(i=0;i<3;i++)
{
PORTB=((PORTB) | (0x07) & (PORTB<<i));
for(j=0;j<8;j++)
{
RC6=1;
PORTD=(0x01<<j);
msdelay();
}
PORTD=0xFF;
RC6=0;
msdelay();
}

for(i=3;i>0;i--)
{
PORTB=((PORTB) | (0x07) & (PORTB<<i));
//PORTB=(PORTB<<i);
for(j=8;j>8;j--)
{
RC6=1;
PORTD=(0x01>>j);
msdelay();
}
PORTD=0xFF;
RC6=0;
msdelay();
}
}
}


int msdelay()
{
unsigned int x,y;
for(x=0;x<610;x++)
for(y=0;y<255;y++);
}
-----------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------

BUILD PROGRAM

BUILD SUCCESSFULLY COMPLETED
-------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------
Click below video for more details



------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------ Click below link for MQ5 gas sensor arduino code https://bit.ly/2GTwIlc Click below link for PIR sensor https://youtu.be/4gRo1ijpMmQ Click below link for the temperature sensor https://youtu.be/1GJC_6eF7Xg Click below link for vibration sensor https://youtu.be/jiJAhxa687s Subscribe To My Channel and Get More Great Ideas https://bit.ly/2UlZJcb Click below link for more embedded topics https://digiuniverselife.blogspot.in Contact Us Facebook https://bit.ly/2NAeebK Twitter https://bit.ly/2x3R1p1 If you like this video share with your friends Basics of embedded systems -Digital Universe Thanking you

No comments: