Dear forum,
I want to use the MSGEQ7 like everyone does, but I cannot get it to work. The MSGEQ7 reads a fairly constant value for each band. It is around 500 when I connect the IC to 3.3V, and runs up to 840 when I connect it to 5V. The least I would expect is that without audio, the readings should be very low (say, <100).
It does not react to audio-in, connecting/disconnecting any of the capacitors, the resistor, or the cable. Only when disconnecting the Vin the readings drop <10, and when disconnecting the analog read, all readings become completely random. These last two actions make sense of course.
I also noticed that the RESET pin on the MSGEQ7 (pin 7) reads a HIGH value (~4.6V). I read this for different MSGEQ7's I have. Is that correct? In all the coding, the RESET is configured as an output pin.
What did I try so far?
- read, wire and code according to the manual and the many how-to's around
- quadruplechecked the values of the resistors and the capacitators
- change them with others
- used different MSGEQ7. I have tried 2 from 2 different sellers (2 from a local seller, 2 from Aliexpress), 4 in total.
- different cables, breadboards. Even soldered 1 version to a PCB.
- used somewhat different timings in the code
- tried different pins on the Arduino
- tried another Arduino
- used the search function on this forum for similar problems with a solution
So, my wiring is as follows:
Pins 1 and 8 are connected by a 200 kOhm resistor
Pins 1 and 2 are connected by a 0.1 uF cap
Pin 1 is connected to 3.3V or 5V from the Arduino
Pin 2 is connected to GND
Pin 3 is connected to A0
Pin 4 is connected to D13
Pin 5 is connected to a 0.1 uF cap, which is connected to a 22 kOhm resistor, which is then connected to the line-in
Pin 6 is connected via 0.1 uF cap to GND
Pin 7 is connected to D12
Pin 8 is connected via a 33 pF cap to GND
I measured the line-in jack to ensure that the signal indeed reaches the 22 kOhm resistor, and the GND connects to GND.
See the attached image for more details. The small caps are the 0.1 uF ones, the larger one is the 33 pF.
The code:
int strobe = 13; // STROBE
int resetpin = 12; // RESET
int analogIn = A0;
int spectrumValues[7];
void setup()
{
Serial.begin(115200);
pinMode(resetpin, OUTPUT);
pinMode(strobe, OUTPUT);
pinMode(analogIn, INPUT);
// Create an initial state for our MSGEQ7 pins
digitalWrite (resetpin, LOW);
digitalWrite (strobe, LOW);
delay (1);
// Reset the MSGEQ7 as per the datasheet timing diagram
digitalWrite (resetpin, HIGH);
delay (1);
digitalWrite (resetpin, LOW);
digitalWrite (strobe, HIGH);
delay (1);
}
void GetValuesMSGEQ7() {
// tr - trigger reset, high for 0.1 us
digitalWrite(resetpin, HIGH);
// trs - reset to strobe, pause 72 us
digitalWrite(resetpin, LOW);
delayMicroseconds(75);
for(int i=0; i < 7; i++){
digitalWrite(strobe, LOW);
delayMicroseconds(40);
spectrumValues[i] = analogRead(analogIn);
digitalWrite(strobe, HIGH);
delayMicroseconds(40);
}
delay(30);
}
void loop()
{
GetValuesMSGEQ7();
// Display values from the left channel on the serial monitor
for (int i = 0; i < 7; i++)
{
if (spectrumValues[i] < 100) Serial.print(" ");
if (spectrumValues[i] < 10) Serial.print(" ");
Serial.print(spectrumValues[i]);
Serial.print(" ");
}
Serial.println();
}
The output on 5V:
839 839 839 839 839 839 839
839 839 839 840 840 839 839
840 840 840 839 839 839 839
839 839 839 839 839 839 839
The output on 3.3V:
499 499 500 499 500 500 499
499 500 500 499 499 500 499
500 499 500 500 500 500 500
499 500 499 499 499 499 499

Thanks in advance for any help! It is driving me crazy.
ps: ugh, the forum does not accept my images

ps2: well, succeeded in getting 1 image up by converting it back and forth to different formats

Image 2 shows how it is connected to the Arduino Uno, but it is already mentioned above.