Issues with MSGEQ7: Part 2

Hello, everyone. It's been several months since the last thread so I created a new one. You can read the previous thread here, but I'll summarize it below.

Purpose: to use the MSGEQ7 to analyze the spectrum of incoming music and output DC voltages proportional to the signal's spectrum. This will be used to control a strip of programmable LEDs.

Problem from Previous Thread: "The values I get in the serial monitor are all in the 100s. The output should range from 0-1023, scaling most likely linearly with the strength of the signal; i.e. if I play a 63Hz sine wave, the output of the 63Hz bandpass should be in the 900-1023 range. But whether I play music or specific tones (e.g. 400Hz, 2.5KHz), the output doesn't change at all. The output of every band remains in the 100-199 range."

MSGEQ7 Datasheet: here

Summary of Previous Thread suggestions:
• solderless breadboards have poor connections so maybe switch to a solerable board
• check all connections, components (resistor and capacitor values, etc.), continuity, etc.
• amplify the music signal to get a better range

What's New Since Last Thread:
I've built the circuit suggested by user Grumpy_Mike, using two separate MSGEQ7 chips (one for the left channel, one for the right channel) and an MCP602 op-amp to amplify the two audio channels. I'm using the MCP602 specifically to combat signal clipping, as it has better rail-to-rail performance than the previous op-amp used.

Here is the circuit schematic suggested by Grumpy_Mike. Pictures of it built are posted at the bottom of this post.


Only a few modifications were needed:
• 5V supply instead of 3.3V
• 15.7µF instead of 16µF due to cap values I have on me
• Strobe, Reset, OutputL, and OutputR are connected directly to an Arduino Mega instead of the MCP3002 in the schematic

Is the Problem Fixed?
No. Instead of output values in the 0s and 100s, they're in the 300s, but don't change at all. The output stays in the 300s for music, no music, 63Hz tones, 400Hz tones, etc. It seems the amplifier is working and amplifying the signal by a factor of ~3, but the circuit is still not functioning properly. I have three theories:
• Bad MSGEQ7 chips. I bought these from Sparkfun, but I've heard of other people having problems. Three new ones are being shipped right now.
• Solderless breadboards are crap. Possible, but I haven't had problems with these boards before. I'd strongly prefer not soldering this whole circuit together before proving it works.
• Bad Arduino code. I've tried using several different test programs found online, e.g. J Skoba's MSGEQ7 guide that includes his test script. No code works.

I would really appreciate any help or advice anyone can give. I'm feeling really defeated because I just can't get this project to work :cry:

P.S. I graduated so I don't have access to an oscilloscope anymore :cry:




Connections to the Arduino weren't included in these photographs in order to improve visibility. If you'd like to see how I connected it to the Arduino, please let me know!

OK, so I have taken my original circuit, removed the MCP3002 chip and soldered on some wires to my Arduino Uno, with strobe on pin 6 and reset on pin 7.
The setup is like this:-


I wrote some software to display the results on the serial plotter. Now this flashes a bit as the data scrolls onto the display but it is enough to show the results from each channel.

/*
  Demo sketch which uses a MSGEQ7 chip and serial plotter 
  Mike Cook June 2020
*/

// MSGEQ7 pin assignments
#define STROBE 6
#define RESET  7

int left[7];
int right[7];

void setup() {
  Serial.begin(250000);
  // initialize the MSGEQ7 pins
  pinMode(STROBE, OUTPUT);
  pinMode(RESET, OUTPUT);
  digitalWrite(RESET, LOW);
  digitalWrite(STROBE, HIGH);

  // reset the MSGEQ7's output multiplexer
  digitalWrite(RESET, HIGH);
  delayMicroseconds(50);
  digitalWrite(RESET, LOW);
  delay(1);
}

void loop() {
      // first reset the MSGEQ7
      digitalWrite(RESET, HIGH);
      delayMicroseconds(50);
      digitalWrite(RESET, LOW);
     // now read in the data
      for (byte i=0; i < 7; i++) {
      digitalWrite(STROBE, LOW);
      delayMicroseconds(50);
      left[i] = analogRead(0); // read the left MSGEQ7 value
      right[i] = analogRead(1); // read the right MSGEQ7 value
     //left[i] = 128 * (i+1); // simulate the left MSGEQ7 value
     //right[i] = 128 * (8-i); // simulate the right MSGEQ7 value     
      digitalWrite(STROBE, HIGH);
      delayMicroseconds(50);
     }
      displayReadings();
      //hold = true;
  }

void displayReadings() {
  displayGap(100,0);
  for (byte i=0; i < 7; i++) {
    for(byte j=0; j<4; j++){
    Serial.println(left[i]);
    }
    displayGap(4,0);
  }
  // up to 156 serial sent
  displayGap(44,0); // put at Y = 200
  
  for (byte i=0; i < 7; i++) {
    for(byte j=0; j<4; j++){
    Serial.println(right[i]);
    }
    displayGap(4,0);
  }
  // now at 256
  displayGap(144, 0);
  displayGap(100, 1024); // put at rest of display at 1024 so as not to auto scale
  delay(400);
}

void displayGap(int n, int v){
  for(int d=0; d<n; d++) Serial.println(v);
}

This is the result for a signal generator set at a sin wave at 2KHz.

This is the result from playing some music through it.

I think you can see that it works.

Are you really really sure that you have a 33pF capacitor, because it does not look like one to me. Note 33pF not 33nF. I have never seen a low value capacitor like that in a shiny lacquer finish.

Have you considered using a DFR MSGEQ7, Audio Analyzer module just to see if another setup will work more bedda?

I posted the code I use here https://forum.arduino.cc/index.php?topic=690488.0

Can you do an experiment here for me. Can you attach a pot's wiper to pin 5 of one of the MSGEQ7s, with the other wires on the pot going to Gnd and 5V.

Does altering this pot change the numbers out of the display? It will probably change all of them to more or less the same degree?

Thinking :-
This chip is basically a switched capacitor filter that is clocked at seven different rates in turn to get each of the frequency outputs. If that oscillator is too slow then it will be filtering basically the DC level, and so should produce roughly the same output for all the switched clocking rates. The clock is set by the 200K resistor and 33pF capacitor around pins 1 and 8 of the chip. If you had a scope then I would expect to see this oscillation at around 100KHz or there abouts on pin 8.