Build your own RGB LED Cube Part 2: the electronics

**Building a 4x4x4 RGB LED Cube: Part 2**

As we conclude part one of this project, it's time to build the electronic circuit and upload our first test code. By the end of this part, you will have the capability to construct your own functional 4x4x4 RGB LED cube.

My case is still missing a DC jack, so I utilized my Dremel with a cutting tool to create a square for my Jack. If you're familiar with some of my other videos, then you know I'm not particularly skilled in this category; therefore, I hope this makeshift solution will suffice. To secure it properly, I applied hot glue.

For the case, we only need a switch and jack – maybe I'll add more components later on. Now we require adding male header pins to the ribbon cables for future connection to the PCB. We need three 16-pin headers for the cathodes of all colors and one 4-pin header for the anode layers. Additionally, some shrinking tube is required.

To prepare the ribbon cable, I used a cutter to separate it into individual sections and stripped their insulation. Then, using solder, I tinned the tips and the male headers as well. Next, I cut my shrinking tube and slid them over the ribbon cables to isolate each other. Finally, I soldered the ribbon cables to the headers and utilized the shrinking tube for isolation.

Now it's time to build the main circuit. Let's review our parts first: a PCB with kopper dots, four P Channel MOS fets (because this time we cannot multiplex the rows of the cube like in my Multiplex video), wire for each anode layer, three tlz 5940, and other necessary components.

We need to connect the tlz 5940s, which can control 16 LEDs each. Since there are three different colors, we will require three of those four 1K resistors as pull-up resistors for the MOS fets, and three 2K resistors to set the constant current of the tlzs to 20 milliamps per LED.

For the operator's brain, an Arduino Nano is needed. Additionally, silver coopa wire, female header pins, and a 28-pin socket are necessary. I created a schematic for you guys to recreate the project; however, I didn't make a layout diagram for the PCB – but it shouldn't be too hard.

To build the socket for the Arduino, I used female headers. This allows me to easily replace the Arduino if needed. I also utilized these headers for the 16 outputs of each tlz 5940 and the drain of the P Channel MOS fet.

The rest of the wiring is explained in the schematic. Always double-check all your connections and use a Multimeter with its continuity function to check for shorts, especially if you're not familiar with this process (take a look at my multimeter video).

Now that our PCB is complete, we need to connect the male headers of the ribbon cables to the female headers on the PCB. I connected the upper layer to the m head with gate and then fitted the other three layers into their respective headers.

Remembering the wiring schematic from part one, I connected the ribbon cables for LED 1 to the output zero of each tlz. If you take a look at my code, you'll realize that LED 1 is labeled A, LED 2 is labeled B, and so on. Again, there's only one way for the headers to fit – the first tlz is for red LEDs, the second tlz is for green, and the third tlz is for blue.

Finally, we need power – I plugged in my 5V power supply, which can give me at least 2 amps. Using a multimeter, I verified that the middle pin of the switch is ground and the other pins are connected to the Arduino.

Now you should have downloaded the tlz 5940 library from the Arduino playground and modified it to reflect our setup – we need to change the value for used TLC's from 1 to three. This modification is crucial for the project's success.

With that done, download my code, upload it to your cube, and enjoy a simple animation of flashing colors. If everything works correctly, then you've completed this part of the project successfully!

In the next part, I'll dive into explaining the code and how to create your own animations. We will also optimize the cube and bring this whole project to an end.

If you liked this video, be sure to check out some of my other projects – don't forget to like, share, subscribe, and I'll see you in the next part!

WEBVTTKind: captionsLanguage: enafter constructing the cube and case in part one it is finally time to build the electronic circuit and upload the first test code at the end of this part you will be able to build your own functional 4x4x4 RGB LED cube my case is still missing at DC jack so I just use my Dremel with a cutting tool to create a square for my Jack and if you're familiar with some of my other videos then you know I'm not that skilled in this category so I guess this should work somehow but I still use hot glue to secure it so it'll work I hope a switch and Jack is basically all we need for the case maybe I will add some more components to it later but let's just go with this basic setup for now now we need to add male header pins to the ribbon cables for later connecting them to the PCB obviously we need three three time 16 pins for the cathodes of all colors and one time four pins for the anode layers also some shrinking tube and solder the process is simple I separate the ribbon cable with a cutter and strip the isolation of each cable I use some solder to tint the tips and I also tint the male headers I cut my shrinking tube and slide them over the ribbon cable now I solder the ribbon cables to the headers and use the shrinking tube to isolate them from one another and done now we need to build the main circuit let's check the parts first one PCB with kooper dots four P Channel Moss fets because this time I cannot Multiplex the rows of the cube like I did in my Multiplex video I will Multiplex the layers and I already have a wire for each anode layer so everything will work fine if you would build a bigger 8X 8X 8 Cube you would need eight Moss fets to Multiplex the eight layers moving on we need the tlz 5940 each one can control 16 LEDs which is basically just what we need because we have 16 LEDs in one layer but we have three different colors so we're going to need three of those four 1K resistors which we use as pull-up resistors for the mass fets and three 2K resistors to set the constant current of the tzs to 20 milliamp for each led the brain of the operator is going to be an uino Nano in addition we need silver coopa wire female header pins and three 28 pin I sockets I created this schematic for you guys to recreate the project but I did not make a layout diagram for the PCB but it isn't that hard I used female headers to construct the socket for the Arduino this way I can easily replace it I also used the headers for the 16 outputs of each tlz 5940 and the drain of the P Channel MOS fat I solder the 1K resistor between gate and source of each MOS fat the 2K resistor connects to pin 20 and 22 of each TLC the rest wiring is explained in the schematic always check all your connections twice and be sure to use a Multimeter with its continuity function to check for shorts if you don't know what I'm talking about then take a look at my multimeter video okay PCB is done almost most I later realized that I forgot to add some capacitors so I sorted an 100 microfarad and 100 nanofarad capacitor between 5 volts and ground now we need to connect the male header of the ribbon cables to the female headers of the PCB I connect the upper layer to the m head with the gate IO A3 and there's only one way to fit the other three layers in the header now we need to remember the wiring schematic from the first part I connect the ribbon cables for the LED 1 to the output zero of each tlz if you take a look at my code then you realize LED 1 is labeled a LED 2 is labeled B and so on and again there's only one way for the headers to fit the first t z is for the red LEDs second t z for green and third t z for blue last thing we need is power I plug in my 5vt power supply which can give me at least 2 amps I use my multimeter to see which pin is ground and which pin is 5 Vols ground connects directly to ground of the alino 5 volts connects to the middle pin of the switch and the other side of the switch connects directly to the 5V pin of the art Reno and done I hope you already downloaded the tlz 5940 library from the uino playground because we need to modify it I open the TLC config file in the library and changed the value for used TLC's from 1 to three this is very important now just download my code and upload it to the cube the animation is very simple and the cube will Flash in a few different colors if it works like this then you did everything right in the next part I will talk about the code and how you create your own animations I will also optimize the cube and bring the whole project to an end if you like this video then you might like some of my others so go ahead and check them out don't forget to like share subscribe and I will see you next time