Introduction: Arduino – LED Cube 3x3x3

Picture of Arduino – LED Cube 3x3x3
In this tutorial I’ll show how you can create your own LED Cube 3x3x3. I’m sure you already saw some similar projects to this one but you never took action and made your own. Now it’s time to make your own!

By the way you can find more project here:

Watch this Demo Video of my project:

Step 1: All Parts Required

Picture of All Parts Required
  • 1x Arduino Board
  • 27x LED’s
  • 1x Stripboard
  • 3x 22k ohm Resistors
  • 9x 220 ohm Resistors
  • 3x NPN Transistors (for example: 2N2222, BC547, 2N3904)
  • Wires
(I included a picture with all the parts)

Step 2: Video Tutorial + Schematics

Picture of Video Tutorial + Schematics
If you follow my video tutorial I think you'll understand how you can finish each step! If you have any problem please leave a comment below. (I also included my schematics in the pictures)

Step 3: Upload Source Code

Picture of Upload Source Code

Download the library here.

Be sure to download the library and unzip it to libraries. If everything is correct you should find an example in the Arduino IDE software under File > Examples > LedCube > ledcube.

Upload that ledcube example!

Step 4: Final Product

Picture of Final Product
That's the final product!

Did you enjoyed this project? 

Make sure you share this project and leave a comment below... It helps me a lot!

P.S. If you enjoyed this tutorial perhaps you might like my next ones. (Make sure you visit my website for more projects just like this one)


HarshitA7 (author)2015-10-31


while compiling i am getting error as


ledcube.pde: In function 'void loop()':
ledcube:49: error: taking address of temporary array
ledcube:50: error: taking address of temporary array
ledcube:51: error: taking address of temporary array
ledcube:52: error: taking address of temporary array
ledcube:53: error: taking address of temporary array
ledcube:54: error: taking address of temporary array
ledcube:55: error: taking address of temporary array
ledcube:56: error: taking address of temporary array
taking address of temporary array


how to resolve

i am using latest arduino on windows

snehazzz (author)HarshitA72017-11-07

Hi Harshit, I am getting the same error. Could you tell me how you fixed it?

mahfuz097 (author)HarshitA72015-11-28

I am also facing same type of problem. Kindly send the accurate/ error free code :(

SzymonD (author)mahfuz0972016-03-04

Do you found any solutions?

AyberkE (author)SzymonD2016-04-16

maybe you can check local variables. its seems to be variable problem.

mahfuz097 (author)SzymonD2016-03-05

Yah. I found the solution.

HarshitA7 (author)mahfuz0972016-03-05

Its very simple by the way.
You just have to get potential difference to blink any of the 27 led.
Put high on the longer terminal and low on the shorter one while coding. Its very easy if you no the basis of embedded C.

jiroleminen (author)HarshitA72016-03-22

Hi, I have same problem... Can you send me the fixed code????

TanapolR (author)2017-06-10

How to code C++ Ardunio (Led Cube 3x3x3)

Arslanimtiaz (author)2017-06-04

sir can you give me truth table of this

fecofabian made it! (author)2016-11-11

Hi Guys!
The solution for the 'error' is use an older arduino compiler (for example: arduino-1.0.6) and the cube will work.

Capt. AldrinR (author)fecofabian2017-05-15

Uploading using IDE 1.0.6 worked for me! Thanks!

omkar2309 (author)2017-01-22

It was smart to use loops to configure the pin layout but I'm having trouble understanding the pin configuration and having trouble arranging different sequence of my choice. That's it.

simply following the stuff would show me what to do and not teach me how it works, right?

daryoush_daruoush (author)2016-12-15


what is the this circuit voltage ?

MalindaW3 made it! (author)2016-11-23

work thanks bro

ChomnabK (author)2016-10-26

why Error compiling for board Arduino

Lance_Tronic made it! (author)2016-09-06

This is my second 3x3x3, only this time I put onto a UNO Proto Shield PCD.

Now to find a clear box to put it all into.

Thanks for the Tutorial Rui.

vignesh kailas (author)2016-07-22

how to output names in this 3x3x3 led cube somebody pls help !!!!!!!!

ssahoo1 made it! (author)2016-05-05

Atlast I made it !! , the effects are cool

NicsP (author)ssahoo12016-06-30

hey u can send me code ?

vaasu070 (author)2016-05-22

how could i resolve this?

someone help me out.

ledcube.pde: In function 'void loop()':
ledcube:49: error: taking address of temporary array
ledcube:50: error: taking address of temporary array
ledcube:51: error: taking address of temporary array
ledcube:52: error: taking address of temporary array
ledcube:53: error: taking address of temporary array
ledcube:54: error: taking address of temporary array
ledcube:55: error: taking address of temporary array
ledcube:56: error: taking address of temporary array
taking address of temporary array

TitD (author)2016-04-21

Hi Rui!
Code error. Help me !!!!!!!!!

AyberkE made it! (author)2016-04-16

so simple, thanks. i am change de codes for simple test and many light. its here.

void setup() {


void loop() {
for (int kat = 10; kat <= 12; kat++){
for(int kolon=1; kolon<=9; kolon++){
for (int kat = 10; kat <= 12; kat++){

Sud007i made it! (author)2016-02-01

I made it...

EthanS28 (author)2015-11-01

Hello, I'm very new to the entire Arduino & Maker movements so forgive me for my inexperience but I am confused about one portion of the schematic and would greatly appreciate some assistance.

In the instance of the two black jumper wires leading from the layer 2 & 3 transistors they appear to meet at the layer 1 transistor which I understand then leads its own wire to the Arduino board. However in the video tutorial the creator shows that on the PCB board all three of the jumper wires meet at the layer one transistors input, the question is, do I solder all three of these wires and the transistor input together?

Thank you.

Aman123456789 (author)2015-10-25

can anybody give me a code that lights up all the led's in the cube

Charlie fl (author)2013-09-28

OMG! this is incredible Im new in this app and I wanna do everything! haha I like your project. Good job.

RuiSantos (author)Charlie fl 2013-09-29

thanks so much for your feedback! Let me know if this project worked also for you :) I already had some subscribers trying and sending me pictures of their projects.

hey question... do you use 3 different resistors?

SowrabhN (author)naomi.n.vandijk2015-09-25

U can use three different resistors the only difference it makes is the intensity of the LED glow...If u increase the resistance the intensity decreases...

Lance_Tronic made it! (author)2015-07-24

I made it....

Took about 10 hours over two days to construct. I modified the placement of the transistors and the construction went very smooth (with a lot of checking and double checking). The only problem I had was with the IDE not recognising my NHDuino UNO. Once I updated the CH340G USB drivers, it run like a dream.

Next is to build a UNO shield for this to plug straight into the top and then box it up.

Many thanks for the instructible, it is a great design, library and code.

GlennL1 (author)2015-07-16

Hi.. can i use tip 9013g instead of one of those you have in the parts list? i'm really new to this stuff..just got my first arduino start kit..

AuI1 made it! (author)2015-07-13

new 3x3x3

Komeniusz made it! (author)2015-07-01

Great project :)

ahmetcanack made it! (author)2015-06-16

I finally made it. It took almost a week to done this progress... It was totally worth it tho :D here is a pic of it :D if you wanna see working i can always upload it to youtube :D

onderyilmaz made it! (author)2015-03-06

It's working :)

ympymp (author)onderyilmaz2015-05-25

hello,the arduino code is write by yourself?

it works but i had to use a diffent code yours since it was giving me an error this is a pic of it i am going to solder an at mega on my stripboard later this is just temporary to see if it would work

and here it is finished

theheartbeatsbass made it! (author)2015-04-21

i didnt quite follow the tutorial so much as i used the diagram to get pin outs and kinda wired it my own way, i still think this is a great tutorial for anyone trying to get into led cubes... for mine i soldered the resistors and transistors right to the cube and then soldered jumper wires to the ends (i dont have perfboard handy) the code is easy to change and add new patterns with the webpage code builder. overall this was a fun relaxing midnight project to put together.

rickental (author)2015-04-17

First arduino project, 5 hours of work, and it is alive!!!!!! Great instructable, Thank You!

Tech Works (author)2015-04-02

Hey.. I made your project and it's running but there is little bit problem with it. These LED are not producing so much light. some times if your room light is on you can't see the LED is glowing or not

BerkayY1 (author)2015-03-01

It works on Arduino Mega Board as well. Thanks for sharing.

c4s6 (author)2015-02-18

BenG6 (author)2015-02-14

Hi Rui,

I am ordering parts to make a led cube, and I was wondering what size wire you used.



nikolai.nankov.98 (author)2015-02-10

The program doest work to me. What is the problem with code?

naomi.n.vandijk (author)2015-01-31

question ... do you use 3 different transistors?

naomi.n.vandijk (author)2015-01-30

question where does the

  • 3x 22k ohm Resistors go ?
eshan.wells (author)2015-01-26

Note to good friend in Saudi Arabia, You have come to the correct instructable. Give yourself a pat on the back!

botgames (author)2015-01-19

It works!!! I spent 2 days building my cube and I'm so happy to say that it works! Thanks for the video tutorial. It made it a breeze to follow and build. It may not look perfect but I love it. Thanks again!

About This Instructable




Bio: Author, Blogger, Electronics Enthusiast and Entrepreneur. For complete Electronics Projects and Tutorials go to:
More by RuiSantos:ESP8266 Web Server (Without Arduino)Arduino Simple Memory GameArduino – Datalogger with Temperature Sensor and Photoresistor
Add instructable to: