Introduction: PIC 3x3x3 LED Cube

Picture of PIC 3x3x3 LED Cube

Here´s my 3x3x3 LED cube, it's controlled by a PIC16F628A microcontroller.
This is my first microcontroller project that finally works, so i suppose is not that difficult to make for beginners.

I hope you'll enjoy that instructable and even make your own LED cube!

Step 1: Materials

Picture of Materials

The PIC drives the cube without external IC's and with very few extra components.
To make your own LED cube you'll need:

-A PIC16F628A Microchip microcontroller ($2 ebay)

-27 diffused LEDs ($3.50 50pcs ebay)

-7805 voltage regulator ($0.99 3pcs ebay)

-9 330ohm resistors ($1.14 ebay)

-12 male + 12 female headers ($2.59 ebay)

-18 pin DIP IC socket ($0.99 10pcs ebay)

-Controller and cube circuit boards (make them yourself)

-16v 100uF electrolytic capacitor (recycled from old boards)

-100nF ceramic capacitor (recycled from old boards)

-Plug and small heatsink (recycled from old boards)

Step 2: The Controller

Picture of The Controller

First, make the controller board (instructions here), drill the holes and tin the pads carefully.
Place all the components as shown in the picture and solder them in place.

Step 3: The Cube

Picture of The Cube

Mark a 3x3 1 inch grid in a corck and hole the places for the LEDs, this will keep them aligned while you bend and solder the leads.
Place them diagonally so the leads won't touch, solder the cathodes to one side and then bend the anodes above the cathodes. Solder the anodes 90º away from the cathodes.

Repeat the process to make two more grids and place them on each other making anodes and cathodes be in the same side.
Bend the 9 protuding cathodes down and solder them in 3 columns.

I've bent the 9 anodes so they came arranged in three groups of three, you can simply solder a ribbon cable, but it won't hold the cube up as a structure.

Use the pictures to guide you.

Step 4: The Base

Picture of The Base

To plug the cube in the controller i made a base board.
It's useful for unplugging the whole cube from the controller board so you can access to the microcontroller and stract it for re-programming.

Use the circuit stencil to make your own board.

If you prepared you cube like mine, you have to solder the heathers, insert the cube in the PCB holes and solder it from upside.

Make sure the cube module fits in the controller board.

Step 5: Programming

Picture of Programming

Time to program the microcontroller!

Open your favourite programming program,
plug your PIC into the programmer,
choose the file ''LED cube HEX'' and upload it,
configure the right fuses
and program your microcontroller.

More programs can be made for different light patterns, but i don't know how to do easily.
If you know how to do it, how make your own patterns, please, tell me.

Step 6: Final Details

Picture of Final Details

As finishing details i added four PCB mounting bolts to make it stand on them, that will avoid short-circuits if the cube is placed on a metal surface.
You'll also need to connect the cube to a power supply so solder a plug cable in the input pads.

I noticed that the lm7805 i trimmed off was overheating when i use a 12v power supply due to the input and output voltage difference.
It couldn't sink all that heat with the small surface i let, so i cutted a small piece of aluminium heatsink and i thermally-glued it to the voltage regulator.

Step 7: Enjoy It

Picture of Enjoy It

The cube is finished and working, it looks great and does not overheat at all.
There may be bigger, more coloured and brighter cubes, but i'm proud of how my first LED cube looks and works.

I hope you enjoyed that instructable and even made your own cube.

IF you liked this project, please vote it for the make it glow and microcontroller contests

And don't forget to ask your doubts!


PhongT11 (author)2017-06-08

hello, can you send me source code C of the hex file ?
Tks very much

AmitB70 (author)2016-09-24

pls mail hex file, schematic and if possible pcb layout pdf to thank you

wirelessfuture2016 made it! (author)2016-05-19

I made it! Very good instructable, except I think your cathodes and anodes are mixed up, my animation looks more correct when I turn it on:

Very cool!

hamal (author)2016-03-12

Hey this is great! Can you send me the,schematic the source codes and hex to my email?


ali rifaat (author)2016-02-27

Bonjour Est-il possible de travail LED sous la forme de lettres (A , B , N , M ...... ) s'il vous plaît envoyer

Kenay (author)2015-12-11

Hi I little speak English

please send to good circuit, schematic,program

İsmailA8 (author)2015-12-10


davide83 (author)2015-11-06

send to pls

Mark15 (author)2015-10-18

send to pls

KrisztiánT (author)2015-06-16

hy send me .lay file my email:

big thx

KrisztiánT (author)KrisztiánT2015-06-17

or eagle file :)

pinomelean (author)KrisztiánT2015-06-23

I made the circuit using photoshop, all i got is the image file. Sorry.

EuniceSaldi (author)2015-05-17

Hello, about the circuit for this proj, I noticed a difference in your schematic and the control board you made. I assume that the resistors are in order and in your schematic R5 is connected to PIN10 but in the control board as shown in the photo R5 is connected to PIN11 and R6 in PIN 10. Are your R5 and R6 interchanged in the board? thanks :D

pinomelean (author)EuniceSaldi2015-05-18

You're probably right, i designed the PCB with photoshop long before i started using eagle, it's pretty easy that i made a mistake designing the PCB manually.

EuniceSaldi (author)pinomelean2015-05-19

But it works this way right(the one in your pcb design)? If so i should connect R5 to pin11 and R6 to pin10 right? or should i follow the schematic?

pinomelean (author)EuniceSaldi2015-05-19

You should follow the schematic. In my cube, a row of LEDs apears to not light up, so it's probably because of the PCB and not the program

EuniceSaldi (author)pinomelean2015-05-19

Thank you, thank you so much! I'll make sure to post what I did once I've finished :D

EuniceSaldi (author)EuniceSaldi2015-05-17

also, would I need a heat sink if I'm only using a 9volt source? :D

pinomelean (author)EuniceSaldi2015-05-19

I'm using a 7v supply and the little heatsink only warms up, but it doesn't feel that hot.

For 9v, you could use a heatsink a little larger or improve airflow.

Hambito made it! (author)2015-04-20

Hi, very good instructions, I did it in the protoboard but the first row of LED lights not.(this is a wire mess, but then I´ll pass to the final plate hahaha). So, do you have the code in C language ? Or do you know what is the problem? Thanks

pinomelean (author)Hambito2015-04-21

I picked the code from a webpage a long time ago, it was just a Hex file and they didn't provide an asm file. If you don't like the animation or want to change it, you'll have to make a new progam.

Hambito (author)pinomelean2015-04-21

I loved the animation , however when I turn on, the first row of LED lights not. Do you have any idea of what can be ?

pinomelean (author)Hambito2015-04-21

Check if you have a signal output in the right row pin at the PIC. If you have something, you've connected something wrong. If there's no signal, probably the code was made they way.

mhack.camano (author)2015-03-27

hi very nice instructions but it is possible to run this program using superBRIGHT LIGHTS LED ?? TIA :)

pinomelean (author)mhack.camano2015-03-27

If you want to use LEDs that consume more than 10mA, You need to put a transistor buffer in each output of the microcontroller.

CK101 (author)2014-12-14

What is a 16v 100uf

pinomelean (author)CK1012014-12-15

It's an electrolytic capcitor rated for a maximun voltage of 16v and a capacity od 100 micro farads.

CK101 (author)2014-12-14

What plug do I need and hot sink

CK101 (author)2014-12-14

100nf and

soemoe (author)2014-03-14

I made it but I have to join the 10K resistor connects together with Pin4-MCRL and +5V supply.

pinomelean (author)soemoe2014-03-15

Use the I made it! button and ad some photos!

asimobot (author)2013-12-23

Hey, What is programmer called that you pluged the microcontroller into?

pinomelean (author)asimobot2013-12-24

Is the PIC K150

I_build_cool_stuff (author)2013-11-06

If I run this on 5V off of a USB port do I still need a 7805 regulator?

If you use a 5v power supply you won't need the 7805, you can solder the wires to the capacitor traces.

Ini Cepero (author)2013-10-27

One of your best instructables so far! Keep amazing us with your projects!

pedramd7 (author)2013-10-25

very very nice :)

window.close (author)2013-10-24

Great step by step Instructable! And I love your assembly line :-)

About This Instructable




Bio: I love electronics and all about DIY.
More by pinomelean:IN-12 nixie clockLi-ion battery chargingMini line tracer
Add instructable to: