MSGEQ7 spectrum analyzer issues.

Hi ,
I try to use an MSGEQ7 for my project to drive a Ledstrip. This MSGEQ7 spectrum analyzer chip is connected at pin 5 to a typical audio connector. In between I have a resistor from 22K and a capacitor of 10nF in series . I also tried 100nF but with no success. When I measure pin 5 (Audio In) at the chip I measure a High level (around 3.3V) because I powered the chip with 3.3V. I expect to see an audio wave but I see no wave at all.
When I decouple the wire from Audio In and measure it then I see the audio wave coming in. So the moment I couple it to pin 5 my wave disappears and I have a high level. Is that chip defect?
Hope someone can help me here. If you have a successful project running with MSGEQ7 what do you measure at pin 5 ?
Thx in advance.

I've never used the MSGEQ7 but I've studied it a bit and it's a very cool little chip...

A LOT of people seem to have trouble with it and there are reports/rumors of "fake" or defective MSGEQ7 chips, so hopefully you bought it from a reputable supplier. (And it's always a good idea to buy an extra chip now matter what chips you're using, and put it in a socket if it's in a package that can use a socket so you can swap chips for troubleshooting.)

I'm not sure, but I'd expect about half the power supply voltage on the input. That's pretty standard on any audio circuit that uses a single supply. Audio is AC (it goes positive and negative) so if the input rests at ground you can't get the negative-half of the waveform (without a negative power supply) and if it rests at 3.3V you can't get the positive half.

n between I have a resistor from 22K and a capacitor of 10nF in series .

You need a capacitor to isolate the DC bias from your audio signal. The value isn't too critical because of the chip's high input impedance. If the capacitor is too small you'll filter-out the bass.

You don't need the resistor with a single input. (It won't hurt anything.) The datasheet shows two 22k resistors for mixing the left & right channels without shorting the left & right signals together.

Did you write the code yourself or did you copy it? It's a LOT easier to troubleshoot if you wrote it yourself... For example, I'd recommend reading the data and displaying it on the serial monitor. The LED display won't work if you're not getting "good data".

And for testing, I'd recommend making a series of 7 test-tones. You can do that with Audacity or you can probably find a tone-generator application for your computer or for your phone. Regular audio is very "random" when you're "looking" at the "data" and if low frequencies are supposed to turn-on a blue LED (etc.) known-frequency test tones are the best way to test.

And, I recommend writing some code to control the LEDs under software control with no audio input. You can "simulate" data at various audio frequencies t make sure the LEDs behave as expected.

I expect to see an audio wave but I see no wave at all.

We don't know what your code is doing, we don't know what your code is supposed to do, and you didn't show us a schematic so we don't know how things are wired. (Even with a schematic, sometimes the actual wiring doesn't match the schematic. :wink: )

...A 7-band spectrum analyzer would have 7 LED strips. You can make all kinds of fun spectrum/frequency effects and I have the feeling that you didn't build a spectrum analyzer...

You didn't show us a schematic or the code and we have no idea what it's supposed to do...

P.S.

When I decouple the wire from Audio In and measure it then I see the audio wave coming in. So the moment I couple it to pin 5 my wave disappears and I have a high level. Is that chip defect?

If you disconnect the audio (or turn off the sound) and "something changes", the odds are the chip is good and there's something wrong with the wiring or software.

the moment I couple it to pin 5 my wave disappears and I have a high level.

That is not possible if you have a series capacitor like you said. So I would look at that first. Yes I see the wave on this pin. But what are you doing with pin 6? That should be connected to the audio's ground connection. The audio's ground should not be connected to the Arduino's ground.

  • Thx already for the valuable input. I attached a drawing how I did it. It is very standard like documented.
  • So indeed I am surprised I have high level on input because I also have the capacitor in serie. That should remove the DC component in the signal. It's like the IC is putting it high again.
  • Yes the software I wrote by myself but for now I have no good data on the output because the input make no sense.
  • I tried already with 4 different MSGEQ7 , all same result. They come from ali express though.
  • I ordered now 2 new ones from Robotshop , hope these are the original ones.
  • I am also a little confused with the max peak to peak voltage at the input. The datasheet confuses me.
    Does it mean you can have a max peak to peak of 100mV? Can you damage the chip if the peak to peak is more than 1V.

I attached here 2 screenshots of my scope. One is with pin5 attached, the other is without pin 5 connected. Measure point is between capacitor and pin5.

WOW! You have a 'scope! I assumed you were using a multimeter. If you have a meter, double-check check with your meter. Is that a "real" oscilloscope or one of those cheap USB boards that plugs into USB? Do you trust it? Does the 'scope measure 0V (maybe with a little noise) when disconnected?

...There are (rare) cases where attaching a 'scope probe (or meter probe) changes the voltage/signal. It's "funny" when you get a circuit that works when you touch the probe and then fails again when you disconnect the 'scope. :smiley:

So indeed I am surprised I have high level on input because I also have the capacitor in serie. That should remove the DC component in the signal. It's like the IC is putting it high again.

Yes, this is baffling. I once had a boss who used to say, "Stranger than truth!" Are you sure it's a 10nF non-polarized capacitor? ...A 10uF electrolytic (polarized) can "leak" into a high impedance and it can leak badly if reversed. You already tried a different capacitor so we can be fairly confident that it's not shorted.

Since you have a 'scope you can trigger with on the reset pin and look at the output from the MSGEQ7. But, you'll really need some known (electrical) test signals. I guess you can make a quick check using the microphone to see if you get "something" or nothing. If you get a constant DC voltage you know it's not working.

I am also a little confused with the max peak to peak voltage at the input. The datasheet confuses me.
Does it mean you can have a max peak to peak of 100mV? Can you damage the chip if the peak to peak is more than 1V.

The datasheet is not 100% clear... Usually the datasheet for a chip will give you "absolute maximum" voltages for the input pins.

But as a general rule you should be safe between the power supply, so at 3.3V that's 3.3V peak-to-peak. And, line-level audio outputs (like the output from a microphone preamp or from a CD/DVD player, etc.) are usually low current and incapable of doing any damage. (A speaker output could be "dangerous".)

... I'm still betting on a software error, but it could be a wiring error. And, I'm betting that you're barking up the wrong tree looking at the input pin.

BTW - The resistor and pot in series with the 1M input impedance are doing nothing (because of the high input impedance) You can re-wire the pot as an attenuator/sensitivity control ("volume control") but that's not how it's shown.

You haven't got the audio ground connected to pin 6 like I said. You have it connected to the Arduino ground.

@Mike But the mic is powered with the same power supply as the micro processor and MSGEQ7. So I have no other ground in the circuit.

Then you can’t use that microphone.

Ok I got it working because I tested it now with an original MSGEQ7. So the microphone is working but what is not working is the audio in coming from a regular audio output like an mp3 player. I added the same circuit in front of the audio in of the msgeq7 like with the Mic . But I have strange results , not what I expect.
I followed something like this :

If I add the ground of the audio connector (3.5mm pin) to the reference gnd (pin6) or I add it to the normal ground of the circuit (pin 2) it doesn't work in both situations. The output of the msgeq7 is giving high numbers on all frequency bands even when no music is playing on the audio device. I tested it with multiple audio devices all same result.

I followed something like this :
Spectrumanalyzer

Was that supposed to be a link? In electronics something like is not good enough we need to know what you did exactly.

Ok I got it working because I tested it now with an original MSGEQ7.

Not sure what that means, did you have a faulty chip?

So the microphone is working

Not sure what you mean by working because a microphone can’t supply enough of a signal by itself to fully drive the chip. In fact an audio source like my iPad on full volume can’t drive it fully I normally add a times ten op-amp amplifier in front of the input.

Can you post a photograph of your setup please.

I used this microphone breakout board : Downloads | Adafruit AGC Electret Microphone Amplifier - MAX9814 | Adafruit Learning System
So the output is already amplified and this works well.
But I also want to provide the possibility to connect an audio output like an mp3 player.

Yes I replaced the chip , the other one was faulty

"I followed something like" . Sorry for my wording, It's an exact copy of this. The only difference is that I use 3.3V . But the datasheet says it also works with 3.3V.

Ok but if that was supposed to be a link it didn’t work. If it was supposed to be a project then there are dozens of projects with this name.

Edit
By downloading your reply as a quote I was able to see exactly what you had put here and it was supposed to be an image. As you can see it did not work.

When I tried to follow the link manually I got

  1. That’s an error.

Your client does not have permission to get URL ........

So I attached here two things I tested.
The one with the Mic works
The one with the audio input doesn't.
I see that I forgot on the picture to connect my gnd on the ESP32 but in reality I did.

The one with the Audio input has the audio ground connected to the mid rail bias point through a capacitor. Therefore there is no DC connection to the signal ground and so it will not work.

Ok thanks for the input, I got it working by adding it to the ground of the circuit (pin 2) and also I think a bad connection on my breadboard caused some issues.
I connected pin 6 to the same gnd as well (with the capacitor).
:slight_smile: happy It's working.

Next challenge is to add a NJM2521L1 between the audio/mic input and the MSGEQ7 so I can digitally switch from microphone to audio input.