Introduction: RGB 8x8x8 LED Cube

Picture of RGB 8x8x8 LED Cube

For those unfamiliar with LED cubes, they are simply a 3-dimensional array of LEDs that make for interesting displays. My project here is not the first RGB LED cube, nor is it the best, but I am documenting my process because while designing this cube I appreciated every resource on 8x8x8 RGB LED cubes I could find. My goals for this project were to create an 8x8x8 multicolor (RGB) LED cube cleanly. That is, with all the electronics contained neatly. Additionally, I wanted to use Arduino code to make it more accessible to others and for ease in upgrading. More on this later though.

The hardest challenge was in making the LED frame straight and square. As with most things, quality depends on how much time you put into it. If I were to redo this project that would be the step I spend the most time trying to get right. Overall the project was rewarding in the end and I would say don't be intimidated by the amount of work needed for design and assembly.

I started this design over a year ago but didn't have the time to work on it for many months unfortunately so I hope I can provide a comprehensive description of the process :) As always I will be happy to answer questions in the comments!

I would also like to point out that along the design and assembly process I learned a lot from some of the other well-documented RGB LED cubes out on the internet. Particularly I recommend taking a look at Kevin Darrah and Nick Schulze. A majority of my work here was based directly on the work of Kevin Darrah on his cube.

Step 1: Skills and Materials Needed

Picture of Skills and Materials Needed

The project requires a lot of soldering. However, none of it is difficult and a beginner solderer would have no problems. I used all through-hole components (although SMD would have been nicer).

Comfort with the Arduino IDE is a bonus but not needed unless you want to change the code.

As for materials, you will need the following:

  • Soldering iron + solder
  • Hand tools such as tweezers, needlenose pliers, and snips
  • Arduino to use as programmer
  • Atmega328p
  • 512 RGB LEDs (common anode, diffused)
  • Copper wire (I used 24 gauge but thinner would be better)
  • 16MHz oscillator
  • 25 74HC595 shift registers
  • 136 100 ohm resistors
  • 64 125 ohm resistors
  • 212 1k ohm resistors
  • 2 10k ohm resistors
  • 2 22pF capacitors
  • 0.1 uF capacitor (electrolytic)
  • 10 uF capacitor (electrolytic)
  • 100 uF capacitor (electrolytic)
  • 1000 uF capacitor (electrolytic)
  • 25 16-pin IC sockets
  • 1 28-pin IC socket
  • 2x5 AVR ISP header
  • 200 2N3904 transistors
  • 8 IRF9540 P-channel MOSFETs (overkill but I had them on-hand)
  • Power plug
  • Power button
  • 5V power supply (1A is sufficient)

Additionally, I had a PCB made for the base of the board to save time and costs on wire management. This also meant I had to make sure my designs were right in the first try. While everything worked great, there are things I would upgrade (such as SMD components or swapping individual parts) if I were to do this again. I also had a base enclosure laser cut to hide the PCB and give it a cleaner look. The files for both of these parts will be included in later steps.

Overall cost for everything above was $80 for all electronics and LEDs, $28 for the PCB, and the base I was able to have laser cut with scrap black acrylic I had sitting around. I priced it out on ponoko as costing $50 but I suggest visiting your local FABlab or makerspace to save costs.

Google doc parts list and sources

Step 2: How It Works

Picture of How It Works

My LED cube, like nearly every other one online, uses multiplexing to give instructions to each LED. It is very similar to every other LED cube you see on instructables and elsewhere. I am going to leave the description out for this instructable because there are so many other well-written pages on this by now. If you want more information I encourage you to read more from the well documented pages below:

If these don't satisfy your curiosity, post your questions in the comments and I will do my best to answer!

Step 3: Circuit Design

Picture of Circuit Design

Knowing how you want to board to work brings us to actually designing the circuitry needed to operate the cube. Knowing that we will be using a microcontroller at the brain of the cube, and somehow using connects, we first need to design the circuitry for the anode and cathodes.

The anodes will use the P-channel MOSFETs to switch between layers for the multiplexing. Meanwhile a transistor array will provide power to the cathodes for each LED column. The shift registers (74HC595) will control the transistor array by reading in the serial output of the microcontroller and converting it into a parallel output on the shift register.

Lets break it down even further (skip over if understood):


(going backwards from the LED itself) A series resistor sets the approximate target voltage for the LED (125 ohm for red, 100 ohm for blue and green). This is tied to the collector of a transistor which emits to ground when the base is triggered by an output pin on the shift register with a 1k ohm resistor in series (between pin and transistor). An example with the one line hooked up is shown below.

Each shift register will have 8 outputs so can control 8 pins. Since each LED requires 3 pins (red, green, blue) and since there are 64 columns (8 x 8) we need to have 64 x 3 = 192 pins. This works best if we divide the shift registers in groups of 3 (one set for each color). So now we have 3 columns of 8 shift registers (for a total of 24 shift registers so far).


The anodes control each layer by toggling a transistor (MOSFET below) from another shift register. This time we only need one shift register. The 8 output pins on the shift register control the 8 layers. The values for this shift register is shifted out in the same serial line that gets delivered to each of the other shift registers from the microcontroller. For each of the other layers, you will just copy the circuit below and attach it to the next pin on the shift register.


The microcontroller is an Atmega328P-PU running the arduino bootloader. There are 6 main pins that you have to worry about (apart from the crystal and power lines): pin 1 - Reset, pin 4 - latch, pin 4 - latch, pin 6 - blank, pin 17 - data/MOSI, pin 18 - MISO, pin 19 - clock/SCK.

Pins 1, 7, 8, 17, 18, and 19 can be used to provide an ISP programming header for re-programming the board later if desired (not needed).

The latch, blank, data, and clock pins will be used to control the cube through the shift registers. The LATCH pin on the microcontroller connects to pin 12 of the shift register (74HC595). DATA connects to shift register pin 14. CLOCK connects to shift register pin 11. BLANK connects to shift register pin 13.


The board requires a 5V power supply. To filter noise on the input supply, capacitors are used at few ranges. This part is completely up to you for what you feel is necessary. I used a 0.1uF, 10uF, 100uF, and 1000uF capacitors but this was pseudo-arbitrary.

The full schematic and all EAGLE board files are included in the zip folder on this step. In it you have everything that you would need to have the boards printed off.

Step 4: Software / Code

Picture of Software / Code

Originally I started writing code in the Arduino IDE to control the cube but was having difficulties where occasionally the cube would just stop working until you reset it. After a long period of debugging I decided to switch to the fantastic Kevin Darrah's code. His entire webpage was a huge resource along this entire process as I mentioned earlier. I don't think it is appropriate to re-post his code here so I suggest you follow the link to his website and scroll down to the code section. I am using the Arduino code rev 12.

I will go into how I programmed the Atmega328p chip though. First off open the Arduino IDE (assuming you have already downloaded it). We will be following the Arduino guide for burning a bootloader and uploading to a breadboard. We will be using the arduino board as an ISP programmer. First, in the Arduino IDE open up the example ArduinoISP and upload it to your Arduino.

Then, following the diagram below hook up:

  • Arduino pin 11 to atmega pin 17
  • Arduino pin 12 to atmega pin 18
  • Arduino pin 13 to atmega pin 19
  • Connect Power and GND lines
  • Connect Reset and add a 10k ohm resistor to Vcc
  • Add crystal oscillator and 22pF capacitors to atmega side.

Next you will go to tools and select Arduino Duemilanove from the Tools > Board menu. Also, change the programmer to Tools > Programmer > Arduino as ISP. Now you are set to burn the bootloader. Go to Tools > Burn Bootloader. Once completed go ahead and remove the cables from the breadboard.

Next we will program the new atmega328p with the cube code. The easiest way to do this is to take a pair of tweezers and gently pull the microcontroller out of the Arduino you just used to burn the bootloader (dont get these chips mixed up now) and swap in the new microcontroller into the Arduino's IC socket. These two atmega328p chips should be identical now except for what is programmed onto them (they both have the same bootloader though). Open up the cube code and upload it to the Arduino as you would normally. Then gently lift it out again (avoid bending pins as much as possible) and swap the original back in. You now have a fully programmed microcontrller with the cube code on it. Once you place it in the circuitry that we will build later it will be all set to run.

There are many other ways in which to program the microcontroller but this is the only method I am showing here. Feel free to use whatever method you are most comfortable with.

Step 5: Soldering the PCB

Picture of Soldering the PCB

This is a pretty straightforward process if you are using a PCB like I did. If you are using other prototyping techniques for the components you will need to deal with the soldering and wiring in your own ways. If you aren't using my PCB (which you can always re-make yourself from a board manufacturer using the files at the end of this step) you may want to skim or skip this step.

The images in this step along with directions are also included as a pdf on this step. Following the pictures in any order, solder the components for each step. Each step's components are highlighted in the corresponding picture. I found it helpful to place components in from topside and then solder from the back (side with less silkscreen). The opposite direction will be used when soldering on the LED columns in a later step.

Step 1: Solder in the 28-pin IC socket for the atmega328 microcontroller

Step 2: Solder in the 16-pin IC socket for the 74HC595’s

Step 3: Solder in two 10kΩ resistors

Step 4: Solder in the 1kΩ resistors

Step 5: Solder in the 125Ω resistors

Step 6: Solder in the 100Ω resistors

Step 7: Solder in the 4 electrolytic capacitors (in any positions)

Step 8: Solder in the 16MHz crystal and the two 22pF capacitors

Step 9: Optionally solder in the 10-pin ISP header

Step 10: Solder in the 8 IRF9640 transistors (flat backing towards center of board)

Step 11: Due to an error in board design you will have to solder the first 2N3904 transistor in backwards. Simply bend the pins mirrored to how you would the other transistors. The silkscreen on the bottom of the PCB identifies how to insert it on the backside, but we want it inserted on the topside so that the board fits in the casing.

Step 12: Solder in the rest of the 2N3904 transistors. The image should do a better job explaining how to insert the transistors than I can explain in words.

Step 6: Casing

Picture of Casing

Before continuing on to solder the LEDs to the PCB, it was necessary to insert the top layer of the laser cut case. The top panel had holes laser cut exactly where the columns would slide into the PCB holes for soldering so it was easy to align. The case is simple to assemble and can be glued together using a small dab of superglue. The bottom panel will be the very last thing we put onto the cube at the end.

Alongside the box as shown in the pictures above, I cut out a jig to aid in the soldering of LEDs. This was just a backbone acrylic with 8 slots for LEDs to fit into and hold the bracing wires in place while I soldered them in. This is shown in the last 2 pictures above.

Lastly, there are some extra tabs in the laser cutting file that can be used to glue in place the PCB to the top of the box. They aren't needed but can be helpful during soldering.

The svg for the laser cutting file is included on this step.

Step 7: Soldering the LEDs

Picture of Soldering the LEDs

The video below does a better job showing the procedure for soldering in the LEDs than I will be able to type out. Basically, what you need to do is solder individual columns into the PCB one at a time. To do so:

  1. Thread 3 copper wires through the holes and solder them to the PCB. I always threaded from the PCB side through the acrylic side.
  2. Bend the leads as shown for 8 LEDs.
  3. Pop the LEDs into the jig (in the shown orientation with the common lead (longest) back)
  4. Slide the jig into position against the copper wires
  5. Solder each LED in (3 point per LED, 8 LEDs per column)
  6. Clip excess leads off
  7. Slide jig up and away from wires and LEDs
  8. ***Every other sheet of columns (starting with the first sheet) must have the common pins connected with rows of copper wire. see below***

I forgot to include in the video how to connect the common anodes between columns. Hopefully the pictures below help clarify this. In the first picture below you can see the rows that must be added to connect the anodes to each other. Highlighted in red are the rows. Highlighted in yellow are the common anode pins. Note how the pins alternate which direction they point such that you only need half the number of rows (each pair of sheets shares a set of rows instead of each sheet having its own rows to collect anodes). The picture below illustrates this by showing the first two sheets of LEDs sharing one row per layer (layers are horizontal, sheets are vertical). I hope what I am trying to say makes sense. If not, let me know and I will try to re-write this page or video.

Step 8: Final Assembly

Picture of Final Assembly

Almost done!

Solder in the power jack and power switch. They should screw into the holes that were laser cut into the sides. The diagram shows the proper polarity of the dc power jack and how those wires meet up with the power switch before connecting with the PCB.

Finally, with much pride, pop the bottom acrylic panel onto the back of the case! If you don't glue it, it should be firm enough to stay on but is removable in case you need to get back in to the microcontroller or to fix a soldering mistake.

Step 9: Pictures and Videos

Picture of Pictures and Videos

Finally, here are some pictures and videos of the finished project.

For more information and pictures on the assembly process and final product, see my website for this project.


AustinR64 (author)2017-08-16

I was wondering if anyone had any reccomendations on how to hold the pcb in place while soldering the LEDs in.

parceJ (author)2017-07-25

hi guys, i need urgent help!!! if somebody can help me, i pay for it, i will do the same cube but common cathode, i cant understand how modificate the circuit in the layers to do that, help me!!!! please!!!

AndrewW369 (author)2017-06-30

It came out to between $45 and $50 cost shipped last time. I can send the invoice after I get to exact cost from FedEx. Please PM me a mailing address.

milyI (author)2017-03-07

hi guys, I am interesting in buying 1 PCB board for my project, if anyone is selling 'em contact me pls.

AndrewW369 (author)milyI2017-05-10

I just ordered 5 boards in black. Will give you one at cost if you want.

AustinR64 (author)AndrewW3692017-05-13

I'd like to get one board as well if possible.

AndrewW369 (author)AustinR642017-05-13

Sure thing. I will shoot you a paypal link and get your address once they arrive. I got an update Thursday that they went to production. If I split the cost 5 ways it is $35 + whatever it costs to ship to you.

MJacoby29 (author)AndrewW3692017-06-29

Do you still have any boards?

AndrewW369 (author)MJacoby292017-06-29

I have 3 extra still

AustinR64 (author)AndrewW3692017-05-14


AndrewW369 (author)AustinR642017-05-23

Hi Austin,

My boards arrived and look awesome. Did you still want one? Not sure what shipping will be but it can't be that bad.

Laurenc58 (author)2016-06-24

all in one solar street light -

Project Hero (author)2016-01-06
Project Hero (author)2015-12-06

I'm planning to place an order for some of these PCB boards, please let me know if you're interested in buying one of the spares!

grandpayum (author)Project Hero2015-12-15

did you place this order? I only need one and don't know of a fab house that will do less than 3-5.

Project Hero (author)grandpayum2015-12-17

Yes, I ordered 5. I will sell them for around $40 US. I'll let you know when they arrive

grandpayum (author)Project Hero2015-12-17

awesome, I will definitely order one at that price. I'm in the US if that would effect pricing. Any ETA on arrival (e.g. a week or two, next month, etc)

Project Hero (author)grandpayum2016-01-06

Project Hero (author)grandpayum2015-12-17

It will take at least 3 weeks from now for the PCB's to get to me. I'll list them on ebay straight away and leave a link here. In in Aus so it will be $40 USD + shipping.

vtozato (author)Project Hero2016-01-06

Hello, could make the PCB, I am interested...

Project Hero (author)vtozato2016-01-06

Onyx Ibex (author)Project Hero2015-12-06

There are a few things that could be improved upon for the board. I recall one transistor being mirrored on accident (can still be placed on the pcb just have to do it reversed). I forget if anything else should be changed its been too long since I have looked at it. If you have a version of eagle that allows you to modify 20cm x 20cm boards then I would suggest taking a look at the eagle files first. If you are missing any files just let me know and I will post them. I am not interested in any spares though, sry. Best of luck!

rpotts2 (author)2014-09-07

Nicely done. How long would you say it took you to put it together? also, did the $80 price INCLUDE the $28 PCB? I'm considering this as a Christmas gift for someone and need to know how much time to dedicate. Originally i was going to do a ball balancing robot but that is WAY to long.

Onyx Ibex (author)rpotts22014-09-07

Sorry if it was confusingly written, the $80 is excluding the pcb. Meaning a total cost of $108. One other thing, the pcb was priced from me ordering 5 at a time and the price per board was $28/each. If you want to buy one of my spare ones let me know (at cost + shipping).

The time needed to build one of these is considerable. It probably took me 4-6 hours to do the pcb (while watching tv/movies at the same time, so distracted a bit) and another 16 minutes per column (64 columns) for a total soldering time of over 20 hours. To me, that is a long time. For people who are good at staying focused on repetitive tasks it would probably be easier to do in a few sittings.

tim.truo (author)Onyx Ibex2016-01-06

Thanks for your tutorial, great job!!!!!!!!! Do you still have a spare PCB to sale. Please let me know how to pay for you.

rpotts2 (author)Onyx Ibex2014-09-08

Still not bad price-wise... I've seen these going for a large sum (consisting the component costs). personally, I like to solder so a project like this would relax me. thanks for the numbers; it helps in my decision making.

Onyx Ibex (author)rpotts22014-09-08

I ordered from just a few different sources, each with their own fairly low shipping. I quickly made a parts list google doc and added it to the ible on step 1 (the parts list step).

AravindhanV (author)2015-12-18

hai any body want brd file 95% smd just email me or want pcb with low price

marsupialx (author)AravindhanV2015-12-27

I'm interested. Sent you an email. Thanks!

grandpayum (author)2015-12-14

did you sell the extra PCBs? if not would you be willing to do so?

Onyx Ibex (author)grandpayum2015-12-15

All of mine are gone now. See the comment by Project Hero below though!

grandpayum (author)Onyx Ibex2015-12-15


Yonatan24 (author)2015-11-20

Hi, I've added your project to the "A Collection of WAAAY To Many 8X8X8 RGB LED Cubes!" Collection

This is the link If you are interested:

electricbird (author)2015-09-20

Would it be able to make this circut in smd?

Onyx Ibex (author)electricbird2015-09-20

For sure. In fact it would be much much easier. If I were to do it again it would be smd.

kingfei (author)2015-06-15

That`s look it very good

Jian WeiW (author)2015-05-01

I have uploaded the Kevin's code to my Arduino UNO, but i found it seem like not running due to its green light is not blinking. Anyone can help?

Jian WeiW (author)Jian WeiW2015-05-01

I try to use Serial Monitor to debug the code. The picture is showed the part of the code I have modified. The result is show that the pattern is not running. Can you give me some suggestion regarding this issue? Thanks.

Onyx Ibex (author)Jian WeiW2015-05-01

That is odd. can you check after each line of code after the "start" to see if it is getting hung up on one particular pattern? Do you have LEDs in place to monitor?

Jian WeiW (author)Onyx Ibex2015-05-01

Ok. i will check it later. But what do you mean by have LEDs in place to monitor?

Onyx Ibex (author)Jian WeiW2015-05-02

All I meant was, have you built the cube yet or are you just checking if the code works by serial port?

Jian WeiW (author)Onyx Ibex2015-05-02

Yes, I made the cube by hand wire as Kevin Darrah's version. But it just lit some rows with different color and doesn't run any patterns. That's why i checked the code.

I was using the power supply 5vDC@20A as his suggestion instead of 5vDC@10A. And I also put the 0.01uF ceramic capacitor for each shift registers as he mention in the part list. However, I checked his schematic, he has used the 0.1uF. Will this cause the shift registers not working?

Onyx Ibex (author)Jian WeiW2015-05-03

I think you mean 5V@2A (not 20A). Usually 0.1uF are used but I don't think 0.01uF would have problems. You could always try taking one off the first shift register and see if that changes anything.

Jian WeiW (author)Onyx Ibex2015-05-04

It is 20A (you can check from Kevin Darrah's website which mentioned the part list). So will this power supply cause the problem?

I tried to take off the first shift register( the one controlled the anode). The cube is no lit at all.

Onyx Ibex (author)Jian WeiW2015-05-04

You are correct, I guess he did say that :) I power mine using a 1A or 2A 5VDC wallwart (whichever is closer) and it is sufficient without whining or anything. Going larger won't have problems though.
I didn't mean for you to take off the shift register itself, but rather the 0.01uF capacitor that you said was connected to the shift register. Sorry for the confusion.

Jian WeiW (author)Onyx Ibex2015-05-07

The 1st image show the cube when I turn on the power supply, there are just few columns lit. Then, i take out the red cable which is 5v from my shift register board ( from the 2nd image, you can see the red cable on the lower right corner). My cube will be lit with different color for most of the columns (see 3rd image). If I take in and out the red cable, the color will change.

I have 3 transistors boards (Red, Green, Blue), 1 shift register board, 1 layer control board, 1 power supply (220VAC to 5VDC@20A), 1 Arduino UNO.(see 4th image).

Jian WeiW (author)Onyx Ibex2015-05-06

Ok. I tried to take of the capacitor, nothing has been change.

Zatta (author)2014-09-25

Really, Really, Really great project. Did I say Really already?

actually, I've started building such a thing myself (as in I've ordered parts..) and I'd like to know where you've got your board ordered.

While preparing my 8x8x8 rgb cube I've rewritten Kevin's code to c, it made the code a lot smaller and faster (actually, I rewrote it first to a 4x4x4 red cube, then rewrote that to c). This can be found on github here if anyone is interested:

Jian WeiW (author)Zatta2015-05-01

Where can i get your 8x8x8 rgb cube c code?

SuperTech-IT (author)Zatta2014-10-10

I have circuit boards for this project that run Kevin's code or Nick's code, depending on which microcontroller you want. We just added music / spectrum analysis response to the cube and code. Doug Domke did up some code from scratch and that's what we are using now on the PIC controller. We haven't added music response to Kevin's code yet.

About This Instructable




More by Onyx Ibex:3D Printed Heng LampLucina / Chrom Sword (3D Printed)Illuminated Rocker Switch Voltage Conversion
Add instructable to: