Daigle, Hunter, Kreider | 4

Audio Visual LED Cube


ECE 791/792 Final Report
Team Members: Matthew Daigle, Robert Hunter, Kendra Kreider
Advisor: Dr. Richard Messner
Date: May 2011

Acknowledgments

This project’s realization is due in part to the sponsorship granted from Raytheon as well as the funding provided by the University of New Hampshire. Special thanks go out to both of these organizations for providing us with the freedom to pursue our own project and their full support along the way. The A/V LED team would also like to acknowledge the support of Dr. Richard Messner, who’s push for us to stay on track, as well as his intrigue and excitement for the project, really allowed the A/V LED cube to be the best possible project it could be.

Project Team

From left to right: Matthew Daigle, Robert Hunter, Kendra Kreider, Professor R. Messner

Abstract

The goal of this project was to create a three dimensional 5x5x5 array of RGB LEDs powered by the Arduino microcontroller. This array of LEDs creates a cube shape that, with simple C programming, can display full color visual images through the use of multiplexing and serial in, parallel out shift registers. The cube can also produce visual effects that correspond to an audio input in real time through the use of the MSGEQ7 integrated circuit, which is a seven-band graphic equalizer IC.

The cube also has commercial potential due to its unique and interesting design, though not at its current cost of construction. All design goals were met for this project, and future improvement will most likely consist of interactivity between the cube and the user.


Table of Contents

Introduction 5

Reaching Final Design 6

Build 7

LED Matrix 7

Casing 8

Circuit Design 9

Arduino 9

Music Chip 10

Shift Registers 12

Ground Transistors 13

Testing 14

Software 14

Design Issues 17

Future Work 18

Appendix I: Project Photos 21

Appendix II: Example Lightshow 28

Appendix III: Example Music Show 36

Introduction

Light organs have been a popular Do-It-Yourself electrical engineering design ever since their implementation in the 1970’s. In their most basic design, light organs consisted of three lights: one to show low frequencies, one to show midrange frequencies, and one to show high frequencies. As technologies have advanced, improvements in this basic design have been made such as displaying the frequencies over two-dimensional banners as well as being able to select a greater number of frequencies to display.

This project takes the simple concepts of light organs and electronic banners and builds off of them to create an LED light organ in three dimensions. This audio-visual LED cube (3D LED light organ) consists of a 5x5x5 array of RGB LEDs that is able to display low-resolution images as well as interact with different frequencies of an audio input through the use of an audio-equalizer chip. The primary hardware design goal was to come up with a way to control all 125 LEDs (each with 4 leads that needed individual control) using the least amount of wires and components necessary but without sacrificing performance and controllability of the cube. The software design aspect of this project consisted of creating visually appealing light and music animations. Hypothetically, this project has no definitive endpoint. An endless number of animations can be created, and a cleaner user interface could also be continuously developed. The LED cube is a viable commercial product with limitless potential in design applications.

Reaching Final Design

The final project design was a 5x5x5 RGB LED cube. The size of this finished product was decided mostly due to cost of LEDs. To reach this final goal, incremental steps were first taken to gain familiarity with the design and coding. The first step of this project was to gain the basic tools and knowledge to build an RGB cube by first building a simpler size 3x3x3 single color LED cube. Although the 3x3x3 cube is more simplistic, there were many design similarities between it and larger cubes. Building this allowed us to foresee some problems with a larger-scale design and it also made coding simpler, which made the process of learning how to use the microcontroller easier and quicker. Figure 1 below shows the complete 3x3x3 single color cube connected to the microcontroller.

Build

Figure 2. Block Diagram of Project

LED Matrix

The LED matrix consists of 125-RGB LEDs, which are arranged in a 5x5x5 array. Each of the 5 layers (or “floors”) is made from 25 LEDs. All of the LEDs in a layer share a common ground, which is connected using 1/16” copper rodding. The copper rods give the lattice its rigidity – making the structure stronger and sturdier.

A single vertical column of LEDs is connected with 3 sub-columns for the red, green, and blue anodes. The number of columns, therefore, totals to 75 (25 LED columns x 3 sub-columns = 75 total columns). The anodes for each respective color in a column of LEDs are connected using single strands of bare copper wire. You will also notice that 5 columns are connected using the 1/16” copper rods. This was done, again, to add strength to the lattice. A single LED is addressed by applying 5V to one of the 75 columns and then grounding one of the 5 layers, which completes a circuit for only one LED so only one LED will be turned on (shown in Figure 3).

At the bottom of the cube, you will see that magnet wire was used to connect the 75 columns to the circuitry inside of the wooden base. Magnet wire was chosen because it has a thin enamel coating for insulation, which allows the wires to touch each other without conduction. The connections on the circuit are in a small area where available space is limited, and also where unintended connections are more likely to occur. The enamel coated wire helps to solve both of these issues.

Figure 3. Example of How to Turn on a Single LED

Casing

The box that supports the lattice also holds the circuitry for the cube. It was made with mahogany, with curly maple being used for the legs. This was done to give the finished product a more visually appealing and professional look. Two latches were used for opening and closing the box so that the microcontroller and circuitry could be easily accessed. The circuit itself is attached to the under-side of the top of the box to keep it from bouncing around during transportation of the cube, which helps to assure that no connections in the circuitry come loose. The microcontroller is not anchored to anything, however, so that it may be removed and used for other projects and applications if need be.

On the back of the wooden base, there are 4 ports – DC In, USB In, Audio In, and Audio Out. The audio input accepts audio from any device that uses a 3.5mm audio jack (i.e. computer, iPod, phone). The audio output also uses a 3.5mm audio jack, but should only be connected to speakers that have an independent power supply. Connecting headphones or speakers that are without an independent power supply will load down the audio circuit. This, in turn, affects the audio-visualization lightshow performance. The DC input supply powers the Arduino microcontroller. The Arduino itself powers the LEDs in the cube. A 2.1mm, center-positive, 12 V, 1A rated AC adapter is the minimum current rating that should be used due to the current necessary to drive the electronics. The USB input can also be used to power the microcontroller when an AC adapter is not available. Although the USB can be used to power the microcontroller the USB port is normally used just to upload the lightshow sketches to the microcontroller from a computer using the Arduino application.

In order to protect the cube a plexiglass case was constructed to cover the lattice. This was done purely for the protection of the fragile cube of LEDs and other cases could also be made from different types of glass or plexiglass that might give off different lighting effects from the light emanating from the cube.

All pictures relating to the build process as well as how the cube was tested are provided in Appendix 1.

Circuit Design

Arduino

The Arduino UNO is the microcontroller board that is used to control the input of information to the shift registers, music chip, and ground transistor array. In total, 11 of the digital input/output pins are used as well as 1 of the 6 analog input pins. Along with these pins the Arduino UNO has a 16MHz crystal oscillator, USB jack, power jack, ICSP header, and a reset button. The USB jack is used to upload programs written on a computer to the Arduino and will also provide power to the board. If the user plans on using just one sketch, that sketch can be uploaded to the board and only the power jack is then necessary to power the LED cube.

For this project the Arduino UNO is the heart of the LED Cube. Light shows are programmed using C coding and uploaded to the board to be sent out serially to the shift registers. The Arduino can also read in the analog data processed from the MSGEQ7 chip, which can then be manipulated in a lightshow sketch. This process is used to create the real-time audio-visual lightshows.

The final circuit design for the LED cube can be split in to three significant portions (shown in Figure 4): the music chip to allow for audio analysis (1), the serial-in, parallel-out shift registers to control each column of LEDs (2), and the transistor circuit used to ground each individual layer (3).

Music Chip

The MSGEQ7 is a seven-band graphic equalizer integrated circuit that divides an audio signal into frequency bands. These seven bands are split over the range of audible frequencies and are located at 63Hz, 160Hz, 400Hz, 1kHz, 2.5kHz, 6.25kHz, and 16kHz. Since one face of the cube has a 5x5 resolution, five of the seven frequencies were used, excluding the 1kHz and 16kHz frequency bands, for most of the audio-visual programming. These two frequencies were omitted since they tended not to be very predominant in most of the songs that were chosen. The MSGEQ7 serially samples one frequency at a time, and returns the amplitude of the sampled frequency to the Arduino. An amplitude range of 0 to 400 was consistently returned to the Arduino, which was then scaled down by 80 to result in values between 0 and 5, as the bar-height at each frequency would only range from 0 to 5 LEDs. The frequency bands were displayed on the front face of the cube where a vertical column of LEDs represented one of the five frequencies, and the height of the column represented the amplitude of a frequency. The pin diagram of the MSGEQ7 setup is shown below in Figure 5.

Figure 5. Pin Diagram for MSGEQ7

Shift Registers

The 74HC595 8-bit serial-in, parallel-out shift registers were ultimately used as the way to address the LED matrix from the Arduino microcontroller. The setup for these shift registers is based on the 75 columns discussed earlier. Each of the 75 columns is connected to the output pin of a shift register, and each shift register has 8 output pins, therefore 10 shift registers are needed in total (leaving 5 pins disconnected). All bits are sent from the Arduino to the shift registers using a “sendOut()” command which serially sends out 8 bits at a time; repeating this action 9 more times will result in the shift registers being completely filled with the necessary information for a single layer of an “image” (an image being comprised of the 5 layers of the cube). The register’s latch pins are then turned on, which sends out the information in the shift registers in parallel to each column and turns on the corresponding LEDs.

The shift registers are organized in sections of 25 columns: first the necessary blue LED bits are sent in, then the 25 green LED bits are sent, and finally the 25 red LED bits are sent before the latch pins are triggered. This design minimizes the number of output pins needed by the microcontroller, as all of the information sent to the LED matrix is output through just one pin on the Arduino. If this design was utilized there would not have been enough pins on the Arduino to control all 75 columns of the LED matrix. The functional diagram for the 74HC595 is shown below in Figure 6.

Q0 – Q7 are the parallel outputs that are connected to the LED matrix, Q7’ is the serial output to allow for multiple shift registers to be cascaded together (which is how all ten shift registers are written using only one output pin on the Arduino), DS is the serial data input read from the Arduino, SHCP is the shift register clock input (serial input shift clock), STCP is the storage register clock input (parallel output latch) which controls when the bits are sent out, MR (master reset) clears the shift registers, and OE (output enable) is always set to “on” as an active LOW.

Figure 6. Functional Diagram for 74HC595

Ground Transistors

The third and final aspect of the circuit board is the most basic, and consists of five transistors acting as switches to allow each layer to be individually connected to ground. For the transistors the LM3046 Transistor Array IC was used as it consists of five matched transistors in one IC, which keeps the current consistent for all layers (maintaining even luminosity for each layer). Five output pins from the Arduino are used to turn on the individual transistors. Providing a 5V signal to the base of one of the five transistors turns on the “switch” which connects the respective layer to ground (shown in Figure 7). The five layers are shifted through one at a time to allow for multiplexing on the cube as the shift registers can only hold the information for one layer at a time.