3x3x3 LED Cube

3x3x3 LED Cube

Here is my 3x3x3 LED Cube project. It runs using a PIC16F690. Along with the brief explanation of how to make it, I have also included the .asm file for the PIC and a piece of software written in VB.NET that you can create your own LED patterns. These can be exported as .asm files and put into the main .asm code.


 
Remove these adsRemove these ads by Signing Up
 

Step 1Building

Building


Each layer of 9 LEDS are connected with all of the cathodes together. The cube is multiplexed, meaning that only one layer is on at any one time. It happens so quickly that the whole cube looks like it is illuminated. RB5, RB6 and RB7 controll which layer is being illuminated.

From the picture you can see the connections to the top layer. I have only connected RC2 to show you how the connection should be made, the rest of the LEDs are connected the same way.


The easiest way to connect the LEDs together is to drill 9 holes into a piece of wood (picture 2), then place the LEDs into the holes, bend the legs and solder the cathodes together. After 3 of these are created, simple stack them and solder the anodes together. You should end up with 9 anodes and 3 common cathodes to connect to you circuit.


All you need to build this cube is:

1 x 5v regulator
1 x switch
1 x PIC16F690
3 x NPN tansistors
3 x 330 ohm resistros
9 x 220 ohm resistors
1 x 220uF capacitor
27 x LEDs

oh, and MPLab PIC programming software. (Other software may work, but my .asm file may have to be changed a little)
« Previous StepDownload PDFView All StepsNext Step »
187 comments
1-40 of 187next »
Feb 1, 2012. 9:18 AMhrpearl01 says:
COULD SOMEONE PLZ TELL ME:

Which type of PIC16F690 do I need:

PIC16F690-E/P
OR
PIC16F690-I/P

OR ELSE SEE: http://bit.ly/zWPoZC

PLEASE TELL ME WHICH ONE OF THESE ON SITE LINK.

THANKS IN ADVANCE
Dec 19, 2011. 8:21 PMGeArGuY says:
Does anyone have a website where you can get all of this????
Feb 18, 2011. 10:56 AMdbirky says:
Thanks for the instructable. Built it on perf board. No issues. Works well. Programmed with PICKIT2. I really enjoy assembly programming and this was a fun little project!

LED Cube.JPG
Dec 3, 2011. 12:28 PMfsfshsyhh says:
Can you help me please? i want to have LED lamps in serial

power supply 3V
forward voltage 3.2-3.4
20mA

How many leds can i light up with 3V? Do i need a resistor for that, and how many OHM? Im a really beginner and i need help.
Nov 26, 2011. 3:03 PMSanticN4N says:
When i compile the software in the velleman provided MPASM v5.20 i get a "and" parameter error.....

I am using the velleman K8048 to program the PIC.

Help PLEASE!!!

Thanks,
SanticN4N
Oct 22, 2011. 12:22 PMswoc says:
Hi! Thank you for the tutorial.

if anyone is still having questions, then things that I used:
3mm white LEDs (27), 8500mcd 20deg
PIC16F690, asm written in MPLAB, programmed with MicroPro
Resistors as said
16V 220uF Capacitor
small slide switch (3 pins (on-on))
bc547c transistors
L7805cv 5V regulator
9V battery + connectors

The final result: With the LED.asm code, author provided: http://www.youtube.com/watch?v=oLhOLdcUf5k Synced to a track: http://www.youtube.com/watch?v=JnAD9y2kCf4 NB! When programming


PIC16F690 or any other PIC on MPLAB, then you have to set your Device (Configure - Device) to exactly your PIC! I had a lot of problems before I found out the solution.

Than You portreathbeach!
Feb 19, 2011. 10:24 AMt.spinner12919 says:
im confused about how to program the chip do i need some sort of external piece? how do i get the .asm programmed onto the chip
Oct 21, 2011. 7:48 AMeriknyquist says:
yes, you need a PIC programmer.
http://www.microchipdirect.com/productsearch.aspx?Keywords=DV164120
Sep 24, 2011. 5:08 AMdasty80 says:
Thank You very much for "VIsual Basic Source Code".
I'm a newbie of Visual Basic and your Code is been very helpful for me.
Best Regards,
Dany...
Apr 4, 2011. 11:04 PMasickrishna says:
Hi!

If you are interested, here is my PicAxe project, which i haven't completed yet. Please comment.

The code (in basic):
http://dl.dropbox.com/u/17683377/LED_CUBE/Code2.1.1.txt

Schematic:
http://dl.dropbox.com/u/17683377/LED_CUBE/LED%20CubeRev2.1.1.jpg
Sep 8, 2011. 2:04 PMPhoenix78 says:
LOL. Searching on the net for a schematic for a led cube.Bought 3x 74hc595 for in use with the picaxe 18m2 but did not how to do this, and then came to this.

Great example.THNX...I'm interested ;-)
Aug 5, 2011. 6:58 AMbhargav.sg says:
hi can u mail the report of the 3*3*3 led cube to bhargava.sg@gmail.com.
thanks for the info it was really helpful
Jul 29, 2011. 3:52 PM77omar says:
quiero el software de el pic 16f84 me pueden ayudar mi correo es lainezmenjivar7@hotmail.com
Jun 14, 2011. 1:52 PMjlenert says:
How do you calculate a value of 330 ohm resistors to be used with the transistors!?
May 12, 2011. 9:18 PMalbinvadakkekara says:
can i have use the pi16f623a insted of the pic16f690
May 12, 2011. 8:12 AMmhps0519 says:
HI!NICE TO MEET YOU!
Do you have 4x4x4 LED CUBE's software?
Tank you very much!!!
Apr 7, 2011. 9:06 AMshanakaplus says:
um looking for elevator pic program. Do you have example program ?
Apr 6, 2011. 8:29 PMWeepet says:
What about doing this project with a PIC16F872 ? Anyone would know how to change the code to fit in it ?
Jan 16, 2011. 8:59 AMjimy268 says:
I attach the improved photo, the schematic graph and the modified ASM. I DID MY OWN PATTERNS AND DELAYS. You can use the " LED Cube pattern generator " to create his own patterns. Remember that the PICF84A has a limit of 1024 words whereas the PIC16F690 of 4096. " Make to Pocket LED Cube " it is the manual of how to construct the Led Cube
Foto.JPGDiagrama 3.PNG
Apr 1, 2011. 6:47 AMcesar correia says:
can you send me the instructions via email?

correia7cesar@hotmail.com
Mar 4, 2011. 9:03 AMbrunder says:
IM from bulgeriq and here 5mm leds are 3V(red,green,yewoll,blue and other)Please tell me whit what I need to replace a 220 om resistor?Can I replace with 80 om resistor?OR with 200?please tell me with what resistors I need to replace?
Mar 4, 2011. 9:00 AMbrunder says:
with my 3V leds with what volts I need to replace a 220om resistors?
Mar 4, 2011. 1:16 PMjimy268 says:
R = (Vbattery - Vled)/ I of the led
Vbattery =12V  
Vled = 3V
I Intensity of the current in ampere (A).
If your led works with different I you must change it.
If you work with different voltage you must change it.

I
of the led = 20mA = 20/1000 = 0.02A

R = (12-3)/0.02 = 450 Ohms

http://mx.answers.yahoo.com/question/index?qid=20100703021150AAzGxqT
Mar 12, 2011. 11:16 PMvvaidya says:
hey can u send me pcb schematics and source code on my email
plzzzzzzzzzzzzzzz

vaidya.vaibhav91@gmail.com
Mar 4, 2011. 1:36 PMbrunder says:
MY leds are 0,025A(I)
wait vbattery are 5v? in the picture you show 5V?
it follow R=(5-3)/0.025=80 OM resistors right?IF IM not please tell me what resistors?
Mar 4, 2011. 3:57 PMjimy268 says:
That is correct. Though if you place a major resitor the led was illuminating less.
Mar 4, 2011. 11:00 PMbrunder says:
I willl try first with 200 OM resistor iff the lef light low I will change with 80 OM resistrors what do tou tink?
Mar 5, 2011. 2:24 AMbrunder says:
Hey jimmy can you send me the soursecode for the programing? the .hex fail right?My email is beam124@abv.bg or on skupe naruto.u2 please sedn me the fail...
Mar 5, 2011. 8:09 AMjimy268 says:
The downloading file : FM2PAY6GIYWWDPW.TEM
You have to change it : FM2PAY6GIYWWDPW.ASM
If you want, you can change the name. (Led3x3x3x.ASM)

To obtain the file hex, you can use MPLAB.
Mar 5, 2011. 9:04 AMbrunder says:
I dont understend please send me the fail?
Mar 3, 2011. 11:27 PMbrunder says:
Please jimy telll me what voltage arre yours leds.My leds are 3V ?
Mar 4, 2011. 7:54 AMjimy268 says:
Since you see I use led red of 5mm, the voltage is 1.9 approximately.
Green Led is 2.1V.This project works with 5v

Look at this link http://es.wikipedia.org/wiki/Circuito_de_LED

If it has another question do not hesitate to ask
Mar 1, 2011. 5:58 PMjimy268 says:
New schematic
Diagrama 3.PNG
Nov 20, 2011. 1:58 PMJ.nk.yonek says:
as did his scheme and wanted to test it so a lower layer but the LEDs do not blink, you can test only one layer?
I appreciate if you can help me thanks.
Nov 21, 2011. 2:32 PMjimy268 says:

This is a simple program (Test LED 3x3x3) which test (lights) the layers one by one

__CONFIG _CP_OFF & _WDT_OFF & _PWRTE_ON & _XT_OSC
LIST P=16F84A
INCLUDE

cblock 0x0C
PDel0
PDel1
PDel2
ENDC

; Main program starts here
;-----------------------------------------------------------------------------------------------

Start
BSF STATUS,RP0 ;SELECCIONAMOS EL BANCO 1
CLRF TRISB ;LIMPIAMOS EL REGISTRO TRISB
MOVLW B'11110000' ;ENTRADAS RA4-RA4, SALIDAS RA0-RA3
MOVWF TRISA ;PONEMOS EL VALOR DE W EN TRISA
BCF STATUS,RP0 ;SELECCIONAMOS EL BANCO 0
CLRF PORTA
CLRF PORTB

Loop
MOVLW B'11111111'
MOVWF TRISB
BSF PORTA,0
BSF PORTA,3 ;ACTIVA TOP LAYER
CALL DEMORA
BCF PORTA,3
BSF PORTA,2 ;ACTIVA MIDDLE LAYER
CALL DEMORA
BCF PORTA,2
BSF PORTA,1 ;ACTIVA BOTTOM LAYER
CALL DEMORA
BCF PORTA,1
Goto Loop

; Generado con PDEL ver SP r 1.0 el 21/11/2011 Hs 03:47:41 p.m.
; Descripcion: Delay 700000 ciclos
;-------------------------------------------------------------
DEMORA movlw .17 ; 1 set numero de repeticion (C)
movwf PDel0 ; 1 |
PLoop0 movlw .47 ; 1 set numero de repeticion (B)
movwf PDel1 ; 1 |
PLoop1 movlw .218 ; 1 set numero de repeticion (A)
movwf PDel2 ; 1 |
PLoop2 clrwdt ; 1 clear watchdog
decfsz PDel2, 1 ; 1 + (1) es el tiempo 0 ? (A)
goto PLoop2 ; 2 no, loop
decfsz PDel1, 1 ; 1 + (1) es el tiempo 0 ? (B)
goto PLoop1 ; 2 no, loop
decfsz PDel0, 1 ; 1 + (1) es el tiempo 0 ? (C)
goto PLoop0 ; 2 no, loop
PDelL1 goto PDelL2 ; 2 ciclos delay
PDelL2 clrwdt ; 1 ciclo delay
return ; 2+2 Fin.

End;
Mar 5, 2011. 10:36 PMkkcg says:
new schem? Why? Your first schem worked only on breadboard but by the time we do the ckt it doesn't work. How can that be? How will this new schem help us?
Mar 6, 2011. 9:58 AMjimy268 says:
The new schematic is to show you where the 22 pF capacitor y crystal are place. Should be a wrong connection or wrong track. If you want sent me de the PCB schematic.
Jan 19, 2011. 3:25 PMkkcg says:
Big thank you! :D hmm, the cathode of the top layer doesn't connect at the cathode of the middle layer right?
Jan 19, 2011. 8:38 PMjimy268 says:
Not, every cathode connects with his corresponding transistor. Top cathode layer connected to the Transistor of the RA3, cathode middle layer to the transistor of the RA2 and cathode bottom layer to the transistor of the RA1.
Feb 17, 2011. 7:11 AMkkcg says:
hi again! my teacher wanted me to use an RBG LED for this project. Can you help? Please. :) If you have any idea if we could still use a PIC16F84A, so as the circuit diagram you've given so is the program.
1-40 of 187next »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
17
Followers
2
Author:portreathbeach