Introduction: 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: http://randomnerdtutorials.com/

Watch this Demo Video of my project:

Step 1: 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

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

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

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)

Comments

author
TanapolR made it! (author)2017-06-10

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

author
Arslanimtiaz made it! (author)2017-06-04

sir can you give me truth table of this

author
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.

15007593_1236961436362248_1672894839_o.jpg
author
Capt. AldrinR made it! (author)Capt. AldrinR2017-05-15

Uploading using IDE 1.0.6 worked for me! Thanks!

author
omkar2309 made it! (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?

author
daryoush_daruoush made it! (author)2016-12-15

hi

what is the this circuit voltage ?

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

work thanks bro

2016 - 1.jpg
author
ChomnabK made it! (author)2016-10-26

why Error compiling for board Arduino

author
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.

My 3x3x3 Cube Shield 1.jpg
author
vignesh kailas made it! (author)2016-07-22

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

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

Atlast I made it !! , the effects are cool

IMG_20160506_032204.jpgIMG_20160506_032126.jpgIMG_20160506_032145.jpg
author
NicsP made it! (author)NicsP2016-06-30

hey u can send me code ?

author
vaasu070 made it! (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

author
TitD made it! (author)2016-04-21

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

author
HarshitA7 made it! (author)2015-10-31

hi

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

author
mahfuz097 made it! (author)mahfuz0972015-11-28

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

author
SzymonD made it! (author)SzymonD2016-03-04

Do you found any solutions?

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

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

author
mahfuz097 made it! (author)mahfuz0972016-03-05

Yah. I found the solution.

author
HarshitA7 made it! (author)HarshitA72016-03-05

HI
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.

author
jiroleminen made it! (author)jiroleminen2016-03-22

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

author
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() {
pinMode(1,OUTPUT);
pinMode(2,OUTPUT);
pinMode(3,OUTPUT);
pinMode(4,OUTPUT);
pinMode(5,OUTPUT);
pinMode(6,OUTPUT);
pinMode(7,OUTPUT);
pinMode(8,OUTPUT);
pinMode(9,OUTPUT);
pinMode(10,OUTPUT);
pinMode(11,OUTPUT);
pinMode(12,OUTPUT);

}

void loop() {
for (int kat = 10; kat <= 12; kat++){
for(int kolon=1; kolon<=9; kolon++){
digitalWrite(kolon,HIGH);
digitalWrite(kat,HIGH);
delay(50);
digitalWrite(kolon,LOW);
digitalWrite(kat,LOW);
delay(50);
}
}
for (int kat = 10; kat <= 12; kat++){
digitalWrite(1,HIGH);
digitalWrite(kat,HIGH);
delay(100);
digitalWrite(1,LOW);
digitalWrite(kat,LOW);
delay(100);
digitalWrite(2,HIGH);
digitalWrite(kat,HIGH);
delay(100);
digitalWrite(2,LOW);
digitalWrite(kat,LOW);
delay(100);
digitalWrite(3,HIGH);
digitalWrite(kat,HIGH);
delay(100);
digitalWrite(3,LOW);
digitalWrite(kat,LOW);
delay(100);
digitalWrite(6,HIGH);
digitalWrite(kat,HIGH);
delay(100);
digitalWrite(6,LOW);
digitalWrite(kat,LOW);
delay(100);
digitalWrite(9,HIGH);
digitalWrite(kat,HIGH);
delay(100);
digitalWrite(9,LOW);
digitalWrite(kat,LOW);
delay(100);
digitalWrite(8,HIGH);
digitalWrite(kat,HIGH);
delay(100);
digitalWrite(8,LOW);
digitalWrite(kat,LOW);
delay(100);
digitalWrite(7,HIGH);
digitalWrite(kat,HIGH);
delay(100);
digitalWrite(7,LOW);
digitalWrite(kat,LOW);
delay(100);
digitalWrite(4,HIGH);
digitalWrite(kat,HIGH);
delay(100);
digitalWrite(4,LOW);
digitalWrite(kat,LOW);
delay(100);
}
}

IMG_20160417_021010.jpg
author
Sud007i made it! (author)2016-02-01

I made it...

P_20160202_004523.jpg
author
EthanS28 made it! (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.

author
Aman123456789 made it! (author)2015-10-25

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

author
Charlie fl made it! (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.

author
RuiSantos made it! (author)RuiSantos2013-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.
randomnerdtutorials.com/feedback

author
naomi.n.vandijk made it! (author)naomi.n.vandijk2015-01-31

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

author
SowrabhN made it! (author)SowrabhN2015-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...

author
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.

My 3x3x3.JPG
author
GlennL1 made it! (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..

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

new 3x3x3

2015-07-13 22.12.02.jpg
author
Komeniusz made it! (author)2015-07-01

Great project :)

2015-06-26 15.52.18.jpg2015-06-26 17.02.21.jpg2015-06-26 18.00.59.jpg2015-06-26 20.31.26.jpg2015-06-27 16.00.21.jpg2015-07-01 19.04.32.mp42015-07-01 19.21.10.jpg2015-07-01 19.21.21.jpg
author
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

Screenshot_2015-06-17-01-14-31.png
author
onderyilmaz made it! (author)2015-03-06

It's working :)

temp_-1771190693.jpgtemp_-1112886053.jpg
author
ympymp made it! (author)ympymp2015-05-25

hello,the arduino code is write by yourself?

author
panagiwths.zafeiropoylos made it! (author)2015-04-24

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

20150424_140422.jpg
author

and here it is finished

20150427_012812.jpg
author
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.

62495b2c-5d4e-4009-89f5-836c13c93c38.png
author
rickental made it! (author)2015-04-17

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

author
Tech Works made it! (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

author
BerkayY1 made it! (author)2015-03-01

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

author
c4s6 made it! (author)2015-02-18

author
BenG6 made it! (author)2015-02-14

Hi Rui,

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

Thanks,

Ben

author
nikolai.nankov.98 made it! (author)2015-02-10

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

author
naomi.n.vandijk made it! (author)2015-01-31

question ... do you use 3 different transistors?

author
naomi.n.vandijk made it! (author)2015-01-30

question where does the


  • 3x 22k ohm Resistors go ?
author
eshan.wells made it! (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!

author
botgames made it! (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!

author
crazyjohn.neji made it! (author)2015-01-11

the code are wrong and i got 1 column wont light up

10928081_921982267820125_1979810156_n.jpg

About This Instructable

107,914views

140favorites

License:

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