MSGEQ7 Constant Output

Hello,
I'm working on a spectrum analyzer project using the MSGEQ7 CMOS chip (datasheet attached). I designed the attached circuit to read sounds from the MAX9814 (datasheet attached) microphone and used a voltage divider to drop the output voltage of the mic into the 300mV range required by the MSGEQ7 chip. I left the gain of the MAX9814 mic floating to keep it at 60dB. Pins 4 and 7 on the MSGEQ7 are attached to digital I/O slots 48 and 53, and pin 3 is attached to A0 on an arduino mega2560 board.

The code I'm using to read out is here:

int strobePin  = 48;    // Strobe Pin on the MSGEQ7
int resetPin   = 53;    // Reset Pin on the MSGEQ7
int outPin     = A0;   // Output Pin on the MSGEQ7
int level[7];          // An array to hold the values from the 7 frequency bands

void setup() {

 Serial.begin (9600);
 
  // Define our pin modes
  pinMode      (strobePin, OUTPUT);
  pinMode      (resetPin,  OUTPUT);
  pinMode      (outPin,    INPUT);
 
  // Create an initial state for our pins
  digitalWrite (resetPin,  LOW);
  digitalWrite (strobePin, LOW);
  delay        (1);
 
  // Reset the MSGEQ7 as per the datasheet timing diagram
  digitalWrite (resetPin,  HIGH);
  delay        (1);
  digitalWrite (resetPin,  LOW);
  digitalWrite (strobePin, HIGH); 
  delay        (1);

}

void loop() {
 // Cycle through each frequency band by pulsing the strobe.
  for (int i = 0; i < 7; i++) {
    digitalWrite       (strobePin, LOW);
    delayMicroseconds  (100);                  // Delay necessary due to timing diagram
    level[i] =         analogRead (outPin);
    digitalWrite       (strobePin, HIGH);
    delayMicroseconds  (1);                    // Delay necessary due to timing diagram  
  }
 
  for (int i = 0; i < 7; i++) {
    Serial.print       (level[i]);
    Serial.print       ("   ");
  }
 
  Serial.println ();  

}

The output of this code is just 7 constants reading 538 from each frequency band. The two main problems with the circuit I've found so far are:

1: The voltage on the o.1uF capacitor connecting to pin 5 of the MSGEQ7 reads about 3.87V between pin 5 and the capacitor and 0.2mV between the capacitor and the voltage divider. This made me think the voltage divider is working correctly, but MSGEQ7 is somehow outputting a voltage at pin 5 and is not accepting the input. The 0.2mV voltage at the voltage divider does change based on the mic picking up noises.

2: The MAX9814 mic only seems to pick up sound from directly tapping on it and not anything else like clapping/talking/ambient noise/etc. Tapping the mic was having an effect on the voltage output from the MAX9814 mic and voltage at the voltage divider so I think this portion is working as intended, but I'm not sure why it isn't picking up other sounds despite being set on the highest gain setting. Online comments made the mic seem to be pretty sensitive.

Questions:
-Why is there an output voltage (the 3.87V) from pin 5 of the MSGEQ7 when it should just be receiving an input?
-Is there a problem with my circuit or potentially the MAX9814 mic that is causing it not to pick up noise other than tapping?

Any help with these questions or other things you notice would be greatly appreciated, thank you :).

Sorry if my circuit drawing is hard to understand, I'm drawing it up in eagle and will update with that soon.

MSGEQ7 7-band EQ chip.pdf (146 KB)

MAX9814 datasheet.pdf (1.22 MB)

I assume the MAX9814 is a board complete with a microphone and not just a chip?

I've never used the MSGEQ7 but I've studied it a little. A lot of people have trouble with it and there are rumors of rejects or fakes being sold. If you didn't buy yours from a reputable supplier it may be defective. And, maybe some people just have trouble with the software & timing....

I'm not sure if you need the voltage divider but typically you'd use a pot whenever there's a microphone & preamp.

The output of this code is just 7 constants reading 538 from each frequency band.

What do you get with the preamp disconnected? Or, you can just ground the center-point of the voltage divider... It's actually better to ground the preamp-side of the capacitor to kill any noise.

1: The voltage on the o.1uF capacitor connecting to pin 5 of the MSGEQ7 reads about 3.87V between pin 5 and the capacitor and 0.2mV between the capacitor and the voltage divider.

I don't understand what you're measuring but I'd expect pin 5 of the MSGEQ7 to be biased at about half of Vcc (measured to ground).

2: The MAX9814 mic only seems to pick up sound from directly tapping on it and not anything else like clapping/talking/ambient noise/etc.

How are you testing that?

Tapping the mic was having an effect on the voltage output from the MAX9814 mic and voltage at the voltage divider so I think this portion is working as intended

Audio signals AC and tapping the mic gives a short-duration signal that you can't really measure with a meter.

I'd recommend plugging the MAX9814 into your stereo or into powered computer speakers or something so you can hear what's coming out of it. (Keep the mic away from the speakers and try to avoid feedback.... I can be hard to avoid feedback with AGC.)

Similarly, you can test the MSGEQ7 & Arduino separately from the mic/amplifier by connecting a line-output or headphone-output from you stereo, computer, or phone, etc. In fact, that's a good way to test it. You can generate constant tones at known frequencies with Audacity to check the different frequency-bands. For testing you can make an electrical connection first, and then test with speakers and the microphone.

used a voltage divider to drop the output voltage of the mic into the 300mV range required by the MSGEQ7 chip.

What! I think you miss read that.
The data sheet says the input to the chip should be peak to peak the voltage rail you are running it off. You have done nothing with pin 6 which is the internally generated mid rail voltage. Your signal should be symmetrically around this point, not at all like you have it.

This is a circuit for two MSGEQ7 chips with input op amps. The MCP 3002 chip is an A/D for processors who do not have them ( this was designed for the Raspberry Pi ) but the front end shows how you should bias your amplifiers. I find I need a 5 to 10 times gain for an audio line output.

Grumpy_Mike:
What! I think you miss read that.
The data sheet says the input to the chip should be peak to peak the voltage rail you are running it off.

I interpreted that from the output swing on Vin being 0.3Vpp. Does output swing mean something different? What information in the datasheet tells you that it should the input should be peak to peak the voltage rail? Sorry I'm new to reading these.

Grumpy_Mike:
You have done nothing with pin 6 which is the internally generated mid rail voltage. Your signal should be symmetrically around this point, not at all like you have it.

In the datasheet they just had it running through a capacitor labeled CG (I didn't know what this stands for) then grounded so that's what I was trying to replicate. Why does the signal need to be symmetric around this point when it is just labeled ground in their diagram? I think I'm missing a lot of theory so if you have recommendations to learn more about this I'd happily take them.

Grumpy_Mike:
...the front end shows how you should bias your amplifiers. I find I need a 5 to 10 times gain for an audio line output.

Can't DC bias just be removed with a capacitor, or does it need to be done differently? Also what determines the gain you need for an audio line output? I thought this may be taken care of by the mic's built in gain.
Thank you for all the help.

DVDdoug:
I assume the MAX9814 is a board complete with a microphone and not just a chip?

Yep.

DVDdoug:
I've never used the MSGEQ7 but I've studied it a little. A lot of people have trouble with it and there are rumors of rejects or fakes being sold. If you didn't buy yours from a reputable supplier it may be defective. And, maybe some people just have trouble with the software & timing....

I have two of the MSGEQ7 and interchanged them and was getting the same signals, so it seems unlikely they're both broken (hopefully), and the code for the timing I took from a site that got it working so I think that shouldn't be an issue.

DVDdoug:
I'm not sure if you need the voltage divider

The Vin output swing is 0.3Vpp and the MAX9814 mic works in the 2V range so I thought I had to use the voltage divider to align these values. Am I misunderstanding the Vin output swing meaning?

DVDdoug:
What do you get with the preamp disconnected? Or, you can just ground the center-point of the voltage divider... It's actually better to ground the preamp-side of the capacitor to kill any noise.

The MAX9814 is just a microphone/amplifier. Is this considered a preamp as well? And is the MAX9814 what you're referring to when you say what do you get with the preamp disconnected?
And do you mean add a ground to the MAX9814 side of the input? Wouldn't this just stop the signal from the mic?

DVDdoug:
I don't understand what you're measuring but I'd expect pin 5 of the MSGEQ7 to be biased at about half of Vcc (measured to ground).
How are you testing that?

Why would you expect half of the voltage there? And I just tested with a voltmeter connected to pin 5 and the ground.

DVDdoug:
Audio signals AC and tapping the mic gives a short-duration signal that you can't really measure with a meter.

I'd recommend plugging the MAX9814 into your stereo or into powered computer speakers or something so you can hear what's coming out of it. (Keep the mic away from the speakers and try to avoid feedback.... I can be hard to avoid feedback with AGC.)

I was measuring the voltage change on the mic output, but is the audio signal independent of the voltage? I saw voltage changes from tapping but not other noise. I'll try and test it with speakers later today and get back on this point.

DVDdoug:
Similarly, you can test the MSGEQ7 & Arduino separately from the mic/amplifier by connecting a line-output or headphone-output from you stereo, computer, or phone, etc. In fact, that's a good way to test it. You can generate constant tones at known frequencies with Audacity to check the different frequency-bands. For testing you can make an electrical connection first, and then test with speakers and the microphone.

I'll give this a try as well and update later.
Thanks for all the help!

Can't DC bias just be removed with a capacitor

Yes but that is the problem, you need the DC on the input in order for the chip to work.

Also what determines the gain you need for an audio line output?

My practical experience of using the chip. The data sheet is a very poor example of a data sheet.

Why does the signal need to be symmetric around this point when it is just labeled ground in their diagram?

You are not reading that diagram correctly. That DC ground is a signal ground it is not the negative of the chip. The signal ground has to be half way between the chips power rails, that is how audio signals work.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.