MSGEQ7 problem. (Noise)

Hello!

I am having an issue with a MSGEQ7 at the moment. It does respond to sound but not nearly as well as I would expect. When playing “Smack My Bitch Up” by the Prodigy I can see the lowest frequency bounce quite a bit. (Nearly up to half of the progressbar I am using for display). The other ones react as well, but just a tiny bit. Far from what I would expect in the high frequency tones in the song.

I have also tried using a frequency generator and it really does not give me a clean result. You can see the quick test program I made for this device in the picture. I am using the test code by J Skoba on the arduino.

int analogPin = 0; // read from multiplexer using analog input 0
int strobePin = 2; // strobe is attached to digital pin 2
int resetPin = 3; // reset is attached to digital pin 3
int spectrumValue[7]; // to hold a2d values

void setup() 
{
  Serial.begin(9600);
  pinMode(analogPin, INPUT);
  pinMode(strobePin, OUTPUT);
  pinMode(resetPin, OUTPUT);
  analogReference(DEFAULT);

  digitalWrite(resetPin, LOW);
  digitalWrite(strobePin, HIGH);

  Serial.println("MSGEQ7 test by J Skoba");
}

void loop() 
{
  digitalWrite(resetPin, HIGH);
  digitalWrite(resetPin, LOW);

  for (int i = 0; i < 7; i++)
  {
    digitalWrite(strobePin, LOW);
    delayMicroseconds(30); // to allow the output to settle
    spectrumValue[i] = analogRead(analogPin);

    // comment out/remove the serial stuff to go faster
    // - its just here for show
    if (spectrumValue[i] < 10)
    {
      Serial.print("    ");
      Serial.print(spectrumValue[i]);
    }
    else if (spectrumValue[i] < 100 )
    {
      Serial.print("   ");
      Serial.print(spectrumValue[i]);
    }
    else
    {
      Serial.print("  ");
      Serial.print(spectrumValue[i]);
    }
    
    digitalWrite(strobePin, HIGH);
  }
  Serial.println();
}

You can find the image right here: (Didn’t use IMG tags because of its size, tried to get the relevant info into one picture (the lazy way) )
http://img263.imageshack.us/img263/6591/gfxeq.png

As for the circuit everything is hooked up as in the datasheet with one exception. The RC oscillator is using a 30 pF cap instead of a 33 pF cap. (Because I have no 33 pF caps right now) While not exactly after the schematics in the datasheet it is actually closer to the typical clock frequency found in the datasheet. The typical frequency is 165 kHz, using a 30pF cap gives us 166.67 kHz. Using a 33 pF gives us 151.15 kHz.

Any ideas what might be causing this? And possibly a few tips for a fix?

Help is much appreciated =)

Spec sheet seems to show you need 36uS from strobe going low to the outputs settling to read a value, and 72uS from strobe strobe. Are these times being met?
How are the analog pins on the arduino wired up? (Avcc, Aref, etc.)

I tried playing with the timings. Both using the exact timings in the datasheet and slightly longer timings. (Except the 100 ns reset) It does not change anything at all :(

As for the analog pin. I am using the DEFAULT as Aref in the picture above, but have also tried the INTERNAL. The only difference is the percentage of the progressbar.

Maybe it is simply a faulty chip I have received. I will try the second chip tomorrow. Hopefully it aint a wiring error of min that will destroy them both. The cost of the chip is only 4 USD, but when the shipping is 29 USD it rapidly gets a lot more expensive buying more of them :P

I would try this: make your first delay 35uS, and add 35uS after the strobe High. Otherwise, strobe goes high after the if statements, and then almost immediately goes low again.

What's the point of the 3 comparisons? Seems like in all cases you send out some spaces and then the value. So why not just send the spaces and the value every time?

Thanks for the help, I will try both ideas in the morning.

That aint my code, but if you look closely there is a different amount of spaces in each case. Makes the format easier to read when simply reading the console output.

Will be making my own schematics based on how it is currently connected. Then it will be an easy task to compare it with the datasheet.

Sorry for double post, but I have an update :)

I did as you guys said and drew up a circuit based on how I had connected it. I could not find any errors there and tried changing the chip. That did it :) Getting clean results now (there is some noise but nothing to worry about really)

Thanks for the help