Free Shipping on orders above $35! Shop now!

Ten Tries

Learn Mistakes to Succeed!

LED Music Visualizer

I want to create some code for some LED music visualizer so the party can be hm.. LIT! I only have 3 days to do this project. Let’s do this!

We are doing the wedding planning ourselves, and a lot of the things you normally hire someone to do, we are doing ourselves to save a little bit of money. We are hiring a family friend to be the DJ and we are setting up the equipment for him. We need this party to be amazing! With that, we have a fog machine, sound system, computer, but we are missing a light show. I think that some LED synced with the music would be awesome! We are going to have some black lights, a drink with tonic water that will glow in the dark, so I am pretty excited to do this!

Materials:

Mega2560 Microcontroller: Amazon

RGB LED Strip: Amazon

LED Amplifier: Amazon

12V 5A Power Supply: Amazon

Downloads:

Microcontroller Code

Python Code

The Project

Some time ago, I ordered some RGB LED strips. My idea is to use this above the dance floor making a cool effect with the fog machine. This strip has 4 pins. One of them is the positive ground and the other three are the negative terminals for the LED (RGB). You can flash those lights in different frequencies making a mix of colors with red, green and blue, that turn into other colors. 

I also have an LED amplifier that allows you to draw more current on the output. I am going to have the LEDs with the amplifiers, and the idea is to control the lights with a computer program on Python that is going to analyze the frequencies that are coming out of the speakers and represent those as a graph on Arduino. And I want to represent those frequencies with different colors with the LED Music Visualizer.

Step 1. I’m going to do a little research to see what similar projects are out there. I can also use the code that I wrote for two similar projects I had on Python. The Furnace controller and hot plate styr. They both use the same principle where the computer takes in input from the Arduino, does a little bit of calculation, and compares that, let’s say, to a temperature control graph and outputs it back to Arduino. You can check these projects here.

Now we plan how to tackle the issue. While I’m processing the signal, I realized that low frequencies are being drawn out by a 60 Hz Signal. Which is Likely the House electrical system. There are a few reasons why this is happening. 

  1. A ground loop or The AC is not connected to the signal path and the mic is receiving the information of the magnetic field that is travelling through the air.
  2. The voltage travelling thru the air
  3. The cables I’m using are interfering.

I fixed that and now it’s testing time. Since I’m using the laptop, there isn’t really noise because everything is digital, opposite from my desktop. I asked the program to tell the Arduino when to flash and what color to flash. 

Let’s change this code just a little bit… there it goes… Now it’s starting the audio capture. Well the red is working, sort of. When I turn the sound up, it flashes more, when I turn it down, it flashes less. I really hope I can add some beat detection.

Well, now it is only working on red, let’s make some changes…

I might only have one of these strips, because I don’t want to give anybody a seizure. It’s not working perfectly, maybe we can detect the beat a little better. I might stay up all night to do the beat detection. So, let’s see if I’ll do that!

So I optimize my code a little bit. That’s so much better! To hell with beat detection, this is good, this LED Music Visualizer will work. Beat detection would make this better, but I don’t know if anyone will notice. Time to put things together!

I hope you enjoyed this project! Let me know if you have any questions on the comments below!

LED Music Visualizer

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top