ESP-32 Based 8x8x8 RGB LED Cube

by JohnLukito in Circuits > LEDs

4533 Views, 31 Favorites, 0 Comments

ESP-32 Based 8x8x8 RGB LED Cube

Screenshot_2023-06-19-18-30-28-920_com.google.android.apps.photosgo.jpg

Hi Everyone! My name is John Lukito (2540124223) , and I'm a second-year student at Binus University studying Computer Engineering. I am thrilled to be working on this project alongside my talented peers, Michael Angelo Chandra (2540131481) and Johevin Blesstowi (2502036262) , who are also pursuing the same major. Together, we aim to delve into the fascinating world of the RGB LED cube and explore how cloud connectivity can enhance the functionality of this captivating device.

An 8x8x8 RGB LED cube is a visually captivating electronic device. It consists of 512 individually addressable RGB LEDs arranged as an 8x8x8 cube. Each LED can independently emit red, green, and blue colors, allowing for a wide range of vibrant color combinations and dynamic lighting effects. By controlling the brightness and color of each LED, intricate patterns, animations, and even 3D images can be created.

In our project, we aim to integrate cloud connectivity into the 8x8x8 RGB LED cube to explore the benefits it can bring. By connecting the LED cube to the cloud, we can leverage the power of the internet and remote devices to trivialize the animation selection process. This connectivity will enable us to access a vast library of pre-defined animations or even create our own custom animations using cloud-based tools (on-progress). Additionally, cloud connectivity can provide real-time synchronization, allowing the LED cube to display animations on-demand, creating a responsive and easy-to-use experience.

With the combination of the 8x8x8 RGB LED cube and cloud connectivity via Firebase, we aim to push the boundaries of creativity and interactivity in lighting displays. By harnessing the power of the cloud, we can tap into a virtually limitless array of animations and dynamically control the cube's visual output. Stay tuned as we embark on this exciting project step-by-step and build one for ourselves.

Supplies

For this project, the required components are:

  • 1 pcs ESP-32 DOIT-V1 compatible development board
  • 512 pcs Common-anode RGB LEDs (preferably diffused)
  • 100 meters of 0.8mm bare copper wire
  • 25 pcs SN74HC595 8-bit shift registers
  • 25 pcs ULN2803A 8-channel inverted drivers
  • 8 pcs IRF9540N MOSFETs
  • 4 pcs SN74HC245N 8-channel non-inverting buffers
  • 1 pcs TXS0108E 8-channel logic-level converter
  • 200 pcs 100-ohm resistors
  • 1 pcs 10k resistor
  • 14 pcs 100uF electrolytic capacitors
  • 26 pcs 0.1uF ceramic capacitors
  • 25 pcs 9-pin common ground 1k resistor network
  • 3 pcs 2A 5V Power Supplies
  • 3 pcs DC Jack
  • a LOT of female-to-female jumper cables
  • a LOT of female and male headers
  • a LOT of Solder
  • 1 pcs Baseboard PCB
  • 6 pcs Color Driver PCB
  • 3 pcs Buffer PCB
  • 1 pcs Control board PCB
  • 1 pcs Common Anode Driver PCB
  • 1 pcs Power Distribution PCB
  • 1 pcs LED Bending Jig
  • 1 pcs LED Solder Jig

The required tools are:

Other requirements:

  • Firebase Project
  • WiFi connection/hotspot

The code can be found here:

The PCB files can be found here:

*note that the PCBs are designed to be hand-etched on single-layer boards as many of the connections require manual jumpers*


The Jig files can be found below in the attachments of this section.

Test All the LEDs

Screenshot 2023-06-19 173450.png
Screenshot 2023-06-19 173539.png

The first thing to do after your LEDs arrive is to test all 512 RGB LEDs and make sure all of them work properly. This step is VERY IMPORTANT as it will save you many hours of headaches later on.

To test the LEDs, it is recommended to set up a testing jig using this schematic:

The positive wire of the power supply is in series with a 200-ohm resistor, then connected to the common anode lead of the RGB LED (the longest one). Then, using a jumper cable connected to the negative side of the power supply, you can touch the R, G, and B leads and confirm that each color lights up properly.

If at any point a color fails to light up, discard the LED to a separate container. You do not want good LEDs to be mixed up with defective ones.

Bend All the LEDs

Screenshot 2023-06-19 184450.png

Use the Bending Jig to bend the LEDs such as shown above. Note that the common anode lead must also be bent sideways so that it is perpendicular to the other leads.

Do this for all 512 LEDs. make sure to do them consistently as mistakes here can cause major headaches at a later step.

Measure, Cut, and Straighten Cables

measure and cut 40cm lengths of cable, then straighten them out using a hand drill on one end and a plier at the other end.

After you have done this for the amount of wire needed, you can proceed to the next step

*note if you plan on storing the wires for over 3 days, you might need to sand the wires before soldering them to the LED layers since bare copper wire oxidize quickly*

Solder the LED Layers Using the Jig

IMG_20230301_153913.jpg
1679304165111.jpg
IMG_20230513_132033.jpg
IMG_20230325_211754.jpg

The first thing to do in this step is to put 64 LEDs (for a single layer) into the soldering Jig in a consistent manner (Common Anode side down) such as in the picture below:

after all the LEDs are in place, next is putting the straightened copper wire through the bends in the R, G and B leads. For this step some twisting and untightening the bends might be required to get the wire all the way through such as in the picture below:

Next is soldering the leads to the wire, be patient and generous, don't be scared to use too much solder as you can always remove it later. Not enough solder or bad soldering can cause brittle joints which will cause problems later on.

After the color leads are soldered, we solder the common anode leads the same way, then we pop-out the LED plane from the Jig and store it until we have completed all 8 LED planes.

After completion of this step, it is also wise to test the solder connections using a multimeter or by using the same testing Jig as used to test the individual LEDs, but this time 5V is wired to the horizontal wires (common anode) and the negative side is touched to the R, G, or B wires.

Prepare the Baseboard PCB

For this step, we must prepare the elongated male headers to be soldered to the pads at the bottom side of the PCB. this is done by first cutting the male headers into 1x8 configuration, then using a hard and flat surface, push down evenly using your pliers for additional stability so that the plastic piece slides to the end of the metal pins like in the picture below:


Then solder the headers to the baseboard PCB according to the schematic given.

Cube Assembly

After the male headers have been soldered to the Baseboard PCB properly, the next step is to assemble the cube by soldering the LED planes to the corresponding holes. This is done by first aligning each plane and putting the spare wire at the bottom through the holes, then using part of the soldering jig to hold space between the planes, to solder the wires from the bottom of the baseboard.

after soldering and making sure the connections are good, cut off the excess wire using your cutting pliers.


Next is to wire the levels together, use the same straightened bare copper to connect the planes horizontally, then use more wire to connect each horizontal plane to each of the holes at the side of the PCB sequentially.

Prepare the Other PCBs

After the cube itself is assembled, we must complete all the control circuitry. First things first is to solder all the components into the board (remember to not solder ICs directly into the board, use IC sockets instead. The same applies for the development modules, please use female headers to interface with the PCB for ease of use). During this process make sure to get each placed correctly with the right orientation as well. For this refer to the PCB schematic given above.


Next is to solder the manual jumper cables, this is done by taking insulated copper wire (such as the ones used for the female-female jumpers, and wiring them up according to the top layer traces as shown in the PCB schematic given above.

After the board is finished, test them using a multimeter to make sure the connections are according to plan and that no shorts have taken place.

Circuit Assembly

First is to plug all the integrated components to the PCBs such as the ICs and the ESP-32 in their respective places (please refer to the PCB Schematic given above).

Next is to wire up the power distribution board to all the other boards grouped like this: all the buffer PCBs and the main controller PCB is wired up to the first DC jack, all the color driver boards are wired to the second DC jack, and the common anode driver board is wired to the third DC jack.

Next is to wire up the signal cables between the PCBs, make sure the connections are solid so that no signal dropouts will happen.

Last is to connect the signal out headers to the LED cube Baseboard PCB.

Setup and Upload Code

First step is to download Visual Studio Code and PlatformIO from the links given above if you haven't already.

Next is downloading the code or cloning the repository from Github.


After the code environment is established. we must add a file inside the "src" folder called "credentials.h"

inside it we shall define the following:

#define WIFI_SSID ""
#define WIFI_PASSWORD ""
// wifi network credentials

#define API_KEY ""
#define DATABASE_URL ""
#define FIREBASE_PROJECT_ID ""
//firebase project credentials

#define USER_EMAIL ""
#define USER_PASSWORD ""
//firebase auth user credentials


After the file has been created and filled with sufficient credentials, you can compile and upload the code to the ESP-32


After which, controlling the on/off state of the LED cube or which animation it will play is a matter of changing values inside the Firebase RTDB console or via the mobile application.


Enjoy :D