# 8x8x8 Led Cube Driver Circuit

I am going to build 8x8x8 LED cube. Before I do I need to figure out a good driver circuit. I came here because I have very little knowledge about how a lot electronic parts fit together.

So here's my plan.

I will be using the Arduino UNO to run the animations.

The cube itself will be made with 512 3mm Diffused Blue LEDs. These LEDs have a Vf = 3.4vand maximum current of 20mA. I want to be able to provide that maximum current. The cube will be setup so that the 64 columns will be the anodes of the LEDs and the 8 layers will contain all the cathodes of the 64 LEDs in that layer.

I have decided to use nine 74HC595 shift registers to expand the Arduino's I/O to the required 72 outputs. From here I don't know what to use to connect the shift registers to the cube. The first 8 registers will control the columns (anodes) and the last will control the layers (cathodes).

Some have suggested I use the UNL2803 to "anti-drive" the 64 anodes and 8 transistors or MOSFETs to turn the layers on and off.

I don't understand how to connect the UNL2803 or the other parts so could someone provide me with some clarity, a simple schematic perhaps? I just don't get how to use a UNL2803 to source current...

Schematic Below For CubeDriver:

• For my own satisfaction, what do the LEDs on the inside of the cube do and can you adequately see them so is it worth considering just LEDs on the surface of the cube? All 512 LEDs are going to dissipate nearly 35W! Are you wanting to be able to switch any combination on or off i.e. have full control over every LED? Aug 22, 2013 at 9:18
• @Andyaka: youtube.com/watch?v=6mXM-oGggrM Aug 22, 2013 at 10:50
• @IgnacioVazquez-Abrams Nice!!! Aug 22, 2013 at 11:35
• @Andyaka If the circuit is well designed, there will be only one or couple of LEDs light on at a time, they will be addressed one by one at a fast rate and light on or off. Same principle as screens (matrix addressing). Mar 21, 2014 at 9:32

Your reply to Andy's question implies you want to control every LED separately. You have started down the path of using a matrix to control the LEDs, which would allow you to turn any one LED on, and many combinations, but not completely independent control of all LEDs.

So, one direction to go is completely independent drivers, one per LED. This will be simplest to program from your computer. However you will need a way to output 512 separate wires worth of values from your PC or microcontroller. An economical way to do this would be to use a few I/O pins to send data to 8-bit shift registers (in one long series, or in several shorter series) which may have the ability to sink enough current output to drive your LEDs directly (with resistor in series with each, of course). 74HC597, 74HCT597 and 74HC299, 74HCT299 are possibilities. If you need more current per LED, then you could still use shift registers, and add 8-wide transistor packages, like LUN2803A as drivers.

That said, you can create the visual effect of independently controlled LEDs, using a matrix. Your program select in turn each "row" of LEDs, briefly pulses them in the desired pattern, then moves on to the next set, and so on, until your program has covered all the LEDs.. then start over. (aka multiplexing)

For 8x8x8 LEDs (512), you would need a minimum of 22 x 24 matrix (eg: 22 rows x 24 columns = 46 pins), though 16 x 32 = 512 (48 pins) would be more congruent with your cube, so easier to program. Your program would need to continuously cycle through all 16 rows, setting the 32 columns for that row (or vice versa), "refreshing" them say 50 times a second to create the impression of constant illumination and fluid motion. That's 50 x 16 = 800 rows/sec.

Bear in mind that since each 'on' LED is only on for a fraction of full-time (say 1/16th), it will appear dimmer than when full-time, so you may the need to increase the current to compensate.

There are a number of similar projects on YouTube, you can probably find one with a similar number of LEDs, from which you can gauge the tradeoffs between brightness, smoothness, and CPU speed needed to keep refreshing and add animation.

OK, hope that helps.

simulate this circuit – Schematic created using CircuitLab

Set D1. Pulse D2. Repeat 7 more times. Note that using a MOSFET with a ULN' will require the use of a pull-up resistor.

• I need to source current using the UNL2803 not sink it. Aug 22, 2013 at 14:45
• Have you had a chance to read the datasheet yet? Aug 22, 2013 at 14:54
• I just refreshed my memory, sorry. In your schematic current isn't coming from the COM pin please explain. Aug 22, 2013 at 15:10
• The COM pin is for clamping the voltage fed into the transistors. Aug 22, 2013 at 15:13
• Is the schematic I added correct? Aug 22, 2013 at 21:13