If you’ve dabbled with some budding Arduino projects but are looking for something a little permanent and on a whole different level of awesome, then the humble 4 x 4 x 4 LED Cube is a natural choice. The design is much simpler than you might think, and using multiplexing, we can control all the LEDs right from one Arduino Uno board. This is excellent soldering practice and the total cost of the components should not exceed $40.

Today I will go into detail about the constructive side and provide software to make it work that will look impressive and teach you the basics.

You will need

  • Arduino . The supplied code assumes an Arduino Uno, but can be adapted to a larger model.
  • 64 LEDs — the choice is yours, but I used these bright 3mm blue LEDs ( 3.2V 30mA ) at £2.64 for 50.
  • 16 resistors appropriate value for your LEDs. For the LEDs above, 99p bought 100 of them. Use ledcalc.com — enter 5V for supply voltage, LED voltage (in my case 3.2) and current in milliamps (3.2). Your desired resistor will be shown in the box labeled «nearest higher value resistor» and then just search for that value on eBay.
  • A little craft wire to strengthen the base structure and for finishing — I used the thickness 0.8 mm .
  • Bread board some type that you can solder all your bits to. I used one that didn’t have full tracks along it since I don’t have a road cutter, but use what works for you. The Arduino prototyping shield is too small, unless you squeeze your LEDs together.
  • Random component wire — some cores of the network cable and some prototype wires from the kit will work fine.
  • Clips «crocodile» or «helping hands» are useful for holding the bit in place.
  • Soldering iron and solder.
  • Some wood.
  • Drill with a bit the same size as your LEDs.

Note: The 3D drawings in this tutorial were completed in a few minutes using TinkerCAD. I followed the existing build, in detail describing Instructables by user forte1994 which you may also want to read before attempting this.

Be sure to read all of these instructions, before than trying to do it yourself.

The principle of this design

Before you start building, it’s important to have a complete overview of how the thing will work so you can improvise and catch bugs as you go. Some LED cubes use one output pin for each individual LED — however in a 4x4x4 cube this would require 64 contacts, which, of course, we don’t have with the Arduino Uno. One solution would be to use shift registers. but it is unreasonably difficult.

To drive all of these LEDs with just 20 pins, we’ll be using a technique called multiplexing. Breaking the cube into 4 separate layers, we only need control pins for 16 LEDs — so to light a particular LED, we have to activate both the layer and the control pin, which gives us a total requirement of 16 + 4 pins. Each layer shares a common cathode — the negative side of the circuit — so all the negative legs are connected together and connected to the same pin for that layer.

At the anode (positive) side, each LED will be connected to the corresponding LED in the layer above and below it. Basically, we have 16 columns of positive legs and 4 layers of negative ones. Here are some 3D connections to help you understand:

arduino led frequency

Arduino LED program


Since we won’t be using an all-metal soldering structure, we want all of the LED legs to overlap by about a quarter to give the structure rigidity. Fold the cathode of your LEDs — the side with the flat notch in the head and the shorter leg — over as shown. (It doesn’t really matter if you bend it left or right as long as you are consistent and never touch the anode)

Arduino LED program

The first important part of this project is the manufacture of the wood cutter. This will hold the LED layer in place while you solder the legs together, so it needs to be accurate and not too loose. Using a drill bit the same size as your LEDs, measure and then drill through the 4×4 matrix equally spaced holes. Keep in mind that you want about a quarter of a leg to overlap, and use a real ruler. Check each hole to make sure the LED is tight, but not so tight that you won’t be able to pull it out again or you’ll have trouble trying to remove the fully soldered layer.

Arduino LED program

Solder cathodes of 4 rows of LEDs. Be careful not to burn out the LEDs — you need a good hot iron as well as getting in and out. Here are my first four rows completed.

arduino led

Now, to stiffen the layer, cut and solder two straight pieces of wire wire to both ends, making sure they connect with each row. This is your first layer completed. Leave all extra legs sticking out to the side.

Now is a good time to test — just load the default Arduino blink app and with a resistor connected, connect the ground to the layer frame and push the positive lead to each LED in turn.

arduino led

I hope they all light up. If not, make sure you haven’t missed a solder joint somewhere and replace the LED if necessary.

Remove this layer from the clamp and repeat the process again 3 times .

Don’t worry if your soldering isn’t perfect — as long as it doesn’t break and the connection is solid, it won’t affect the final product. I admit, my soldering was pretty bad, my clamp was off and it all looked like the Leaning Tower of Pisa. However, I’m proud of the finished cube, and when the LEDs are lit you won’t be looking at the solder joints anyway!

Merging layers

Once you have 4 completed layers, you will want to connect all of the vertical legs together. I found this to be the hardest part of the build and to help with the process I cut the riser out of the map.

arduino led

This kept the layers at the appropriate height, but many of the legs still wouldn’t line up perfectly — for this I used a few crocodile clips to hold them in place.

How to make a pulsating Arduino LED cube that looks like it came from the future, sturdy vertical legs with crocodile clips

1st stupid mistake to avoid

It wasn’t until I completed the full layer that I realized my card riser was stuck in place, so I had to cut it out! Don’t make the same mistake I did — make the riser longer on the side and connect the card pieces outside of the cube so that once the layer is complete you can disassemble the riser and pull the card out.

How to Make a Pulsating Arduino LED Cube That Looks Like It's From a Future Layer 3 Map

2nd stupid mistake to avoid

Don’t solder the vertical leg to the cathode frame, obviously. Vertical legs should only be connected to other vertical legs, and nothing else.

Again, test after each layer has been attached. Test all layers by actually only touching the positive wire to the tip of the topmost layer, thus ensuring that you have good contact going through all layers.

When all 4 layers were soldered together, I started to clean up a little — I left one leg extended out of each layer in the form of a step — this would be lowered onto the board later. Other extraneous pieces of the metal frame and legs were cut off. Obviously don’t cut any of the vertical legs — we have to put them in our breadboard.

How to Make a Pulsating Arduino LED Cube That Looks Like It Came from the Future

Board mount

Remember when I said attaching each layer to itself was the hardest part? I was lying. Trying to fit 16 LED legs into tiny holes on a breadboard is actually more difficult. The easiest way I found was to pierce 4 at a time, secure them at the bottom with alligator clips, and then move on to the next row of 4. Use a marker pen to mark the intervals ahead of time if that helps.

How to make a pulsating Arduino LED cube that looks like it's from the future and attach it to a board

In hindsight, I would actually put the resistors on the breadboard first. I actually soldered all the legs of the cube to the board and then tried to gently push the resistors between them. Learn from my mistake and put your resistors first.

I tried to distribute them evenly, stepping so that I could use one whole side of the cube for all the last connections to the Arduino. Here is the circuit I went with:

How to make a pulsating Arduino LED Cube that looks like it's from the future.

For the four negative layers, I dropped one wire down from each layer and then simply dragged them out of the way, like this:

How to make a pulsating Arduino LED that looks like it came from the future from cathodes with top stages

Finally, I added some connecting wires, which could then be inserted into the corresponding Arduino pins. Use the longest view you have. Please note that I messed up the order in places due to poor planning. Each row of LEDs was colored.

How to Make a Pulsating Arduino LED Cube That Looks Like It Came from the Future

That’s all. Finished!

How to make an Arduino pulsating LED that looks like it's from the future 4x4x4 finished LED cube

Programming Your Cube

I know you can’t wait to run this thing, so connect the 4 negative layers to the ports analog input/output A2 (lower level) — A5 (upper level) (they can also act as digital inputs/outputs) . Then connect 16 LED control pins, starting with +1 in extreme right position on the port digital I/O 0 With +15 and +16 to analog A0 and A1 . (Don’t use AREF and GND)

arduino led frequency

Download demo samples and code from learner user forte1994 . He also provided a useful online byte pattern design tool to customize your own sequencing. Here is a video of this code in action on my cube (I set speed to 5 instead of default 20) .

Of course, this is not the only way to program your cube, so let me take a few minutes to teach you the basics of programming your own templates rather than playing the preset templates like in the demo above.

There are a few things you should be aware of when trying to program your cube:

  1. To address a single LED, use plane (layer) numbered 0-3 and LED pin numbered 0-15. Turn the plane to the LOW output (as it is the negative leg) and the LED pin number HIGH (the positive leg) to activate the LED.
  2. Before activating one LED, make sure all other planes are off — that means set them to HIGH output. Failure to do so will result in a column of LEDs lit instead of a single LED.

With that in mind, I’ve made two very simple programming sequences for you — download the code from here. The first one simply lights up each LED sequentially, sequentially. To do this, we use two for loops, iterating over each layer and each control output.

Second random loop (you need to comment out the first one and include it in the main loop to test it). It simply selects a random layer and a random control pin, flashing them on and off.


Don’t be intimidated by this build — I’m seriously lacking in soldering skills and I handled it well (I think?) . The total build time was about an hour a day for a week. Next time I’ll try to teach you more ambitious cube programming, so I hope you join me in building your own cube this week and uploading new code next week — and if you do make your own great applications or sequences, please upload them to Pastebin and let us know in the comments!

Похожие записи