Athena: The Bluetooth Speaker with Lights

Intro:

Athena is a wireless bluetooth speaker with built in leds that analyze the music that is being played and dance along with it. The goal of the project was to create a fun interactive speaker that can liven up any room with animation.

Architecture: 

The architecture of the system uses a raspberry pi as the main computer and then an Arduino as the light card for controlling the lights.

Architecture

 

Audio Processing:

To make Athena a reality I needed to put several different pieces together. The raspberry pi runs ubuntu 14.04 Trusty Tahr. The Audio system is run by pulse audio and the bluetooth connection is managed by the Ubuntu bluetooth daemon. Then the lights daemon is responsible for reading the audio off of the raspberry pi and performing a FFT to process the music. The FFT bins are approximately 100 hz wide and will provide amplitudes for the frequency being played. (If you want to learn more about how this works please see previous posts or the README in the git repo). I then split the lower section of the FFT, 0 hz to 1000 hz, into 52 bins. Each one of these bins roughly corresponds to a unique note and every 7 notes is an octave. If any one of these bins meets a threshold then we decide to turn on the light. To do this we create a bit mask of 8 bytes. Each byte corresponds to an octave and we turn on the bit if it meets the threshold. A message is then constructed in the form of :XXXXXXX where : marks the beginning of the message and each X is a byte. This message is then passed to the Arduino. The Arduino sits there waiting for messages from the serial port. When it gets a full message it then takes the bits and decides what lights to turn on or off.

Threshold:

To determine the threshold I looked at several graphs of the output of the FFT. I determined that at any point of time if we take 10*log(frequency) then if the note is hit it will be higher than 52 and anything lower is just noise.

Audio:

To actually play the music I take advantage of ubuntu built in Pulse Audio and ALSA drivers and then play music out the raspberry pi’s audio jack.

Demo:

 

Resources:

Github: https://github.com/nbroeking/DancingLights

Advertisements
This entry was posted in assignments, Project 2 reports and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s