SpencerGoulette / LED-Music-Visualizer

LED Music Visualizer Project

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LED-Music-Visualizer

LED Music Visualizer Project created over the Winter Break of 2018-2019. The idea for the project was obtained from Devon Crawford. His project can be seen here: https://www.youtube.com/watch?v=lU1GVVU9gLU

Equipment

Frequency to Voltage Circuit

Below is the circuit used to convert the frequency of the audio to voltage. alt text

The input to the circuit is the audio. I used just the RIGHT audio for the input audio. The 5V pin from the Raspberry Pi was used for the MCP6004 quad op-amp's power supply and for the voltage at the gate of the 2N3906 PNP BJT. A 1N914 diode was used in the circuit.

How it Works

The audio input went through a 4 screw terminal male headphone balum converter adapter and the output for a speaker went through a 4 screw terminal female headphone balum converter adapter. A splitter could have been used to get rid of one of the adapters. The 4 terminals are for GND, BLANK, RIGHT, and LEFT. The RIGHT audio was taken and connected up to a negative feedback op-amp. This was done due to the audio's voltage being too small to affect the circuit. The audio's peak when tested was around 500mV, instead of the desired ~5V. So, a 1k and 10k were placed in the feedback of the op-amp to give it a theoretical gain of 11. The output from the op-amp was then used to switch a capacitor from charging to discharging. The more frequent the switching, the higher the voltage the capacitor would charge to. The voltage on the output of the frequency to voltage circuit was then read by an MCP3008 ADC. The Raspberry Pi used SPI to communicate with the ADC to get the voltage from the ADC. Then using python, the voltage was used to determine the color of the LEDs to be displayed. The colors were then displayed on the LED strip.

  • The 1k resistor was replaced with a potentiometer to adjust the amplification based off of the differing volume inputs.

Future Work

Currently, there is a small window for frequencies (~200Hz to ~700 Hz). I want to get this sweet spot larger and have it so that the colors will change more noticeably from small changes in the frequency. I would like to get the LEFT audio too, which I can just do by running through the circuit and having it on channel 2 (RIGHT audio is on channel 1). I do not know how I would use both the left and right audio yet. A big issue I need to fix is that as you lower the volume, the less it affects the circuit and changes the voltage. I usually have to play it at the max on my headphones for it to work. So, I would like to somehow have the circuit figure out what the peak amplitude of the audio is and then amplify accordingly to get it ~5V. This way, no matter what the volume, there will be an output voltage and the LEDs will work. The last thing I want to work on is have the code all in C. I am currently working on that, but I am having issues with the Pi not being able to transmit data to the LEDs fast enough. Lastly, I have been requested to do a FFT to get the frequencies and then display them as a frequency bar visual using the LEDs.

About

LED Music Visualizer Project


Languages

Language:Python 74.8%Language:C 25.2%