Introduction: The World's Smallest 4x4x4 RGB LED Cube

Picture of The World's Smallest 4x4x4 RGB LED Cube

I believe this is "currently" the world's Tiniest 4x4x4 COLOR LED Cube. There are smaller ones but are usually single color and made up of fewer LEDs (3x3x3).

The actual LED cube is less than 1 inch square. It uses sixty four 3.2mmx2.7mm SMD RGB LED (Surface Mounted Device, Red+Green+Blue, Light Emitting Diode).

In this Instructable, I will share with you how I built it.

Credit where credit is due:
Original design and code is by Asher Glick and Kevin Baker.

I "simply" made a super tiny version of it. :-)

Step 1: Parts

Picture of Parts

These are the exact LEDs that I used, but you might want to shop around for square profile LEDs. It would make soldering easier. You'll see why in later steps.

1 x Arduino
I used an Arduino Nano clone. However, most Arduino with 16 or more I/O pins should work.
Unless you're comfortable modifying code with PORT commands, I'd recommend staying with a true ATMega based Arduino (do NOT use ESP8266, Arduino M0, Arduino Due, etc)

Custom PCB
Due to the insanely tiny dimensions that we're dealing with, soldering wires for the point to point connections is too complex to do by hand, so I designed a PCB for it. It would be cool to see more tiny cubes in the world so I've shared my custom PCB.

Step 2: Soldering LEDs Into Pillars

Picture of Soldering LEDs Into Pillars

The cube consists of sixteen pillars.

Each pillar consists of four rotated LEDs such that powering any two of the four leads would turn on only one color of one of the LEDs. The Arduino switches the LEDs so quickly that our eyes are fooled into thinking that multiple LEDs are on at once.

After trying many different jig ideas to hold the LEDs while I solder them, my final jig is made of three layers of cardboard. This is where it would have been simpler had I used LEDs with symmetrical square profile. To keep the symmetry as I rotate the LED at each layer, I had to create a jig that hold the LEDs at different depths!

Please see the photos and video for more detail.

This project, as with any LED cube is very labor intensive, so I took every precaution possible to ensure success. I test all the LEDs at every step to catch mistakes as early as possible.

Step 3: Designing the Custom PCB

Picture of Designing the Custom PCB

First photo above is the bottom wiring of my normal sized CharlieCube. There was a lot jumper wires that cannot short each other. Difficult, but doable at that scale.

I had naively thought I would be able to do the same thing for this cube. However, due to the tiny size of the cube, running wires in around all the 64 pins at the bottom of the PCB (and not create a short) is pretty much impossible. So, I learned Eagle CAD (mostly from YouTube :-)) and designed my very first custom PCB. It is one giant sorry mess, but it works! lol

Step 4: More Soldering :-)

Picture of More Soldering :-)

The distance between pillars is only about 1 milimeter! To be safe, I painted the solder joints with clear nail polish so the pillars would not short out even if they accidentally touch each other.

I decided to solder the pillars onto the top of the PCB instead of the bottom because I was worried that I would not be able to keep the pillars straight and even with the other pillars if I could not see them as I solder. The side effect of that decision is that sometimes I had to put the iron tip between the wires. Despite that extra challenge, I think it was the right decision. I soldered the inner pillars first and worked circularly outward to minimize the obstruction.

Step 5: Minor Code Tweak

The original CharlieCube uses common Cathode LEDs. However, my LEDs are common Anode!

Thankfully, Asher Glick did an awesome job isolating the code that controls the LEDs. I only had to invert the bits in cubeplex.h so what used to be High is now Low and vice versa!

// Original Common Cathode(-) version
PORTB = pinsB[pin1];
PORTC = pinsC[pin1];
PORTD = pinsD[pin1];
// Modified Common Anode(+) version
PORTB = ~pinsB[pin1];
PORTC = ~pinsC[pin1];
PORTD = ~pinsD[pin1];

Original code is available here.
Modified code is available here.

I truly hope that your would build this or even smaller ones! However, please realize that as with any LED cube build, there are many opportunities to make mistakes that would be impossible to fix. I will share the joy of your success, but sadly I would not be able to help you debug your cube. :-( So, take your time and test every step.

PS: If you succeeded in building one, please post a link to yours at this Instructable and/or my YouTube channel.
Good luck!

PPS: I used the lasercutter at my local MakerSpace, but it would be awesome to have one at home. If you think this is a cool project, I could use your vote to win a lasercutter. Thanks!!! :-)


lrusnac made it! (author)2016-05-10

And here is my copy of it :)
done it on the original pcb designed by Hari and without any jig. I had fun building it.

here is a small video of it

HariFun (author)lrusnac2016-05-10

Woohoo!!! and now there are three!!!

I can't believe you were able to line up those leds so well without a jig! Kudos!!!

KDLaun made it! (author)2016-05-06

After all the time I spent building the WS4^3LC, I thought it might be deserving of a protective enclosure. After tossing a few ideas around, the end result involved a 3" x 4" watch dome, some 20mm brass standoffs and an Arduino Nano connected to a mini breadboard via some 1/8w resistors. It might have been a bit more elegant with a direct connection to the PCB, but I wanted to retain the ability to unplug the the cube if necessary. Power is supplied via an old USB mouse cable through the VIN/GND pins on the Nano.

HariFun (author)KDLaun2016-05-06

Great Idea Karl! It's beautiful!
Where is the Nano? Is it underneath the breadboard?

KDLaun (author)HariFun2016-05-06

That's correct. Due to the way the orientation of the cube PCB came out, I ended up having to mount the Nano with the top facing the bottom of the breadboard. Doing it that way made all the connections flow in the same order with the exception of D10, D11 and D12 which had to cross over each other AND also to the other side of the Nano.

KDLaun made it! (author)2016-04-29

After many months of waiting for parts and numerous assembly fails, my tiny LED cube is complete! More amazing yet, it actually works! A BIG thank you goes out to Hari for the PCB design and all your encouragement and support along the way.

HariFun (author)KDLaun2016-04-29

WOW!!! That's awesome!
Looks perfect! Great job!
What did you use for the spacer? That probably really helps keeping the pillars aligned in a row. Again, well done! I'm happy for you.

KDLaun (author)HariFun2016-04-29

Thanks! The little white spacers are plastic "lumber" (3.2mm x 2mm) from the model railroad section of my local hobby shop. I originally got them in an attempt to make a mechanical jig to hold the LEDs for soldering. That application didn't work out, but they turned out to be perfect for aligning the bottom of the columns when I soldered them on. You will get about 3mm height off the PCB and just enough room with with width to allow you to access the thru holes. I just snugged the bottom LED against the spacer by pulling the leads from underneath and soldered on the bottom. I had intended them to be temporary, but they give such good support, I may end up cutting them to match the PCB length and leaving them in place. Maybe a little black sharpie too so they aren't so conspicuous.

Anyone else building one of these? I'd be happy to pay it forward and share my successes and fails if it would help.

Honghong Lu (author)2016-02-26

If you use 1206 RGB LEDs, you can make it smaller. :-D Maybe it is more difficult to solder them. But your article makes me feel I would like to try it.

HariFun (author)Honghong Lu2016-02-26

Oh yeah... :-) I am researching smaller SMD LEDs.
Let me know if you know of any inexpensive source of symmetrical RGB leds.

nqtronix (author)HariFun2016-03-09

The smallest RGB LEDs I've used so far are in a 0606 case, which is as large as two 603 LEDs side by side. They aren't expensive at all, currently you can get 100 for less than 4$ on aliexpress, shipping included.

If I had the time I'd take the challange, but there are still a bunch of projects waiting to be completed :(

Anyway, this is your chance to make an even smaller LED cube. Not that your current cube istn't amazing as it is, with 0606 LEDs you would absolutly get the worlds smallest RGB LED cube. I'll be patiently waiting :)

HariFun (author)nqtronix2016-03-10

nqtronix, thank you for the tip! I've been looking for symmetric (square) RGB leds with pads in the corner (rather than on two sides). I think that would make soldering easier because then the wires could be straight instead of having to zigzag. So far I've only seen them at places like DigiKey for quite a bit more money :-(

nqtronix (author)HariFun2016-03-10

Never mind, I found a pretty interesting offer:

These are 0404 RGB LEDs, which measure 1x1mm. They even have pads at each corner! I assume they are difficult to solder even on a professional PCB, so stacking them free air is definitly a challange. At 0.25$ each they are not the cheapest, but if you manage to turn them into a cube, I'd be impressive as hell.

nqtronix (author)HariFun2016-03-10

I've never seen LEDs like that. Can you post a like to a product you have in mind? I'll try to find a seller on aliexpress for parts in that or a similiar case.

Honghong Lu (author)HariFun2016-02-26

Since I am in China, it is easier for me to buy them through Alibaba or Taobao or even 新赛格. I did buy some sample of 1206 type. And it seems 0805 is available too, which it is used for LED screen. :-P Maybe I can try 0805.

About the 1206 type on ebay, you can search keywords 1206 rgb

dunk8888 (author)2016-03-04

Hi,i want to get a pcb done for the cube wich pcb in the files you posted is the final working pcb as there are lots of brd files,i want to make sure i order the right working pcb as they are verry expensive for the size,due to a few layers i expect?

HariFun (author)dunk88882016-03-04

Yeah, sorry about the file mess. I tried a lot of different things. :-(
The best path is probably to order or download it from OSH Park. This is the actual board that I ordered. The holes for the headers are a bit too small, but other than that the board worked perfectly. Good luck!

KDLaun (author)2016-02-21

Nice Instructable!

HariFun (author)KDLaun2016-02-21

Thank you! Hope your LEDs arrive soon ;-)

KDLaun (author)HariFun2016-03-01

Still waiting on the LEDs. From what I can tell they finally shipped out on 22 FEB (ordered 30 JAN). This may be a record :-/ The resistors I ordered long afterward arrived last week.

I've poked around online and haven't really found any suitable LED alternatives that have a square format AND could be soldered into a charlieplex column. Can you tell me what you used for vertical spacing between the LEDs in the column?

HariFun (author)KDLaun2016-03-01

3 weeks before they even shipped?! That sucks...

For the jig, I recycled cardboard from a snack box. Maybe you've seen it already, but I talked about it in this video:

KDLaun (author)HariFun2016-03-01

Thanks, I've watched that video many times. I'm probably going to have to come up with something different than the jig you used. Looking back at my previous post, I probably wasn't specific enough with my question. What is the measurement (in or mm) between LED's in the vertical column. I want to get the cube cube-shaped in all three dimensions.

HariFun (author)KDLaun2016-03-01

On my cube, the distance between the top of one LED to the top of the LED above it is 5mm. That is also the distance between the left side of an LED to the left side of an LED to the right of the first LED.

I answered your question indirectly because the distance between LEDs depends on the orientation of the rectangular LED. Hope that helps.

KDLaun (author)HariFun2016-03-02

5mm is the number I needed, thanks!

RonB2 (author)2016-03-01

Awesome and amazing.

HariFun (author)RonB22016-03-01

:-) Thanks Ron!

IzidorL (author)2016-03-01

So you laser cut your stencils that you used for soldering and you had your PCB manufactured in low quantity. Too much time and money for a simple LED cube.

TimC90 (author)2016-02-29

OK, I'm getting older, have an above average IQ, and have been a Marine Vet for the last 31yrs. What the heck is this for? I understand that it lights up, but I don't know why I would want to make one, and what I would use it for.

BTW... Marine is an acronym for Muscles Are Required, Intelligence Non-Essential.

Thanks in advance,


HariFun (author)TimC902016-03-01

Ha ha. Nothing is wrong with you Tim!
Your assessment is 100% correct!
An LED cube, does nothing else other than light up.

Building an LED cube is a hobby similar to building a ship in a bottle. Pointless, but a rewarding challenge. :-)

I'm sure you're kidding about the Marine acronym. I'm convinced that intelligence IS essential or we'd have robot soldiers by now. Humans are amazing. Thank you for your service as a Marine!

paulofangy (author)TimC902016-03-01

just for fun and to learn how to control one array of LED bigger cubes can make better animation with light maybe for you this is a waste of time, but some people don't think like that, with the things you learn doing this, you can do a lot more and use the same principles.

Taranach (author)2016-02-29

Well... first, it *is* shiny... <G> however... just as you do drills to get better at any job, this works on precision wiring and soldering, as well as learning how to program the code... while it may be easy to just upload and run, you can also poke around and look at the program to see what it is doing and how... Finally, it makes a cool addition to your "mancave" and extra points for building it yourself... <G>

kd7eir (author)2016-02-26

What are your .lyz files that download for the templates?

HariFun (author)kd7eir2016-02-26

That is the file format the lasercutter at my makerspace uses.
The program to drive the lasercutter is called LaserDRW.
I included the file for completeness, but you should be able to easily redo it for your lasercutter. It's just four square holes :-)

Honghong Lu (author)2016-02-26

You can try the new addressable LEDs like sk6812mini(3535 packaging) which can make the wiring easier. And the size of the cube should be similar.

HariFun (author)Honghong Lu2016-02-26

Cool... I didn't know addressable LEDs are available in that packaging. A new wiring challenge though... While the power lines can be wired straight up in the pillar, the Data-In and Data-Out would have to be wired diagonally! Interesting... :-) Thanks for sharing Honghong.

jeanniel1 (author)2016-02-25

So, when you win the laser cutter, will you share it with the rest of us? I voted for this amazing project - and a magnifying glass would be helpful when the cube is unlit!

HariFun (author)jeanniel12016-02-25

Thanks for the vote Jeannie!
There are really awesome project entries, so I do not expect to win, but if I did, I'm sure a lasercutter would make an appearance in my instructable and youtube :-)

MattiR (author)2016-02-23

That is cool I have to say! A lot of work seems to have been put into it. I just wondered if it could've been possible to make a two layer pcb and put the microcontroller on the other side with the crystal, and hook it up to the right pins, and run it off a button cell?

HariFun (author)MattiR2016-02-23

Thank you :-)
The PCB is jam-packed with traces on both sides already. However, it would be cool to make tiny "motherboard" for the cube board to plug onto. Cool idea!

MattiR (author)HariFun2016-02-24

Oh. Yea, didnt notice that, but anyway, great work, cant believe you actually took the time and put the effort into this! Awesome soldering job.

Techmov (author)2016-02-23

Just wondering if it is possible to make this in a larger version?



HariFun (author)Techmov2016-02-23

Larger LED cubes are possible and actually easier (note that I did not say easy ;-)). Search for LED cube here on Instructables or on YouTube. Good luck!

Techmov (author)HariFun2016-02-24


Can I use the same sketch that you used? I have common anode LED's

HariFun (author)Techmov2016-02-24

I used common Anode LEDs as well, so yes, you can use my modified sketch. See step 5 for the code difference between common Anode and Cathode sketches.

Techmov (author)HariFun2016-02-24


Techmov (author)Techmov2016-02-24

Like giant common anode LED's 10mm to be exact

HariFun (author)Techmov2016-02-24

As long as the current consumption is reasonable, say no more than 20mA, then yes the Arduino would be able to drive it without any extra circuitry.

HariFun (author)Techmov2016-02-24

I used common Anode LEDs as well, so yes, you can use my modified sketch. See step 5 for the code difference between common Anode and Cathode sketches.

Techmov (author)Techmov2016-02-23

Also wondering if it could be done with an Uno instead of a Nano.

Techmov (author)Techmov2016-02-23

NVMD hahaha

Just read the whole instructable!

About This Instructable




More by HariFun:HariFun #136 - How to Write a GameDIY WiFi Outlet (HariFun#135)DIY Motorized LEGO Camera Dolly
Add instructable to: