Make a LED CUBE with CD4051B, Arduino , SLA printer

"Trying to give something old a new use is one of the best ways to come up with good ideas."  - Where do good ideas come from by Steven Johnson. 

I saw many YouTube videos and online instructions teaching how to make LED cube, I thought it is so cool and I would build one for myself.  I happen to be a co-owner of a 3D printers shop, therefore I found a way to make cube through the available technology I have in hand; thanks to Autodesk, Fritz, Arduino and 3D printing technology, everything is open-sources. This article is to share my thought process to build a light cube, and with the completed Work Instruction in summary. 

  By Tho "T" Huynh

                                                                         Mechanical Engineer and Co-founder, Onset Engineering Inc.

First , I brainstormed ideas and researched electrical components

How do we control multiple leds ?

I learn a bit about Arduino when I was in college,  it has some pins on the board to send and receive signals. When we tell Arduino which pin the electric current shoot, the Arduino will send the current to that pin and through to the LED light. 

I CAD the small cube (4 x 4 x 4) using a SLA printer, this will be my frame for the 64 leds. Therefore, I need 64 pins out from the Arduino. 

Unfortunately, the Mega Arduino just have 54 pins, using multiple of Arduino board is possible to build this circuit but not effective. So I found an electrical component that can help eliminate the amount of PLC needed, it called "multiplexer" , thanks our previous inventors. There are a better solution but this is my first project so I keep it simple to build a foundation.

So what is the "multiplexer"?

I found this video explaining what is the multiplexer and its purpose. After understanding this, I started to do some research (googling)  what other previous makers use and I found that they use CD4051B.

Don't assume anything , datasheet is your "new best friend"!

I do not know how to code yet but as I understand, we command Arduino to tell multiplexer which channel/pin to switch to, therefore, we need to know the address and the function of the pin. The "father" (the manufacturer) of the product know them the best, thus , Find the datasheet at

I want to save your time where to look in the datasheet so I just attached a schematics in the picture below.  In this particular multiplexer, there are 8 channels in/out with the multiplexer , ( pin #1,2,4,5,12,13,14,15) ,  that means we can control 8 LED with 1 multiplexer "CD4051B". 

The LED usually does not need 5V ( the Arduino supply 5V) to light them up, if we use more than what the LED need, it will burn.  You can find the Voltage for LED at manufacturer datasheet ( I used Do math and find the appropriate resistor. After knowing the value of the resistor, it is time to simulate your circuit.

The "Truth Table" from the datasheet tell us the states ( low or high) of Channel Select (A,B, C) combination will let us know which Channel the multiplexer switch to . For example , if we set A , B , C at the LOW state, the signal will shoot out from Channel in/Out 0, or if we set A HIGH, B,C LOW , the signal will shoot out from Channel In/Out 1 from the multiplexer, and so on.  It is time to code! 

Second, I found the first fundamental truth .

How do I simulate the circuit ?

One of my electrical engineer friend  advised me to use LTspice because it is very detail and best use for professional. However, after some time of trying to figure out how to use it , I went nut since it is not very intuitive nor colorful. If you just started to learn electric, use Fritz

In my circuit , I connect pin #2 | Channel select A ; pin #3 | Chanel Select B, pin#4 |Channel Select C. This information is needed for later code. 

In the schematic, I used the Channel #4 ( of the CD4051B) to control the light, Therefore, the electric current has to come out from the Channel #4 to light up the LED. 

To command the CD4051B to switch to Channel #4, we have to code the right combination of pin #2,3,4 of the Arduino to tell CD4051B . We can find the states combination on the data sheet at truth table. 

Control more LED light
Multiple LED Light with CD4051B

Third , I just the duplicated of the fundamental truth to build a system.

Solder the positive, "the longer leg" to each channel in/out through of the CD4051B

Test and code each strip after soldering.

Solder led strips to the board as the schematic below, then glue each led co-response to the location on the cube. 

Fourth, things I wish i knew! 

Use the IC Socket

When you use IC socket, it is easier to solder compare with soldering the multiplexer directly to the solder board. In addition, if the multiplexer is damaged, you just need to replace the chip rather than have to de-solder it! 

Using jigs to help with soldering

When soldering, you should create the jig to help you with keeping led in place to solder easier ! 

In summary- work instruction


Step 1 : solder led strips (8)

From left to right, we mark the channels so we can locate them when solder to the multiplexer. 

Step 2 : Solder the multiplexers and the resistors to the soldering board. 

Step 3 : Solder led strips to the board as the schematic .

Step 4: Final schematics