Picture of Build your own 4x4x4 RGB LED Cube

LED Cubes are awesome. The first one I created was a 8x8x8 blue led cube. It still works like a charm. But being able to display every colour in the spectrum is much more spectacular. Let's start with a small and simple 4x4x4 RGB LED Cube.

Step 1: Watch part 1 of the video series!

As you might have noticed, part 1 concentrates on the cube itself and the case. No electronics yet. The video should already give you plenty of details. But I will give you a short list of parts that you will need to build the cube itself.

1-40 of 80Next »

I realy like your projects! And i have a question, how many led drivers would i need for 10x10x10 led cube? And if i understood right this drivers that you use wont have enough outputs for such a big led cube, is this right?

ziad67 made it!17 days ago

I was able to make it even bigger by adding more mosfets and adapting the code a little bit and i was able to make a animaton and a explsion animation too with colors and it turned out to be quite nice,Thanks for the tutorial GreatScott.

GreatScottLab (author)  ziad673 days ago


ziad67 ziad6717 days ago

and more TLCs as well but and i was able to pump it up to 8x8x8 so its doble but its based off your tutorial,Thanks

hi greatscott!

Thanks for the great video!

I am planning on making this, although I am not quite sure about how to connect the MOSFETS up, it seems like you have pin A0 ( for the first MOSFET) connected to gate, but also to the source through a 1K resistor, then linked to 5V, and the drain is going to the anode layer, is it correct?

Also where should I connect the capacitors? Just somewhere in the circuit between ground and VCC? Thanks!

sivovic made it!1 month ago

i made it and its sweet. good job great scott for this awesome tutorial

p.s i also made video https://www.youtube.com/watch?v=qLPbEx3UhV0

GreatScottLab (author)  sivovic1 month ago

Awesome. Thanks for sharing.

i got some RGB LEDs and the red LED has a max voltage of 2.2 while the other two have 3.3, i tried the red at 3.3 and it stopped working, does this instructable compensate for this, or will i need different LEDs ?

GreatScottLab (author)  thestalkinghead1 month ago

Since we use a constant current source instead of a constant voltage source, it will properly.

ok thank you

sivovic2 months ago

hi guys i have made it :D the cube is awesome and all the animations and colors but i can notice really, really fast blinking of whole cube. does enyone have any idea what that could be

sivovic sivovic2 months ago

oh and one more thing, i discovered bug. after 1 - 1.5 hours of working the cube gets stuck at red wall animation. its like there something wrong in the code

sivovic sivovic2 months ago

anyone ??????

VishalJ22 months ago

Thanks to you for this awesome work. I made a 5x5x5 cube and it work perfectly.


rainbowracers3 months ago

hello again I discovered the existence of the EEPROM I could put an outline of how to connect to the Arduino thanks again

rainbowracers3 months ago

hello ... my name is daniele I'm 17 years old and I'm Italian. I reproduce your cube but with a small difference in the place of Arduino Nano Arduino I put a one and now I have a problem the second code that is, the one with the new animations tells me I have little space how can I put it inside my arduino?

thanks and answer as soon as possible

sivovic3 months ago

hi guys i have quick question. On schematics 5v from power supply is going to 5v pin on arduino, should it go on vin pin instead ?

GreatScottLab (author)  sivovic3 months ago


tnx. i almost made it :D

efifi4 months ago
antb - try the other programs ledcube12 - it should download, load and ru as is - try it and let me know. i am on the road and will check later
AntB efifi3 months ago

Hi efifi,

Thanks for your answer.

What do you mean by 'ledcube12' ?. If you mean ledcube v2, that is the code I am using.

Quote - The second code only shows the random function. The other ones are included but you have to put them into the void loop() function.

What I need to know is how do I put the other animations inside the void loop() function ?

I hope someone can help me out with this, It's the last bit of info I need to get my cube working as it was designed to work.

Thanks in advance


wredas3 months ago

Hi! Great guide, I will most likely try to build one myself. Love your channel too.

I have a question about the Audrino Nano on Ebay.com, it says you cant use windows 8 to program it. Can it be programmed in some other way without removing my win8 to install windows 7 or older on my computer?

GreatScottLab (author)  wredas3 months ago

I think the arduino ide should support win8. You can take a look at their website: www.arduino.cc

It seems that it should work with win8 64 bit, according to the forums. Wierd that the ebay seller says it won't work with win8.

Thank you for your reply, cheers from Sweden!

MatijaM made it!3 months ago

Here's my version with a twist, I've made it a 5x5x5 :)

LED Cube.wmv(516x290) 17 KB
AntB6 months ago

Hi Scott,

I have made 1 of these cubes but I have not had much luck with the code.

I have added the digital IO Performance and the (modified) TLC5940 libraries to the Arduino IDE

The first code of the whole cube doing the colour change works fine (but it only plays right when using external power source), but version 2 of the code will ONLY play the random flashing led's.

I have checked and rechecked the pcb and can't find anything wrong with it, my pcb is almost an exact copy of yours.

I have no idea where or how (or if) I have gone wrong.

If anyone has any ideas, please comment (I personally think it could be a code problem(some how))

I hope I can get this working as it should,

Thanks for sharing this amazing little cube.

GreatScottLab (author)  AntB5 months ago

Sound like everything works great. The second code only shows the random function. The other ones are included but you have to put them into the void loop() function.

Hi GreatScott,

Thanks for the reply, I have spent over 4 hours moving bits of code from 1 file to another to get the other animations working but have had no success at all. I keep getting Error Compiling for various reasons.

Can you please give me a more detailed description to exactly what data needs to be moved to get the other animations into the void loop() function.

I am still quite new to writing code for the Arduino and don't fully understand it all yet, but I'm learning.

Only 1 step away from the finished 4x4x4 RGB LED Cube, All thanks to GREATSCOTTLAB,

I hope you can provide this information I require to finally complete my cube.

Thanks again

efifi AntB4 months ago

if it works with external power supply the problem might be the power drain on the pin - you need to change the led brightness in your code to something REALLY low so the MC does not brownout and keep restarting. the basic code works out of the box. post the code you are having problems with.

AntB efifi4 months ago

Thanks for you reply efifi. My problem is not with the power, it is with the code.

As stated by Great Scott,

'The second code only shows the random function. The other ones are included but you have to put them into the void loop() function.'

This is what I am having problems with. I am still quite new to arduino programming and I don't understand how to put the other animations inside the void loop() function.

Can you please tell me exactly what you did with the second version of code before you pressed 'Upload' on the Arduino IDE. By this I mean, if you had to move any of the code (e.g. the animations), what code did you move and exactly where did you move it to ?

This is the last bit of help I need with this cube.

I plan to extend this into an 8x8x8, if I can get it to run right as a 4x4x4

If anyone can provide me with the answers I will be eternally grateful.



macriley4 months ago

sorry I downloaded Tlc5940.h and digitalIOPerformance.h from the links provided and I have included it in my library folder but I am getting the fault:

"Arduino: 1.6.2 (Windows 8.1), Board: "Arduino Nano, ATmega328"

ledcube.ino: In function 'void loop()':

ledcube.ino:61:23: error: 'reset' was not declared in this scope

ledcube.ino:61:41: error: 'randomRED' was not declared in this scope

ledcube.ino:61:61: error: 'randomGREEN' was not declared in this scope

ledcube.ino:61:80: error: 'randomBLUE' was not declared in this scope

ledcube.ino:70:20: error: 'CubeUpdate' was not declared in this scope

Error compiling.

I hope that makes sense to someone as i am really confused???

macriley4 months ago

hi thank you for this great instructable. i have just finished my circuit and was taking a look at the arduino (my first project using one), i am having problems uploading the code, i have downloaded the other two programs but i still get the error stating they are not avalible, any advice would be great

thank you

efifi macriley4 months ago

"downloaded the other 2 programs" - what does this mean? downloaded from the internet? what are the other 2 programs? what is the error you are getting - what is not available?

it is not very clear what you are doing and what is not working? I suggest you look at the arduino forum, there is lots of help and advice in getting things set up.

efifi made it!5 months ago

My 9 year old and I made your power supply first then your cube. Great work Scott - we loved it. Your instructable was excellent, although a bit fast - I just had to watch it a few times. I posted a video of them both - http://youtu.be/9kdbGer-0fM

I discovered lots of gotya's - for example while trying to test, the power drain on the nano was too great, as a result the nano kelp rebooting - Solution - reduce the brightness or plug it into its own power source. Not to mention a couple of shorts, and poor connections - "dont forget to test each connection with a volt meter for continuity and shorts" - VERY IMPORTANT step, dont skip it.

GreatScottLab (author)  efifi4 months ago

Awesome! Thanks for sharing the video and pics!

Tekknologgy4 months ago

Hi Scott!

1. How did you choose the 1k Pull-Up Resistor for the MosFETs?
Calculation with the Gate-Source Leakage Current and 5V says that the
Resistor must be 50MOhm. But a 50MOhm Resistor would make the Switch
Time huge and the MosFET maybe hot? Or what was your intention to take a

2. What about Protection of the Arduino PINs to the MosFETs?
As Gate-Source acts like a Capacitor the Current is infinite for a short Time.
Many People say there must be a Resistor with ~140Ohm to limit Current to 40mA.
I know that this is important at high frequencies... But what about multiplexing?
100Hz is Flicker-Free for the Eye. When i cycle the Layers with 100Hz - is that relevant for the PIN of the Arduino?

3. What would you make with a grater Cube?
MosFET you choose sources ~4A at 5V Gate-Voltage. With more LEDs and
more Layers they are to small. For Example: 8x8x8 RGB 8x8=64 LEDs in one Layer.
8 Layers with multiplexing i have 1/8 Light from the Diodes. So i must
use Peak Forward Current in the Leds to reach the full lumination of the
LEDs. So the Current must be 8 Times higher which makes 160mA. The most
LEDs can 150mA Peak Current. The TLC5940 can 130mA. So the Max Current
in a 8x8x8 RGB LED Cube is 8x8x3x0,130 = 24,96A. I have not found
P-Channel MosFETs that provide 25A at 5V Vgs. N-Channel is not a
Problem. But because the TLC5940 sinks the Current from the LEDs into
GND i must either use a P-Channel or an N-Channel with higher Voltage
than 5V where i need a second Voltage Level. Is there a Choice that i
didnt see?

GreatScottLab (author)  Tekknologgy4 months ago

1. That makes no sense.

2. You can add a resistor if you want to be on the safe side, but it will also work without one.

3. There are many solutions to this problem. Just seach for an 8x8x8 RGB LED Cube here on instructables. I am sure you will find a solution.

HarikrishnanK4 months ago

sir where is your first code for simple colour change.

is there any problem using arduino UNO?

works fine on an UNO - make sure your pin assignments are correct

CalebJ15 months ago

Great Scott the RGB LEDs on Amazon.com are out of stock can you please find some other one

1-40 of 80Next »