My latest 4x4x4 cube, using pink LEDs and made for my girlfriend

Make your own 4x4x4 LED cube with an Arduino Uno

Pretty in pink

So, a few weeks ago I shared my LED cube on the site, but didn’t give a full walkthrough on how to build one.

Since then I’ve actually built a couple more, and I’ve pretty much got the process memorised now..

This LED cube uses an Arduino Uno micro-controller to create a stunning light show, and in this guide I’ll show you how you can make your own, as well as give you some advice on the things you should and shouldn’t do.

By the way, pink is optional.  This cube is for my girlfriend!

 

Before you start

Before I get into part lists and then actually showing you how to make the thing, there’s a few things to say about the process.

First of all, you don’t need to understand or even care about the circuitry or the programming of this cube in order to build it.  I’ll be describing the process in enough detail to take anyone with some basic soldering skill through to completion.  That being said, I’ll also try and explain a bit of theory about the cube so that, if you want, you can understand about it.

Second, patience is key for this project.  If you take your time and plan carefully then you’ll come out with something that looks the part.  If you rush, cut corners or guess at things then it won’t look anywhere near as good.  Practice also makes perfect.  The cube that I show you in the pictures in this guide is actually my third cube using this design, so don’t be discouraged if yours doesn’t look as good.  Of course, if yours turns out better, then I hate you.

Lastly, the most important thing in this project is that you have fun.  I’m assuming that you’re interested in electronics, because you’re reading this article, so let’s get cracking on the next page with a part list.

 

 

Next Page: Part List

85 thoughts on “Make your own 4x4x4 LED cube with an Arduino Uno”

    1. So the 4 cathodes are connected using the 4 pieces of wire that are threaded through the cube from the bottom (one per layer). At the other end they’re connected as per the diagram to the Arduino.

    1. Hi, the jewellers wire is used for two things:

      1) For connecting together strips of four LEDs in order to form each of the layers
      2) To connect the common cathodes of each layer to the Arduino.

      It doesn’t really matter where you place these strips of wire, though I tend to put them just inside the cube structure. You need to attach one piece of jewellers wire to each of the layers, which will then feed down into your case so that you can connect the layers to the Arduino.

      1. Or you can use solder wire itself, though i found this to be incredibly weak and has a tendency to melt (cant understand why though) :)

  1. HEY I COULDNT UNDERSTAND THE CATHODE CONNECTIONS.. AFTER CONNECTING THE JEWELLER WIRES I HAVE 8 END SREMAINING . SHOULD I CONNECT THEM TOGETHER PER LAYER TO GET FOUR CATHODE WIRES

    1. Each layer of LEDs should have a common cathode. You can cut off any LED legs or jewellers wire that protrude from the layer, the important thing is that all of the cathodes on the layer are connected together.

  2. I have made a 3x3x3 cube……. thanks to ur instructions…… but I couldn’t get jweller’s wire…. any idea from where can I get it online???

  3. MATT thanks for the tutorial it was really helpful.. I would be happy if you share ur codes with us.. !! Thanks in advance bro !!

  4. Hi Matt. Great instructions. I now am the proud owner of my very own 4x4x4 Cube. ( I had to do a more manly Red lol ) My cube does not look that straight though :~) I have made a couple of routines too. Thank you for your clear concise instructions. and some code to start me off.
    Cheers..

  5. Hi Matt,

    I’m about to order the part to try reproducing your setup. I’m not familliar with LED mcd, what brightness do you recommand ? Is 200mcd enough ?
    Thank you for thoses great instructions btw.

    1. Hi, 200mcd seems a little low. As an example, the LED’s in my blue 4x4x4 cube are 2000mcd. But, you may find that 200 is enough for you, it depends on whether you want your cube to glow nicely or shine like the sun.

    1. The cube uses persistence of vision to give the impression that all four layers are on at the same time, when in reality only one layer is on at any one time

  6. oke thx, i use the same board. But when i will upload the code to the Uno, the program say; you choose the wrong chipset.. I’ve checked the board setting again, but the setting is on “Arduino Uno”..

  7. Hi,
    thanks for the instructions, but what is about the transistors?
    i have seen in others tutorials that they had used 4 transistors connected to the 4 layers.
    Sorry but my english isn’t good

    1. Hi Emanuel, this design does not require additional transistors. Larger designs sometimes use transistors if the micro-controller board can’t provide enough power to the layers.

    1. Hi, if you use Male/Female then theoretically you would be able to connect the jumpers to the LED legs without solder.

      To be honest, as long as you have one male end and are willing to do a bit of soldering, you’re fine.

  8. Hi Matt, I had read your detailed tutorial and wanted to build one myself too. But I am thinking can I not stuck my ardiuno uno there permanently and replace a barebone? I don’t know how to do that, if you are able to help. Thanks.

  9. Hi Matt, great design and a very easy to follow guide. My question is regarding your program that you listed. I know you made it but would it be possible either for a brief explanation on how you made it, so I can make my own routine, or can you point me in the right direction to learn the codes your using. I have an ruinous book but your code does not match up. Thank you in advance for your help

    1. Hi, I didn’t actually write the program, it was sourced from another guide. It would be quite difficult to describe the way the routines work, the best thing to do would be to play around with it and see what effects you cause on the cube.

  10. Hey Matt,

    Just made one of these with your instructions. I chose 3mm white LEDs but they had considerably shorter legs than yours. I ended up with a much smaller cube. It still looks great, but the soldering is tight!

    Anyway, a great way to spend a day on the weekend and thank you for the inspiration for this (I did look at other guides but yours was the easiest).

    I didn’t use veroboard for the bottom. Instead, I put the cube on the box, pulled the legs out in a ‘Z’ formation to lock it in, then siliconed it in and soldered resistors directly to the base and attached DuPont wires. Cutting the veroboard without my Dremel gave me a headache and too many pulled tracks!

    Thank you and best wishes.

      1. Ok, I’ll email a picture to you.

        My silver wire was a little too thick – 1mm. Something a like 0.6mm would be have been better. Anyway, in real life, you can’t tell and it probable adds strength to the structure.

        Thank you again!

  11. Thank you so much for your instructions I did my own 4x4x4 led cube and I used your pin out put and it seems to work great, However my A0, A1 out put pins if they are used at the same time or 1 at a time the LED light up. If the A0, A1 led or light up with other pins A0, A1 LED will not light up. So I turned on all the LED and the entire column of A0, A1 are not lighting up. Do you know what could be the cause of this issue?

    Thank you
    Adrian W

    1. Hi Adrian, the first thing to check would be a wiring fault. Make sure that there isn’t any solder connecting anodes and cathodes on any of the LEDs, and make sure that your jewellers wire isn’t making contact with any layer other than the one it’s supposed to.
      I did have a similar problem once, and it turned out to be a fault Arduino, so if you have another board laying around it may be worth swapping them out quickly and checking if the problem goes away.

  12. Hi Matt, I actually followed a different site firstly to build my 4x4x4 LED cube. In this method, I ended up constructing my LED’s with 16 cathodes and 4 common anodes. The code provided with the design wasn’t Arduino compatible and I had to build a circuitry according to your instructions which has 16 anodes and 4 cathodes; b,cos your code is Arduino compatible. I have completed the complete structure and the code runs in reverse (obviously, anode is cathode now). In this process the code works but, in opposite fashion. I ended up lighting all the leds and where the leds should turn Off, they come On and viceversa.
    Now, I want to know if there is any possibility in modifying the code with high as low and viceversa; instead of changing the LED’s connections completely? Changing the LED’s anodes and cathodes completely isn’t possible now.

    Any help provided is appreciated….. Thank you!

    1. Hi, I didn’t write the original program so it’s difficult for me to comment on whether it can be easily adapted for “reverse running”. Have you considered just writing your sequences “in reverse” so that it looks how you want?

  13. I have a Problem with the connection.
    I know whats about the 16 Pin – ok.
    But what means Layer 4 – A5, Layer 3 – A4, Layer 2 – A3, Layer 1 – A2 ??

    Do i need
    -16 Connections for the “columns”
    -4 Connections to the GRN

    AND 4 Connections for eatch Layer?

    Or is it Possible to change the PIN A5,A4,A3,A2 to GRN ?

    i’m a bit confused.

    BTW. Great Tutorial.

    1. Hi, I’m not sure what you mean by GRN. You need a total of 20 connection for this cube:

      16 cathode connection (one per ‘column’)
      4 anode connection (one per layer)

      The 4 layer connection use A5,A4,A3 and A2

  14. I thought the Uno only had 14 I/O pins. A 4x4x4 needs 16 for the horizontal layers and 4 more for the vertical layers meaning 20 pins to address the cube. I can’t see where you’ve hardware multiplexed pins to address the cube, so have you done it using POV in software? I’ve not looked at the code, I’m just doing a hardware design ATM and anything over 3x3x3 tends to use a simple multiplexer or a more complicated shift register design. Always do it in software I was taught as it’s cheaper!

    Other posters have asked about using transistors to drive the cathode. As the LEDS are on/off in short bursts you can probably get away with not having them, but with a duty cycle approaching 100% I’d be tempted to add them. they’ve cheap and help protect your uno :) as it can sink a max of 40ma per output.

    A nice tutorial and you’ve made a great cube :)

    My next design will be an LED clock. I was going to do a nixie tube, but they’ve quite expensive!

  15. Hey, i’m try’n to make my own code. But one thing i don’t understand. Witch part in your code is relevant if you try to activate some LED’s in diffrent layers? I know how to active LED’s in one Layer but i don’t know how to in more layers (but not all) at the same time. Hope you understand what i mean.

    1. Hi, if you refer to page 7 of the guide, there’s an image of some sample code. Each line of the code represents one line of animation for all four layers. Each LED in the cube is addressed in one of these lines. If there is a “1” then the LED is on. If there’s a “0” then the LED is off

  16. Love your build here I am building this cube with a Arduino Nano and don’t get the cube/chip connections, what columns go where? Your Diagram shows from the top looking down I understand that but it says to connect columns to pins 1,2,3,4 etc well pin 4 on a nano is ground we can’t have that? Can you please give me the columns connections from the top like you did but with the way the pins are named on the chip TX, RX, RST, GND, D2, D3, A1, A2, etc. Please

    Thanks Anthony

    1. Hi Anthony, the layout diagrams above show the pin names, not the pins as seen from left to right. So, when I say connect to pins 1,2,3,4 I mean connect to digital IO pins 1,2,3,4, as shown on the board.

      The pin names on a Nano and Uno correspond so there should be little issue using a Nano.

      There’s an excellent CAD drawing that shows the pinouts here: http://grabcad.com/library/arduino-led-cube-1

      Have fun with your cube and be sure to email me a photo (admin@techmadeeasy.co.uk) so that I can add it to the gallery of cubes made using this guide.

  17. I got it all soldered up now and uploaded your program and only the bottom 2 rows are working correctly? Any guesses, I checked all my solder joints and tested the lights individualy and they work yet the top rows don’t work. When I put an aligator clip on a ground connection from one of the rows thats working I thought it would mirror that row, but it just shuts that row off too? any help would be appreciated as I’m excited now that I’ve seen the light LOL.

  18. Hello i was able to make the led cube, it was nice and easy..

    Now I am planning to make one that will change patterns when we clap

    can you please suggest something what should i do, I have no idea how to proceed

    1. Hi, congratulations on finishing the cube, I’d love to see a picture so that I can add it to the gallery. Adding sound sensitivity to this design is going to be very difficult; there are no inputs left on the Arduino to allow for a microphone. There are tutorials out there that help you to make a sound reactive cube, but they use different connectivity and different programming to this cube. Best of luck!

  19. Hey matt,,
    i really want to thank you for being such a nice guide….
    i completed my very first led cube,it took me a day and half to complete….nothing went wrong there were no questions to be asked…your guidelines are perfect..thank you for your every effort you made for this nice presentation…i really appreciate your work..keep it up brother. THANK YOU.

        1. I think it’s best to look for an existing guide online, I’m afraid I don’t have the capacity to write up a guide at the moment, and it would only be a carbon copy of an existing guide

  20. Hello,

    I was need to edit code like this

    int LEDPin[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, A0, A1};
    int PlanePin[] = {A2, A3, A4, A5};

    to get it working.
    Board Arduino Leonardo.
    IDE 1.5.6-r2

    Thanks for tutorial.

  21. Just finished building my cube according to your tutorial.. works fine and looks nice!!
    A big thank you from Germany!!

  22. Very simple question, if there are 16 lines using a 5v source, 4 leds in series using 2.1v @ 20mA each, the math for me is not adding up which is making buying the correct resistors damn near impossible. 5 volts should not be able to power all 4 leds in series. I just need to know what resistors to buy lol. I am building two cubes, 1 using blue leds 3.2v @ 25mA, and the other with green leds 2.1v @ 20mA. Much appreciated.

  23. Hi Matt,

    I have one question about the cube.. I’m using a arduino nano for it. Everytime i start a loop.. The more leds i use the less light are coming of the leds.. For example if i use only one led this led is more litt then when i use 5 leds.. Any idea how this may come?

    1. Hi Jereon, I’m not quite sure, I’ve never experienced this myself. Off the top of my head I have two questions: What power supply are you using, and what resistor values have you used for the Anode legs? I’ve never used a Nano so not quite sure how much power it can deliver, but I’d imagine enough to power 16 LED’s at a time (which is all the cube ever actually lights as it switches layers really quickly)

      1. Hi Matt,

        The powersuply will be the arduino nano feeding from USB. But when i power it by a 9V battery it doesnt seem to change a thing..
        I use 3mm green led lights with the following specs: forward V: 2.0,
        Max continuous Forward Curr: 30mA. I use these leds with a 100 Ohm resistor.. The max peak is 75mA.

        And is there any way to fade the leds in a shape..?

        Thanks!

Leave a Reply