Introduction: The 4x4x4 LED Cube (Arduino)

Picture of The 4x4x4 LED Cube (Arduino)

In this instructable I will show you how to make a 4x4x4 LED cube that will be controlled by an Arduino Demulionove. now yes you might say" that Arduino has only 14 I/O pins well also the 6 analog pins can be used as pins 15,16,17,18,19,20. that way giving us enough pins (16 columns + 4layers = 20 I/O pins)

This instructable is made for those who know how to solder (well) and how to program the Arduino. Also I will be providing detours to skip sum steps so if you see (Detour available skip to __ Step) you can follow if you are to lazy to do that.

Step 1: Get the Materials

Picture of Get the Materials

To start of you will need these materials:

-- 64 LED (color optional) **
-- Arduino Demulionove
-- Wire

--32 male pin strip
--PCB prototype board
--Fine Grit (400 +) sand paper

Your choice
-- 64 resistors or 16
you can get 64 resistors which will help by keeping all the lights at the same light out put regardless of how many are on but it will be considerably more work.

--Soldering Iron
--thin nose pliers

**Color is optional but use this website to find the right resistor for your leds (I got Green so I used 100 ohm resistors)

Step 2: Assemble the Board(the LED Cube Base)

Picture of Assemble the Board(the LED Cube Base)

(Detour available skip to next step)

In this step you will need the board and the wiring. First you will want to map out were all the wires will go and then feed the wires through the board. Don't mind the LED and resistor note on the picture for now.

NOTE: I recommend you use Different color wire just because you won't get confused which wire is which.


Step 3: Defuse the LED

Picture of Defuse the LED

DETOUR if you don't want to do this then go to next step

So to defuse the LED I took normal 400 grit sand paper and sanded all the LEDs which made them look pretty good.

Step 4: Construct the Cube

Picture of Construct the Cube

Now there is the Easy way to do this and that is to connect all the (--) in one layer and then the columns (+) to the resistor and then board. (Look at picture diagram below) what happens is when you turn it on (all of them) the lights are dimmer then when one is on.

My solution to this was to solder a 100 ohm resistor to each LED. (Follow picture instruction on how to do it.) Everything is done in the same way only now you solder all the resistors to the column which is a piece of Ethernet wire. (See picture)


Picture of PROGRAM
Good job on making it too this step now all you need to do is upload this code and you are done.

the code did not fit the line so here it is

Step 6: ADD On

Picture of ADD On

so to program the cube all you need to do is change the 

B1111, B1111, B1111, B1111, B1111, B1111, B1111, B1111, B1111, B1111, B1111, B1111, B1111, B1111, B1111, B1111, 80,

each B1111 corresponds to a line of LEDs in your cube 0 being off and 1 being on. The last number is the time it will display that part in milliseconds.

so get programing and enjoy.


PeterM439 (author)2017-06-01

Hello, from what I understand from the code, you multiplex the cube by turning on one layer at a time by connecting the cathodes for that layer to GND, and then turning on the columns you want to be lit by putting 5V on them with a series resistor. In this way you only need 16 resistors, since at any given time, there is always just one LED active per resistor and output.

surmit chauhan made it! (author)2016-04-23

I have also make this cube but i having problem when I try to glow single led in the bottom layer then all the 3 led above that led glows this is happening to whole cube i am using LCCG for programming but the problem is still not solving please help me.

ShararrA (author)surmit chauhan2016-05-04

i also had the same problem. i found some of the led leeking voltage. so while i powered the 1 row 1 layer two leds lit of the same column lit . i solved it by replacing the leds. and cheak continuity of each row

ShararrA (author)surmit chauhan2016-05-04

i also had the same problem. i found some of the led leeking voltage. so while i powered the 1 row 1 layer two leds lit of the same column lit . i solved it by replacing the leds. and cheak continuity of each row

ShararrA (author)2016-03-18

the wires of the cube will go to which arduino pin . please give me a circuit diagram.

surmit chauhan made it! (author)ShararrA2016-04-23


  • (1,1)-13
  • (1,2)-12
  • (1,3)-11
  • (1,4)-10
  • (2,1)-9
  • (2,2)-8
  • (2,3)-7
  • (2,4)-6
  • (3,1)-5
  • (3-2)-4
  • (3-3)-3
  • (3,4)-2
  • (4,1)-1
  • (4,2)-0
  • (4,3)-A5
  • (4,4)-A4



  • a-A0
  • b-A1
  • c-A2
  • d-A3
LunaticoGalindo (author)2016-02-26


Are you powering the cube using only the arduino? and will an arduino uno be enough to make it?

maksmkv made it! (author)2015-04-18

Hi all, this is cool project. But, how to create this code using 74hc595 ???

andrew.fowler.39904 (author)2015-03-22

is there away of using the random number command to make paterns

SamuelD4 (author)2015-01-07

I want to know how to code for the patterns. how can i design my own codes?

MariusG1 (author)SamuelD42015-03-04

I made a program that can produce patterns real easy. Would you like me to share it?

SamuelD4 (author)MariusG12015-03-09

Yes, that will be helpful. Thank you!

MariusG1 (author)SamuelD42015-03-17

Something happened to the link I posted but I made an intstructable with the program, check it out:

SamuelD4 (author)MariusG12015-03-20

Thanks for your help.

MariusG1 (author)2015-03-17

If you want to make your own codes real easy check out this:

siva.prasad.1614 made it! (author)2015-03-07

great tutorial,i hooked the cube an standalone arduino and works great

kashif.mushtaq07 (author)2014-11-16

i need 16x16 led cube progrming code of ardiuno

JohnS18 (author)2014-09-18

I wondred if someone could post a link to were I can buy the PCB/stripboard and the link to the wires.

parmarravi (author)2014-06-19

i made an 4*4*4 led cube with ,16 cathodes and 4 anodes but now the issue is only column works perfect and when ,i light an one row ,it also lights up other rows too...could u tell me how to fix this issue.i have not used any transistors in a cube only resistors and leds

forte1994 (author)parmarravi2014-06-19

You need to multiplex the layers. What seems like is happening with you is you didn't multiplex the layers thus all of them light up. Use the code provided to have them be multipliexed properly.

ajvdmeij (author)2012-02-21

I have just built the cube and it is working great. You can see it here: 

Making the code for great patterns is kind of difficult, so I made a little Javascript program to make designing them more easily. It basically works as follows. You see four squares: the first square is the front layer, the second, the one behind that, the third the one behind that and the last is the back layer. You can set the LEDS on or off and when you have made a pattern, and have set a time in a text box, you can write it to a text area. Then make another one, and another one and.. When you are finished, you can copy the contents of the text area and paste it in the Arduino Code. Then go for it!

Try it here: If you want the source code, you can copy it or tell me and i will mail it to you.

Have fun!

simplyelectric (author)ajvdmeij2014-01-03

You must use safari on windows, chrome will not work. safari does though!

ddemayo (author)ajvdmeij2013-11-14

Your website no longer works to program the code

will2313 (author)ajvdmeij2012-08-25

hi ajvdmeij
can u send me the source code for the 4x4 led cubes? thx a bunch..


fryddog (author)ajvdmeij2012-08-19

That is awesome!!! So handy. Thanks!
Any chance you could whip up a similar program but for an 8x8x8 cube?

mbrenig (author)2013-09-17

My friend owns one of these.. I wrote python code to generate frames that look like a simulated game of snakes on the cube. Here's the code if anyone wants to try it out:

Pigstealer (author)2013-07-06

First off, thanks for the great 'able. Well done! I got my cube finished and loaded your sample code into it and it works! I burned out a couple of LEDs while soldering the layers together and a couple of them are a little crooked, but I am very happy with the results all the same. I haven't got the program figured out as of yet, so I am still running the code you provided but people I show it to are pretty impressed. Here are a couple links to YouTube so you can check it out. Thanks again for the great instructions, I am already started on my 2nd one.

jatinbatra (author)2013-02-15

I'm an Arduino begginer ...can i have line by line explanation of code? please

WGY (author)2012-12-29

I made my cube and all of the lights work, however, there seems to be a problem with the wiring. Whenever I address a single LED in 6 of the columns, The whole column lights up. This does not happen in 2 columns where the LED's light up individually.
Help would be appreciated!

forte1994 (author)2012-12-23

I might make a miniature version with smd leds most likely bigger then a 4x4x4 maybe a 8x8x8 or a 10x10x10.

fryddog (author)2012-08-19

I have made an 8x8x8 led cube already and I am trying to find an easy way to program it. Is it possible to use your code and adapt it to an 8x8x8 cube? If so would you know where to change it?

OCPik4chu (author)fryddog2012-10-16

There aren't enough outputs on the arduino for that without additional logic such as shift registers or LED drivers, either one will require a major rewrite in the code since it is a completely different method.

Obruni (author)2012-09-22

Did it!
Thanks for the great instructable.
Took me 2.5 hours of constructing. The coding took about the same time (with code example available over here)

Let's go for the 8x8x8 :-)


velankani (author)2012-08-28

i did it successfully .

'earl (author)2012-08-07

Hey guys, Ive finished mine, and started with this code, took me a while to figure it out, but after 7 hours of maually writing my own binary code, Heres my cube. Not Done. But its Pretty awesome so far I think. :D

velankani (author)2012-08-05

at least send me Arduino Demulionove board .where will it available ?

velankani (author)2012-08-05

i want to bye this project .
can u tell me cost of this project .
and send to my address.

jamesabruce (author)2012-08-02

Hey guys, I built one of these and wrote up the process as well as some additional software for this build:

It just goes over how to code programmatically for the cube rather than using a set pattern, so you can start to make games and interactive stuff. Sepcifically, I wrote code for a 2 segemnt random snake, and conways game of life. Hope you like and it spurs you on to making more apps for this - please send me a link if you do.

Forte1944 - thank you for an awesome build - gave you full credit in the original article here:

eagletech201 (author)2012-07-30

Is there a schematic. I can't tell what goes where.

gibsoncrazed14 (author)2012-04-14

I'm brand new with arduino and i was curious to how you would upload the code on to it? any help will be appreciated. Also great work.
- Thanks

First, you have to download arduino software from There will be a manual for installing drivers. After you have done that, open arduino program, write code, comply and upload to board!

velankani (author)2012-07-06

can u tell me about the full wiring circuit diagram .

stringstretcher (author)2012-03-12

alsetalokin (author)2012-02-24

Well, I built a cube (from a different instructable) and uploaded the .pde, and it runs, and appears to make the correct patterns, I think... but I can't make heads or tails out of the pattern making strings. There are some weird brightness variations too.

There are sixteen "B0000" groups per line. One would think that each group corresponds to a vertical column, and the 0s and 1s indicate the plane, and whether the light is on or off.

But that's not how it seems to work for me, and I can't figure it out.

The java applet on makecode.html always prints the same line, sixteen B1111s, no matter what boxes I have checked. The only thing that changes is the duration number, which does correspond to what I enter in the box. But everything else is always B1111s.

Can you please help me understand the pattern strings?

ajvdmeij (author)alsetalokin2012-02-27

I tried it in Safari and Chrome on a Mac and they work. I just saw that it didn't work in Firefox. I also tried it in Windows: IE also didn't seem to work. But Safari for Windows does the trick and I think )although I did't try) that Chrome will also work on a Windows computer.

I made the code in Dreamweaver and I will try to make it Cross-platform compatible but I can't promise anything: I am just an amateur!

naylson (author)ajvdmeij2012-03-02

ei grande me da awe umas dica como fazer ou me vende um

tboultwood1 (author)2012-02-19

Thank you ever so much for a great tutorial, i just made a 3x3 3mm red because I had no other LEDs :S So I just ordered a bag of 100 Blue! Thanks again and hope to see more of you in the future.

Trevor B

vishalapr (author)2011-12-30

I am making another cube and this time I am confused on the resistors bit...

I have a question...I am using these LEDs...

I have resistors of all the values from 1 ohm to 1 mega 10's ....
So which resistors will I need to use for those LEDs? The cube is connected to an arduino nano...

plz help :)

awang8 (author)vishalapr2012-01-18

100ohm resistors should work.

Bruno Silva Pinheiro (author)2012-01-11

Please, could you post pictures of the links in Arduino, would help greatly.
Oh, and if you have the electronic circuit, would be great.

Thank you.

Great project, congratulations!

About This Instructable




More by forte1994:The 4x4x4 LED cube (Arduino)Helping hands with led tester.
Add instructable to: