Go Down

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

Edcastillo09

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.

Edcastillo09

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

Edcastillo09

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

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.

Edcastillo09

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?

Grumpy_Mike

Yes that is what I said. However I also said that they are only second order filters so their is a bit more overlap. Get the data sheet of the device and look at the graph of the filters.

I used two chips but used one for the left hand and the other for the right hand stereo channel. I used a raspberry Pi for this project, with an Arduino you just need to use 5V and you don't need the A/D converter. It is built into the Arduino. And you have the neopixel strips for a display.

https://vimeo.com/167914646

Then I also made this with the same hardware
https://vimeo.com/184643867

Get the magazine articles on free download see the magazine's web site.

Edcastillo09

Yes that is what I said. However I also said that they are only second order filters so their is a bit more overlap. Get the data sheet of the device and look at the graph of the filters.

I used two chips but used one for the left hand and the other for the right hand stereo channel. I used a raspberry Pi for this project, with an Arduino you just need to use 5V and you don't need the A/D converter. It is built into the Arduino. And you have the neopixel strips for a display.

https://vimeo.com/167914646

Then I also made this with the same hardware
https://vimeo.com/184643867

Get the magazine articles on free download see the magazine's web site.
Mike,

I'm a visual person so I started to create my own schematic. Please see attachment. Just an a couple questions.

1) What's providing 5VDC & GND for the LEDs? In my schematic, I am interfacing with power from a 5VDC 10A AC/DC Power converter. Pretty much following this website:https://learn.adafruit.com/adafruit-neopixel-uberguide/basic-connections

Should the power be coming from the arduino?

2) So let's see if I'm making the right assumption. I am going to need a cable similar to the picture that's in the attachment. I need a wire for the MSSGEQ7 left Hand at Pin 5 and another wire for the MSGEQ7 right hand Pin 5. Is this correct? BTW, I'm still trying to figure out my capacitor and resistors values for the equalizer chips. Still doing research.

Thanks!
Eddie

Grumpy_Mike

Quote
Should the power be coming from the arduino?
No.
You can drive the Arduino with the 5V power supply used to drive the LEDs or have a separate power supply. However the ground of the power supply must be connected to the ground of the Arduino.

The MSGEQ7 has an analogue output that must be connected to an analogue input of the Arduino. Each chip to a different analogue input. There are other digital inputs to this chip and these must be connected to the Arduino however these can be common on the two chips.

Whandall

If you use a zig-zag connection* between the "bars" you have much less and shorter wiring.

Every second "bar" will have the leds in reverse direction, but that can easily be hidden in software.

* connect bar1 and bar2 on top, bar2 and bar3 on the bottom, ...
Ah, this is obviously some strange usage of the word 'safe' that I wasn't previously aware of. (D.Adams)

Edcastillo09

If you use a zig-zag connection* between the "bars" you have much less and shorter wiring.

Every second "bar" will have the leds in reverse direction, but that can easily be hidden in software.

* connect bar1 and bar2 on top, bar2 and bar3 on the bottom, ...
This is exactly what I was thinking after I created the schematic. Thanks! Good point.

Edcastillo09

After digging into the internet more and doing some more reading, I actually found a similar project. See link below:

http://www.eetimes.com/author.asp?doc_id=1323030&page_number=1

The author/designer, Max's cool beans, created a Audio Spectrum analyzer using two MSGEQ7 chips. Using this project, I have finished my wiring schematic. (See attachment). The following items are shown in my schematic:

1) 14 strips of LEDs. (7 for the left channel and 7 for the right channel with each strip having 20 LEDs)
2) Arduino Mega
3) MSGEQ7 - Qty 2
4) 5VDC 10A AC/DC Power Converter (To Power the LEDs)
5) 9 Capacitors (Different Values)
6) 5 Resistors (Different Values)
7) 3.5mm PCB Audio Jack

If you take a look at the project that Max's cool beans created, he only had 14 regular LEDs while I have 280 programmable LEDs. I have the following questions I'm still trying to answer:

1) How do I figure out my resistor & capacitor values that are interfacing with the MSGEQ7 chips? Of course they can't be the same as the similar project I mentioned. I am still reading up on how to do this.

2) The similar project uses multiple Pulse Width Modulation (PWM) pins to interface with the LEDs. 1 pin per LED, but since I have these programmable LED strips, do I only need to use one pin (PWM Pin 0) for my project?

Any help is greatly appreciated. The ball is rolling now :)

Grumpy_Mike

You don't need any PWM outputs to drive a NeoPixel strip.

What R & C values are you looking to change?

Edcastillo09

You don't need any PWM outputs to drive a NeoPixel strip.

What R & C values are you looking to change?
So should I be using a Digital Pin to talk to the LED strips?

I was looking at the R & C values at Pins 1,5,6, & 8 on the MSGEQ7 chips, but I think the values that are called out int he spreadsheet should be fine. I assumed I had to play with these values....

Grumpy_Mike

Quote
So should I be using a Digital Pin to talk to the LED strips?
Yes, and a libiary to drive it. It is not the sort of thing you can program yourself.

It is only the R between Pin 1 and 8 you need to consider if you want to make the bands interleave. All other components should be left as they are for a 14 band system. You are best using a 180K fixed resistor in series with a 47K pot wired as a variable resistor, for one chip and leave the other at 200K. Adjust the pot until you get the correct overlap between any two bands. All the others will fall into place.

Edcastillo09

Yes, and a libiary to drive it. It is not the sort of thing you can program yourself.

It is only the R between Pin 1 and 8 you need to consider if you want to make the bands interleave. All other components should be left as they are for a 14 band system. You are best using a 180K fixed resistor in series with a 47K pot wired as a variable resistor, for one chip and leave the other at 200K. Adjust the pot until you get the correct overlap between any two bands. All the others will fall into place.

That's right. I have to have a library. I'll use the NeoPixel library. I got my board today so I'll play with it.

Just to be sure, are you talking about the Resistor that's in parallel with the 33pF capacitor? I see why you are referencing Pin 8 and 1 because they both interfacing with VDD (5 V). I can do what you're mentioning . I'm guessing in order to see the correct overlap between any two bands, I have to see that in the output of my code, correct? Or what would be the way to verify this when I start playing with the pot?

Go Up