A Spectrum Analyzer shows the loudness of different frequency bands (low, mid, high) in real-time, letting you visualize music. Using a RasPi, RGB LED Strip and some wire, make yourself a dynamic display and media player. This project is based on some great python xmas light code from the LightShowPi project, and advanced users can even configure it for song voting via SMS!

The project runs in Python, even including the audio processing. It's just able to play and analyze mp3s in realtime as long as your Pi isn't doing anything else.

Hardware

  • RasPi -- this guide is built on one running wheezy, Raspbian, ver 3.10.19
  • 5m RGB LED strip, (~160 leds) controllable via SPI, built in PWM control. This guides shows using one strip wrapped around to form 5 columns, and writing to different segments of the strip. Only three wires connected to the Pi: ground, SPI Clock and SPI Data.
  • 10A 5V power supply to drive the LEDs
  • Miscellaneous:
    • USB WiFi adapter (RTL8188CUS chipset drivers are built in to wheezy OS!) if you don't want to use Ethernet. I used these instructions to get it working.
    • SD card 4GB or larger
    • USB Power speakers
    • Powered USB Hub to plug in keyboard, mouse, wifi,
    • Some cell phone charger to power the Pi via it's USB power connector
    • USB keyboard, mouse, HDMI monitor
    • wire, some female to female jumpers or some JST connectors if you don't want to solder to the RGB strip.

Software:

  • This project is mostly based on the Pi-based xmas lights controller code from Chris Usey,Todd Giles and Ryan Jennings. It's a full command center for orchestrating xmas lights to audio (wav, mp3, etc). Their code and hardware lets you setup playlists and turn on and off 120VAC power based on frequency bands. You can even vote on songs through SMS messages! We're going to control an RGB strip instead of output pins on the Pi. Grab the attached synchronized_lights_LED_strip.py file.
  • Python control of LPD8806 RGB LED strip via SPI.
  • This isn't specific to this project, but I used the Geany IDE for coding right on the Pi.


If you have any questions, check out the LightShowPi github repo

This guide was first published on Jan 13, 2014. It was last updated on Mar 08, 2024.

This page (Introduction and Ingredients) was last updated on Mar 08, 2024.

Text editor powered by tinymce.