Introduction: 4x4x4 RGB LED Cube

A long while ago I found an article on making an 8x8x8 RGB LED cube by Kevin Darrah.

This completely inspired me but knowing my wife would kill me if I took over the house with breadboards I decided to scale it down to a 4x4x4 RGB cube.

I made the cube following his method and although it wasn't very straight it was pretty good, the kids loved it !

This inspired me to make a neater / cleaner version and this is my instructable on that.

Please note that this is still a work in progress, many hours of soldering are still required ;-)

Step 1: Cube Design

So a neater cube was my plan, something that I could get away with leaving on the side and something the kids could use without fear of electrocution!

Using Inkscape I knocked up a quick design of a square base that would support 4 columns of LED's. Each Column would contain 1 row for each 4 levels. Acrylic rod was then used to hold each row / level together in the columns.

I had the design laser cut by RazorLAB who I have used before, great service and a good price.

SVG files below.

Cube base

Cube Rows

Step 2: PCB Design

I used the original circuits that I built for the prototype, this is based on the scaled down version of Kevin Darrahs 8x8x8 cube.

I did sneak in a little extra which was a MSGEQ7 chip so that I can have the cube react to a sound input like an iPod. The chip is great as it provides a 7 channel graphic equaliser output which is easily used on the arduino.

I have built an 8x8 RGB Module Matrix which acts as a 7 band graphic equaliser using the MSGEQ7 chip, when I get time I will add an instructable on that.

This design was condensed so I could squeeze it into the base of the cube. I love circuit board design so this part took me ages and cured my potential OCD for ordered components and neat traces :-)

The design was done using Fritzing and the board was also fabricated by them, I have used them many times before and have always had great service.

I was so happy when the boards arrived, a thing of beauty.....

Fritzing PCB design here, will sort out the schematic when I have time.

Step 3: MSGEQ7 Overview

Just a quick section about the MSGEQ7 chip as "zx lee" was interested in its use.

The MSGEQ7 graphic equalizer IC divides the audio spectrum into seven bands, 63Hz, 160Hz, 400Hz, 1kHz, 2.5kHz, 6.25kHz ,16kHz.

For each band you receive a DC representation of the amplitude, a value from 0-1023.

To use the chip it requires 3 pins (2 digital and 1 analog)

  • Analog Pin = Read value
  • Strobe Pin = Trigger load of new band value
  • Reset Pin = Reset chip

The get the readings from the chip do the following:

  • Initialize chip - Reset Pin LOW / Strobe Pin HIGH
  • Reset chip - set Reset Pin HIGH/LOW
  • Loop 7 times, once for each band, and do the following
    • set Strobe Pin LOW
    • wait small amount of time (30us)
    • Read and store Analog Pin value
    • set Strobe Pin HIGH

There is a great article written by J Skoba with demo code that can be found here.

Step 4: Parts List

Parts list so far.. I will add more detal.

64 Common Anode RGB Leds

7 74HC595 package DIP16 [THT]; type 74HC595

2 Ceramic Capacitor 22pf

1 Ceramic Capacitor 33pf

2 Ceramic Capacitor 100nF

1 Ceramic Capacitor 10nF

8 Ceramic Capacitor 0.1µF

4 Electrolytic Capacitor 100uf

1 MSGEQ7 + 8 Pin I/C Holder

4 Generic shrouded header - 16 pins double row

4 Plugs 16 Pin

2 Generic female header - 9 pins single row

2 Generic female header - 1 pins

1 Power plug

52 NPN-Transistor (

4 Basic FET P-Channel

32 50 Ω Resistor

104 1k Ω Resistor

20 100 Ω Resistor

1 200k Ω Resistor

2 10k Ω Resistor

1 Toggle Switch

1 Pushbutton

1 Voltage Regulator - 5V

1 atmega328

1 3.5mm Audio Jack

1 Crystal 16 Mhz

Step 5: Cube Construction

Each row of the cube contains 4 RGB leds and each column of the cube is connected across the levels, So all the Red / Green / Blue legs of the LEDs are connected by Column and the Common legs are connected by level.

This method allows for the cube to be multiplexed by level.

Hope this makes sense ;-o

Step 6: PCB Construction

Time to for the soldering marathon...

I like to use the IC holders as it makes replacing chips a dream if you burn them out or get a dodgy one from ebay.

PCB has now been finished, one dodgy solder connection otherwise it worked first time :-)

Step 7: Code

The first pass of the code is complete.

The cube now functions with one mode that displays a spectrum driven by the audio input, and several non audio driven displays that have been cribbed from Kevin Darrah's original 8x8x8 cube code, plus a few of my own.

I have attached a push button on the rear of the cube that is used to switch between the patterns.

Code link here..

I will attempt to create a few more audio driven displays soon.

Step 8: Stay Tuned

PCB has now been finished, and it was one of those bizarre moments where things worked first time. Plugged in the LED cube, uploaded my existing sketch from the prototype board and lights started flashing.

Very short test video.

--

I have been doing some coding, noticed a problem with a couple of LED's. Turns out I missed a connection during the design :-o

Luckily this is easily fixed...

Here is a short video of the MSGEQ7 in action

Going to have to add a switch or button to switch between Audio Input Mode and Stand Alone mode.

--

I have just added links to the SVG files for the case design and the Fritzing file for the PCB design.

---

A schematic has been added in PDF format and the Fritzing file has it included also.

I have also attached a first pass of the code.

Arduino Contest

Participated in the
Arduino Contest