4x4x4 RGB LED Cube

17,807

55

22

Intro: 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.

Share

    Recommendations

    • Fix It! Contest

      Fix It! Contest
    • Audio Contest 2018

      Audio Contest 2018
    • Metalworking Contest

      Metalworking Contest

    22 Discussions

    0
    None
    S_R_99

    1 year ago

    Hi!

    Can you share the code, link is not working? I'm interested in the setup, what did you modify to get it to work on 4x4x4 size.

    2 replies
    0
    None
    rojmS_R_99

    Reply 1 year ago

    Hi,

    I have refreshed all the links so you should be able to get the code/pcb etc now.

    Drop me a message if you have any questions.

    Good Luck

    0
    None
    rojmMicky Flanagan

    Reply 1 year ago

    Hi, I designed the pcb using fritzing, they also offer a fabrication service which I used as well.

    http://fritzing.org/home/

    0
    None
    rojm

    4 years ago on Introduction

    Hi all,

    I have updated the Instructable with a schematic in PDF format and included it in the Fritzing file.

    I have also attached a first pass of the code.

    Enjoy.

    0
    None
    Steve25

    4 years ago on Introduction

    Do you have an schematic in eagle? Then its easier to understand and to build on a prototype board.

    5 replies
    0
    None
    rojmSteve25

    Reply 4 years ago on Introduction

    Hi, I'm afraid I don't have a schematic, I'm strange and just design straight onto the PCB board.

    If you check out this link http://www.kevindarrah.com/?cat=99 then there is a schematic of the 8x8x8 cube, you could try to scale it down.

    0
    None
    Steve25rojm

    Reply 4 years ago on Introduction

    Yea i could give it a try. But i'm really bad with writing/modifying codes so if i change it slightly different than you did, the code won't work well :(

    0
    None
    rojmSteve25

    Reply 4 years ago on Introduction

    When I'm done with the cube I will see what I can do for you :-)

    0
    None
    rojmSteve25

    Reply 4 years ago on Introduction

    Hi

    I have updated the Fritzing file with the schematic, I don't use eagle i'm afraid.

    I have also exported it as a PDF, you can find it in the PCB design section.

    Hope it's ok.

    0
    None
    rojm

    4 years ago on Introduction

    Hi,

    Just added links to the SVG files for the cube case design and Fritzing files for the PCB design. Find them in the appropriate step. :-)

    0
    None
    zx lee

    4 years ago on Introduction

    Good luck on your work. Looking forward for the complete instructables. Also would like to know how to operate the MSGEQ7 when you complete.

    4 replies
    0
    None
    rojmzx lee

    Reply 4 years ago on Introduction

    Thanks :-)

    It's a very simple chip to use, just make sure you buy the proper ones, not the cheap ebay versions. I will add a section about it's use.

    0
    None
    zx leerojm

    Reply 4 years ago on Introduction

    Why not the ebay version? Any bad experience of using it?

    0
    None
    rojmzx lee

    Reply 4 years ago on Introduction

    Yep had a mixture of completely dead ones to some that generate a lot of noise so it makes interpreting the values tricky.

    I have now added a section about the chip, hope you find it useful.

    0
    None
    rojm

    4 years ago on Introduction

    Just added a very quick update as the PCB is complete and a very short test video has been linked :-)