Shock-N-Awe: Visual Response to Audio Stimuli

Project Description:

Shock N' Awe is a table capable of responding to audio stimuli by producing visuals that will shock and awe the observer. A typical table sits and does nothing other than fulfill its basic functionality.

Our goal was to transform this inanimate object by making it reactive and entertaining. This design was created for the Design Stellaris 2006 contest put on by Luminary Micro and Circuit Cellar. The material on this page is adapted from the complete documentation submitted for that project. Full documentation can be found on the Contest Website.

The table is powered by the Luminary Micro LM3S828. Its size is limited by the ability of Lucite (the table surface) to transmit light and the viewing angle of mass produced LEDs. Currently our maximum size is two feet in any direction. Our table is a practical size of four square feet, and carrying 96 tri-color LEDs, this table can light up any environment. With some customization this table could be built as a circle of two foot diameter, or perhaps a long bar with a depth of two feet and limiting ourselves to a single axis of light.

In its current incarnation, four microphones attached to the table's corners, along with multi-lateration, enables the microcontroller to determine the origin of a sound on the table's surface. This sound can be created by a variety of sources such as tapping on the table, putting down a glass, or banging your head into it in complete frustration (additional pain may be caused due to the headache induced by the reactive bright lights). Even with the speed of sound through Lucite at 2,650 meters per second, the inherent speed and analog sampling capabilities of the LM3S828 easily allows sampling of multiple analog inputs at speeds high enough to give an accuracy of one square inch on the table's surface in real time.

The 96 LEDs are spaced every inch around the outside of the table to match the granularity of detection. The tri-color LEDs can produce up to 512 colors. Available effects range from simple single color display thru very complex and exciting lighting effects.

Hardware Design:

The Shock and Awe hardware consists of two types of primary modules, in conjunction with a power supply and a custom built coffee table. At the heart of the project is a control and sampling board utilizing a Luminary LM3S828 connected by twelve-pin ribbons to four shifter boards. Each shifter board connects to twenty-four LEDs, giving the table a total of ninety-six tri-color LEDs. The LEDs are situated about the perimeter of the coffee table's Lucite surface, shining sideways into the plastic. The main board samples from four microphones and controls the shifters to create an audio-reactive surface. The project is easily customized to incorporate audio inputs for ambient sounds allowing the table to respond to the atmosphere in which it finds itself. For example, the table could create visuals based on the beat or tone of background music.

The main board is the core of the design and incorporates a single LM3S828, four electret microphone bias circuits, mux/demux circuitry, power regulation and a JTAG interface. The LM3S828 is responsible for high-speed sampling of each of the four electret outputs, decision making, and generating and routing data to a set of high-speed shifters which are used to drive LEDs. The audio inputs are biased to center at 1.65 V and are sampled using the LM3S828 A/D at 100kHz. The sample rate is chosen to account for the propogation time of sound through the Lucite, which is approximately one inch for every 100,000th second. Based upon the perceived arrival times of sounds, the LM3S828 attempts to multilaterate the position of an impact on the surface of the Lucite and then creates a pattern of lights as a reaction.

Shock and Awe incorporates ninety-six tri-color LEDs. The LEDs are arranged in sets of twenty-four to a side of the table, and each set of LEDs is driven by a single shifter board. Each board has three banks of three 595 shifters, used to command each of the twenty-four LEDs three colors.

The entire system is powered by a single 5V output power supply. The 5V system provides power for regulation on each of the boards and also provides the drive voltage for the LEDs. The table itself may not be high voltage, but it does have a significant current draw.

Software Design:

The software running on the LM3S828 can be broken down into three major categories. The main program initializes the hardware to run at 50MHz and then enables the ADC, necessary GPIO, interrupts, and TIMER0 blocks. After the initialization is complete, the main function drops into an infinite loop in which it pinpoints audio origins when detected and then runs a gamut of graphic routines for general amusement.

The second category of code handles audio detection and multilateration (determining the source location of sound). The ADC is configured to sample via Sample Sequence 2 from four channels of the ADC. This sampling is regulated by the output trigger of TIMER0A. This allows the sampling rate to be carefully controlled as it determines the smallest granularity of detection.

The interrupt service routine keeps track of samples from which time differences between detection of a sound on each of four microphones is determined. This is then fed into a multilateration routine that determines the origin of the sound utilizing a pre-calculated lookup table. This table has been pre-calculated due to limitations in processor bandwidth due to demands from frame buffering and audio sampling. With minor customization this can be moved into true real time calculation. This would be the preferred method of audio location. Once the origin is located, the data is held for use in the main routine.

The code needs to know where an object contacted the surface of the table by making use of nothing but differences in arrival times of sound. By sampling at approximately 100 kHz, the granularity of propagation time is approximately 1 inch per sample across the acrylic surface. Using four microphones four distinct arrival times can be found. These are then simplified into three separate time differences based off of one primary microphone. These three differences then lead to "multilateration" which can be utilized to find a source coordinate based upon these times. However, this requires a significantly nontrivial amount of computational time. Since the necessary bandwidth is taken by other necessary processes the solutions to the multilateration are pre-computed and stored in a lookup table.

The last major category of code is the frame buffering and visual effects module. These routines handle the output to the LED arrays and any effect generation. Frames are built using a variety of functions to create different patterns or responses to locations that have been detected. These frames are output based on an interrupt service routine running off of TIMER0B. This allows the creation of a frame rate that minimizes flickering and other artifacts when being observed by the human eye. Each bit within a frame is shifted out to peripheral hardware serially. This is done by “bit banging” via GPIO controlled MUXs.

Here is a video of the project: