# MSGEQ7 problem \[SOLVED\]

**URL:** <https://forum.arduino.cc/t/msgeq7-problem-solved/668289>\
**Category:** Audio\
**Created:** [August 1, 2020, 1:31pm UTC](https://forum.arduino.cc/t/msgeq7-problem-solved/668289 "2020-08-01T13:31:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jejpi23](https://avatars.discourse-cdn.com/v4/letter/j/f04885/32.png) [@jejpi23](https://forum.arduino.cc/u/jejpi23)\
**Post date:** [August 1, 2020, 1:31pm UTC](https://forum.arduino.cc/t/msgeq7-problem-solved/668289/1 "2020-08-01T13:31:28Z")

</div>

Hello,

I have recently tried to create an Audio Visualizer with MSGEQ7. First i tried to understand how the chip works in order to put it in my project. I connected the chip as they say in datasheet [first attachment] , but the readings are always the same and equal to 800 +- 10. I tried other connections from projects in this site, however the results are always the same. I checked the connections and the audio output they seemed to work as they should. Can anyone help me with this, because i don't have any idea what is wrong with it.

The code

/\*  
Test Sketch for the MSGEQ7  
from Mixed Signal Integration

the IOs in this Sketch are  
compatible with the Shield  
from Sparkfun:

> **[SparkFun Spectrum Shield - DEV-13116 - SparkFun Electronics](https://www.sparkfun.com/products/13116)**
>
> The Spectrum Shield enables your Arduino with the capability of splitting a stereo audio input into 7-bands per channel. You can then read the amplitude of

Author: Simon Waldherr  
License: MIT  
\*/

int AnalogIn = 0; // read from multiplexer using analog input 0  
int NextBand = 2; // strobe (next band) is attached to digital pin 4  
int ResetPin = 3; // reset is attached to digital pin 5  
int Spectrum[7]; // array to store analog values  
int filter = 80; // \*\*\* added min level above noise

void setup()  
{

// init IO  
// delay(250); // \*\*\* not necessary  
// pinMode(AnalogIn, INPUT); // \*\*\* not necessary  
pinMode(NextBand, OUTPUT);  
pinMode(ResetPin, OUTPUT);  
analogReference(DEFAULT);  
digitalWrite(ResetPin, HIGH);  
digitalWrite(ResetPin, LOW); // \*\*\* added  
// digitalWrite(NextBand, HIGH); //\*\*\* removed

// init Serial  
// delay(250); // \*\*\* not necessary  
Serial.begin(9600); //\*\*\* chg'd from 115200 to 9600  
//\*\*\* make sure Monitor is 9600  
Serial.println("|\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_|");  
Serial.println("| MSGEQ7 |");  
Serial.println("|------------------------------|");  
Serial.println("| Seven Band Graphic Equalizer |");  
Serial.println("|------------------------------|");  
Serial.println("| on an Arduino Shield |");  
Serial.println("|------------------------------|");  
Serial.println("| with Serial output |");  
Serial.println("|------------------------------|");  
// wait  
delay(5000);  
}

void loop()  
{  
// \*\*\* Reset here works but slighly better response without it  
// digitalWrite(ResetPin, HIGH); // reset band to 63 Hz  
// digitalWrite(ResetPin, LOW);

for (int i = 0; i \< 7; i++) // for loop to save values to array  
{  
// HIGH to LOW transition works best here  
digitalWrite(NextBand, HIGH); //\*\*\* added  
digitalWrite(NextBand, LOW);  
delayMicroseconds(22); // to allow the output to settle  
// Spectrum _= doMath(analogRead(AnalogIn)); // read actual value to array_

- // read spectrum level and filter noise\*  
 _Spectrum = constrain(analogRead(AnalogIn), filter, 1023); //\*\*\* added_  
_// digitalWrite(NextBand, HIGH); //\*\*\* moved up // select next band (160Hz, 400Hz, 1000Hz, 2500Hz, 6250Hz, 16kHz)_  
_\_ delayMicroseconds(3); //\*\*\* probably not necessary\__  
_\* }\*_  
_\* for (int i = 0; i \< 7; i++) // for loop to print array to Serial\*_  
_\* {\*_  
 _if (Spectrum == filter ) //\*\*\* chg'd // ignore values lower than 100 (you also can use doMath())_  
_\* {\*_  
_\* Serial.print("\t");\*_  
_\* Serial.print("0");\*_  
_\* }\*_  
_\* else\*_  
_\* {\*_  
_\* Serial.print("\t");\*_  
_\_ Serial.print(Spectrum\*);  
  }  
  }  
  Serial.println(); // Serial new line\*  
 \* //delay(500); // this sketch prints really much data, you can slow down if you have to.  
  }[/td]  
 [/tr]  
 [/table]  
  ![1.png](https://europe1.discourse-cdn.com/arduino/original/4X/1/8/1/181649d9cbc0d24033a040b081e9f61bd3aa8ac9.png)\_  
  ![IMG_20200801_150850.jpg](https://europe1.discourse-cdn.com/arduino/original/4X/8/0/0/800e9249fdb0b3a8d3777d09e0980382041420da.jpeg)   
  ![IMG_20200801_150913.jpg](https://europe1.discourse-cdn.com/arduino/original/4X/0/f/b/0fbf4fb6158184cfaca1499637747caaf8b97262.jpeg)   
  ![IMG_20200801_150936.jpg](https://europe1.discourse-cdn.com/arduino/original/4X/9/3/2/93293bb7103258e0e7be9d12a94c062062ba180f.jpeg)\*_

---

<div class="post-metadata">

**Author:** ![slipstick](https://avatars.discourse-cdn.com/v4/letter/s/50afbb/32.png) [@slipstick](https://forum.arduino.cc/u/slipstick)\
**Post date:** [August 1, 2020, 3:44pm UTC](https://forum.arduino.cc/t/msgeq7-problem-solved/668289/2 "2020-08-01T15:44:26Z")

</div>

Spectrum is an array. So trying to print it or apply a constrain to it is never going to work. That code doesn't even compile so I don't believe it prints any values at all.

OTOH your main problem may be that you have a fake MSGEQ7 because there seem to be a lot of them about. Where did you get yours from?

Steve'

---

<div class="post-metadata">

**Author:** ![jejpi23](https://avatars.discourse-cdn.com/v4/letter/j/f04885/32.png) [@jejpi23](https://forum.arduino.cc/u/jejpi23)\
**Post date:** [August 1, 2020, 3:56pm UTC](https://forum.arduino.cc/t/msgeq7-problem-solved/668289/3 "2020-08-01T15:56:55Z")

</div>

I bought them on Ebay from Chinese supplier so they are probably fakes you say. Thank you for the information.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 6, 2021, 4:28am UTC](https://forum.arduino.cc/t/msgeq7-problem-solved/668289/4 "2021-05-06T04:28:12Z")

</div>

Closed on May 6, 2021, 4:28am UTC


