# How can I control more than 64 LEDs using a Uno?

I finished working on my 4x4x4 LED cube. I want to make a larger 6x6x6 cube. Is this possible ?

Which components should I use to control the LEDs ?

An alternative to shift registers or LED drivers is Charliplexing. Charliplexing allows you to control n^2-n LEDs using only 'n' pins.

For a 6x6x6 cube, you need 216 LEDs. Using 15 pins gives you 210 LEDs (15^2 = 225; 225 - 15 = 210), just short of what you need. You'll have to go with 16 pins which is not a problem on the Arduino (there are 18 IO pins available). This would allow you more LEDs than you need (240 vs. 216) but you can simply not populate the extra positions.

Charliplexing requires less hardware but it is certainly more complex. Also, you have to rely on POV (persistence of vision) if you want to light multiple LEDs simultaneously. Therefor, it might not make sense for your particular project depending on your desired usage of the cube.

This article from Uzimonkey's blog talks about Charliplexing on an Arduino. He includes a good discussion on calculating resistor values at the end of the article.

Try out shift registers. These should give you the ability to address some more LEDs. There are several videos on Youtube describing the functionality of shift registers

Note: On Arduino there are already functions to "shift out", etc.

The RainbowDuino is an option:
An Arduino clone that incorporates multiplexed Common Anode LED drivers (MY9221) to drive 192 LEDs or LED strings. That goes slightly beyond the 216 LEDs in the 6 x 6 x 6 cube, but the small overflow can be easily handled the conventional Arduino way, through shift registers or LED drivers attached to the RainbowDuino.

RainbowDuino sample sketches show how each individual LED can be written to. You would need to connect the anodes of the LEDs to the positive voltage rail, which in effect makes them a Common Anode matrix addressed via the cathode pins.

If you need to access individual LEDs and not connect them as described above, a separate Extension Board is available which has break-outs for all 192 individual channels.

The entire LED cube would thus be updated by relying on persistence of vision (PoV), i.e. with their refresh rates being faster than around 25 times per second, just like cinema or television work.

Using current-regulated, latching LED outputs such as offered by the RainbowDuino allows the PoV refresh code timing to be far less challenging than if shift registers or Charlieplexing code were to be used within your Arduino sketch.

The Texas Instruments TLC5940 is another way to easily drive LEDs from the arduino. You can apparently daisy chain up to 40 of them together. (40*16 LEDs) There's so much good information on the arduino playground page. Please go check it out.

Here's one example from an arduino forum user named saeveritt that illustrates an idea of how the wiring diagram would look. Do follow the links to learn about how to power this many LEDs using this technique.