Spectrum Analyzer using Adafruit NeoPixel Strips & Arduino Mega

Hello everyone,

I'm pretty new to this site and was seeing if I could get some guidance. My friend and I are trying to create our first project for a spectrum analyzer using the following materials:

  • Adafruit NeoPixel Digital RGB Led Strips (3 meters)
  • Adafruit 2-pin JST SM Plug + Receptacle Cable Set
  • 5V 10A AC to DC Power Supply Adapter for the LEDs
  • Sound Impact Sensor
  • Arduino Mega

The main object is to get the LEDs working like a 10 band (or 9 band) spectrum analyzer whenever music is playing. I've been trying to find similar examples online, but it's a bit difficult. I have 90 LEDs so i would probably make a 9X10 or 10X9 matrix. I think I have a good idea how to hook everything up, but I'm still in need of some guidance.

Has anyone created a similar project or know someone that could help us?

Best Regards,
Eddie

MSGEQ7 will give you 7 bands of frequency. Your 'sound impact sensor', whatever that is, is probably just loudness. Maybe reading about fast fourier will help you find relevant projects, too.

INTP:
MSGEQ7 will give you 7 bands of frequency. Your 'sound impact sensor', whatever that is, is probably just loudness. Maybe reading about fast fourier will help you find relevant projects, too.

Thanks! I'll look into that. So just to verify, I'm going to need some type of chip to make my equalizer work in order to divide the audio spectrum into several bands?

Edcastillo09:
Thanks! I'll look into that. So just to verify, I'm going to need some type of chip to make my equalizer work in order to divide the audio spectrum into several bands?

I assumed that the Arduino has this capability...

This is how I think the system should work:

  1. Music is played which is picked up by the microphone on the Sound Impact Sensor
  2. Impact Sensor sends frequency signals to Arduino
  3. Using coding, the Arduino will split the audio spectrum into 10 bands (1 band to 1 pin)
  4. Each band is connected to one wire where the signal will interface with the LED strip and light up as appropriate.

"Impact Sensor sends frequency signals to Arduino"

Probably false. Probably amplitude.

Edcastillo09:
So just to verify, I'm going to need some type of chip to make my equalizer work in order to divide the audio spectrum into several bands?

No that chip does it all. It takes in the audio and splits it up into 7 bands which you can read from a single analog input of the MEGA.

the Sound Impact Sensor

No it is an equalizer chip.

Using coding, the Arduino will split the audio spectrum into 10 bands (1 band to 1 pin)

No - splits the sound into 7 bands and the Arduino has nothing much to do but read them one after the other from the chip.

Each band is connected to one wire where the signal will interface with the LED strip and light up as appropriate.

No you cut the strip into 7 lengths and wire them in a zig zag fashion.

Apart from that spot on.

The MSGEQ7 chip produces a simple set of 7 values that you can manipulate however you see fit.
Here's a peek

As mentioned, it only takes one input pin. I ran it with an ATTiny85 and could still run the LCD screen.

Grumpy_Mike:
No that chip does it all. It takes in the audio and splits it up into 7 bands which you can read from a single analog input of the MEGA.
No it is an equalizer chip.
No - splits the sound into 7 bands and the Arduino has nothing much to do but read them one after the other from the chip.
No you cut the strip into 7 lengths and wire them in a zig zag fashion.

Apart from that spot on.

Grumpy,

Thank you for your feedback :slight_smile: this helps my understanding about how things work. I have some questions and comments regarding your comments and would like to pick at your brain here.

I would like to create a 10 band instead of a 7. I don't think I want to use that chip for a 7 band. The "sound impact sensor" is this:

https://www.googleadservices.com/pagead/aclk?sa=L&ai=DChcSEwj1iLDKrZbVAhWVl34KHVGrCkoYABAFGgJwYw&ohost=www.google.com&cid=CAESEeD2liAsnFxaGSLVFZsu4YtI&sig=AOD64_34cfr53jnbIFEuGoX1pob_EFJUwQ&adurl=&ctype=5&q=

I have not bought it yet but would think this would work to pick up the audio. The output of this sensor would then feed into arduino then become broken down. Wouldn't the arduino have to split something up and then spit it back out to the LEDs? I know you're giving me feedback about a 7 band but I'm confused on how to go about create a 10 band without that equalizer chip. I assume whatever the equalizer chip is doing, the aurdino can do as well.

Regarding the construction of the strips; do you have an example of wiring them up in a "zig-zag fashion"? I think I have a pretty good idea but I want to be sure.

Thanks again for your feedback!
Eddie

have not bought it yet but would think this would work to pick up the audio.

No that module would not do what you want. It just has a single bit digital output.

If you want the Arduino to break up the sound the. The Mega is not the best one, it is a bit slow for that, you are better off with a Due or a Zero. To do the splitting up you need a piece of software called an FFT and that requires a faster processor than the mega if you want to display frequencies above 5kHz.

The strip is wired up exactly as it is before you cut it up, you just need to physically arrange the strips in the shape you want. Their is two ways you can do this, as a serpentine raster or just a raster, the only difference is that the software to drive them will be different.

You could use two two 7 band chips and offset the frequencies but they are only second order filters. Are you sure you know what you are doing?

"Single bit output".
That 'sound impact sensor' will either give you a 0 or a 1. That's it. Probably a "1" when it detects noise and a "0" when it's quiet.

Since the MSGEQ7 isn't good enough for you (even though you could simply code some in-between averages to get smoother curves and make as many 'bands' appear as you want), as mentioned in post #1, go look at some Arduino fast fourier transformation projects.

Grumpy_Mike:
No that module would not do what you want. It just has a single bit digital output.

If you want the Arduino to break up the sound the. The Mega is not the best one, it is a bit slow for that, you are better off with a Due or a Zero. To do the splitting up you need a piece of software called an FFT and that requires a faster processor than the mega if you want to display frequencies above 5kHz.

The strip is wired up exactly as it is before you cut it up, you just need to physically arrange the strips in the shape you want. Their is two ways you can do this, as a serpentine raster or just a raster, the only difference is that the software to drive them will be different.

You could use two two 7 band chips and offset the frequencies but they are only second order filters. Are you sure you know what you are doing?

That makes sense about the impact noise sensor. I mean, it says it in the name. Duh. Well, this is the whole point of me asking questions. Lol sorry, I'm new to this. I just want to learn and create something cool.

So a Due or Zero would be better for my application, but seems like create a 7 band would be easier using that equalizer chip. Maybe I should just do that then. So if did decide to create a 7 band using a microphone , an equalizer chip, the aurdino mega , and LEDs, what would be the step by step process to get this done correctly. I don't want to put something together then find out nothing is working.

To answer your question, no I do not know what I am doing :slight_smile: but I'm here to learn.

Signed,
Noob

INTP:
The MSGEQ7 chip produces a simple set of 7 values that you can manipulate however you see fit.
Here's a peek

As mentioned, it only takes one input pin. I ran it with an ATTiny85 and could still run the LCD screen.

Awesome!! Thank you, this helps :slight_smile:

INTP:
"Single bit output".
That 'sound impact sensor' will either give you a 0 or a 1. That's it. Probably a "1" when it detects noise and a "0" when it's quiet.

Since the MSGEQ7 isn't good enough for you (even though you could simply code some in-between averages to get smoother curves and make as many 'bands' appear as you want), as mentioned in post #1, go look at some Arduino fast fourier transformation projects.

Now I understand that the sensor is not what I want. :frowning: thanks for clearing that up.

And wait, I can use that chip to create as many bands as I want?? I thought it was seven? I guess that wasn't getting across to me very well. So if I wanted to use a small microphone, these MSGEQ7 chips, the aurdino Mega and the led strips, how will I go
about this? I know I just asked Grumpy the same question but I wanted your input as well.

Thank you

What is your music source? Do you have access to the audio signal, or do you want a microphone?
Audio signal is better, microphone picks up all noise, so if someone sneezes, it'll show.
The one I made used Bluetooth audio from my phone, but works the same with a standard 3.5mm jack (using a splitter).

I'm assuming you just want a pretty display. You're not using this to study sound frequencies. What I meant by averaging to get more bands is basically- between band 1 and 2 values, you could average them and insert an additional bar of your display at between 1 and 2. You'd get a smoother display.

You have a lot to work through before even considering how to use the LEDs, but you should look at what Neopixels are capable of in terms of update speed. Maybe you don't see many Neopixel/WS2812B spectrum analyzer type projects because they're too slow. Adafruit has Dotstars which are faster. I've not hooked up to LEDs yet so I can't say. Maybe I'll do it some time this week for my own curiosity.

INTP:
What is your music source? Do you have access to the audio signal, or do you want a microphone?
Audio signal is better, microphone picks up all noise, so if someone sneezes, it'll show.
The one I made used Bluetooth audio from my phone, but works the same with a standard 3.5mm jack (using a splitter).

I'm assuming you just want a pretty display. You're not using this to study sound frequencies. What I meant by averaging to get more bands is basically- between band 1 and 2 values, you could average them and insert an additional bar of your display at between 1 and 2. You'd get a smoother display.

You have a lot to work through before even considering how to use the LEDs, but you should look at what Neopixels are capable of in terms of update speed. Maybe you don't see many Neopixel/WS2812B spectrum analyzer type projects because they're too slow. Adafruit has Dotstars which are faster. I've not hooked up to LEDs yet so I can't say. Maybe I'll do it some time this week for my own curiosity.

Eh, you're probably right. Having a mic will probably be too messy. I currently have a Bluetooth set up on my speakers in my living room and could just get a splitter (audio going to the stereo and audio going to the LEDs). And yes I'm just doing this for fun. Just want some nice lights when I play music. I'll get back to you on what these strips are capable. They SHOULD work but I haven't dug into it much yet.

INTP:
What is your music source? Do you have access to the audio signal, or do you want a microphone?
Audio signal is better, microphone picks up all noise, so if someone sneezes, it'll show.
The one I made used Bluetooth audio from my phone, but works the same with a standard 3.5mm jack (using a splitter).

I'm assuming you just want a pretty display. You're not using this to study sound frequencies. What I meant by averaging to get more bands is basically- between band 1 and 2 values, you could average them and insert an additional bar of your display at between 1 and 2. You'd get a smoother display.

You have a lot to work through before even considering how to use the LEDs, but you should look at what Neopixels are capable of in terms of update speed. Maybe you don't see many Neopixel/WS2812B spectrum analyzer type projects because they're too slow. Adafruit has Dotstars which are faster. I've not hooked up to LEDs yet so I can't say. Maybe I'll do it some time this week for my own curiosity.

Here's what it says about the refresh rate:

Can I use NeoPixels for POV (persistence of vision) displays?
Not recommended. The refresh rate is relatively low (about 400 Hz), and color displays in fast motion may appear “speckled.” They look fine in stationary displays though (signs, decorations, jewelry, etc.). For POV use, DotStar strips will look much better (they have about a 20 KHz refresh rate).

Going to go ahead and return these neopixels and purchase the dotstar strips.

For what you want to do a Neopixel is fine and you will see zero difference if you use a dot star. A POV project involves moving the LEDs very rapidly, this is not what you are doing.

I asked if you knew what you were doing in order to be able to pitch my answers better. So now I know it is to look cool rather than to actually measure things I can give you better advice.

The equaliser is in effect seven second order band pass filters. Their is lots information in that last sentence that will mean nothing to you so try and look things up.
The switched capacitor bit means that the filter's peak is dependant on the frequency of an oscillator, that in turn is set by the values of a capacitor and resistor that you put round the chip. If you have two chips and use slightly different values for each chip you shift the array of frequencies it outputs. Get it right and they slot between each other.

Programming the Neopixels is easy and well within the capability of a Mega, in fact you could even do it with an ATtiny or Uno.

Grumpy_Mike:
For what you want to do a Neopixel is fine and you will see zero difference if you use a dot star. A POV project involves moving the LEDs very rapidly, this is not what you are doing.

I asked if you knew what you were doing in order to be able to pitch my answers better. So now I know it is to look cool rather than to actually measure things I can give you better advice.

The equaliser is in effect seven second order band pass filters. Their is lots information in that last sentence that will mean nothing to you so try and look things up.
The switched capacitor bit means that the filter's peak is dependant on the frequency of an oscillator, that in turn is set by the values of a capacitor and resistor that you put round the chip. If you have two chips and use slightly different values for each chip you shift the array of frequencies it outputs. Get it right and they slot between each other.

Programming the Neopixels is easy and well within the capability of a Mega, in fact you could even do it with an ATtiny or Uno.

Awesome. I will definitely do more research on the subject and start playing with some things once my aurdino comes in. I have a breadboard so I'll do some testing first before I finalize things. So if I have two equalizer chips, is it possible to get more than 7 bands?