LED MUSIC CUBE

Lu Lu & Yijing Wang

Introduction

Using the Raspberry Pi as controller, we have designed and built a LED music cube which shows a flowing frequency spectrum of the played music. For the hardware part of this project, we built an 8x8x8 LED cube using 512 LEDs. We also designed and connected circuits to control all the LEDs using 14 GPIO pins on Raspberry pi. For the software part of this project, we extracted the waveform data from the wav file and implemented FFT then changed the display of cube with the present frequency spectrum every 0.11 second.


This is a picture

Objective

The objective of this project is to design and create a LED cube which can visualize the music. The raspberry pi processes the music wave data and controls the outputs of GPIO pins to show a flowing frequency spectrum of the played music on the LED cube.

Design & Testing

High Level Design


We use an 8x8x8 LED cube to visualize the music, the cube is a better way of displaying than the traditional LED screen for it has three dimensions which not only contains more information of the music but also exert a splendid visual impact on the audience, giving them the experience they never had before.

The natural way to manipulate the LED cube is to assign a pin to each LED. Unfortunately, we don’t have that 512 pins, so we have to find out another way to control the massive LEDs using poor number of GPIO pins we have on RPi. Making good use of an optical phenomenon called persistence of vision (POV) , that if you flash a led really fast, the image will stay on your retina for a little while after the led turns off, we are able to do achieve that using only 14 pins. We use 8 latches and 2 3-8decoders to do this job, that only requires 14 pins, which is absolutely viable.

The Raspberry Pi serves as the conductor of the show. It does multiple tasks, including playing the music, processing the audio signals, updating the data of the cube and refreshing the cube at the same time.

FFT is being done every 0.11 seconds to extract the frequency distribution at that time. The frequency data are scaled into eight bins, each bin represents the component in a certain range and the height of that bin correspond to how strong that component is. So you can easily see how the frequency distribution changes as the music goes.

The front face of the cube corresponds to the frequency distribution at the very moment, and the 2nd face is the frequency distribution 0.11 seconds ago, likewise the 3rd face is the frequency distribution 0.22 seconds ago, etc. The whole picture is like the face is pushed from the front to the back every 0.11s. It looks like the flowing water or flying over mountains.

One of the challenges in our project is to make the music displaying real-time. Too much work and calculations must be done simultaneously, the RPi is expected to have some delay in showing the music on the cube. We have tried multiple ways to deal with this, and we finally come to allocating the work to different CPU cores to accelerate this process.



Detailed Design


hardware design
software design

Results

Although there were bugs every so often, we managed to solve them and successfully accomplished our project. Our music LED cube is working well, keeping bringing audience awesome visual and audio experience.


Here’s a video to give you an impression what our music LED cube looks like. Enjoy!


Croatian Rhapsody Led Music Cube
Cradlesong Led Music Cube

Conclusion &Future

We successfully built a music LED cube that visualize the music. It works perfectly and have a marvelous visual impact on the audience. We proved that is viable to do a real-time display on the cube. We also explored the python library to allocate tasks to different CPU cores. What’s more important is that, we DID enjoy the process of building this!

We have two plans for future work:

A. Design patterns and display on the cube

B. Use patterns designed above to visualize music instead of using frequency distribution

Code Appendix

Contribution

Lu Lu:

  • cube soldering, cube display part coding

  • Yijing Wang:

  • cube soldering, FFT extract, multiprocessing part coding
  • Cost

    PartUnit Price Quantity Total Price
    Breadboard $3.00 4 $12.00
    Ribbon Cable $0.10 64 $6.40
    LED $0.03 512 $15.36
    Decoder (CD74HC238) $0.59 2 $1.18
    Latch (SN74HC574) $0.84 8 $6.72
    Darlington (ULN2803) $1.14 1 $1.14
    Total $42.8

    Acknowledge-ments

    We would like to firstly thank first Prof. Joseph Skovira for helping us throughout this project.


    We'd also like thank Instructable Community for resources about LED cube building.


    How does a LED cube work,Retrieved November 10, 2017, from http://www.instructables.com/id/Led-Cube-8x8x8/step5/How-does-a-LED-cube-work/

    74HC573 datasheet

    CD74HC238 datasheet

    ULN2803A datasheet

    Contact

    Lu Lu: ll782@cornell.edu

    Yijing Wang: yw774@cornell.edu

    W3C+Hates+Me Valid+CSS%21 Handcrafted with sweat and blood Runs on Any Browser Any OS