Go Down

Topic: Spectrum Analyzer using Adafruit NeoPixel Strips & Arduino Mega (Read 6194 times) previous topic - next topic

Edcastillo09

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

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.

Edcastillo09

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...

Edcastillo09

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.

INTP

"Impact Sensor sends frequency signals to Arduino"

Probably false. Probably amplitude.

Grumpy_Mike

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.

Quote
the Sound Impact Sensor
No it is an equalizer chip.

Quote
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.

Quote
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.

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.

Edcastillo09

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 :) 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

Grumpy_Mike

Quote
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?

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.

Edcastillo09

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 :) but I'm here to learn.

Signed,
Noob

Edcastillo09

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 :)

Edcastillo09

"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. :( 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

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.

Go Up