0
votes

Intro

Hello everyone. I am trying to start my first microcontroller experiences. I like music, so i started with the SparkFun Spectrum Shield for arduino.

Hardware

Software

I flashed my arduino with this code https://github.com/sparkfun/Spectrum_Shield/blob/master/Firmware/SparkFun_Spectrum_Demo/SparkFun_Spectrum_Demo.ino I only added a function to debug the Frequencies_One and Frequencies_Two values:

void Debug_Frequencies(){
  Serial.print("{\"Left\":[");
  for(int i= 0; i<7; i++)
  {
    Serial.print(Frequencies_One[i]); 
    if(i<6){
      Serial.print(",");
    }
  }
  Serial.print("],\"Right\":[");
  for(int i= 0; i<7; i++)
  {
    Serial.print(Frequencies_Two[i]); 
    if(i<6){
      Serial.print(",");
    }
  }
  Serial.print("]");

  Serial.print(",\"millSecSinceOn\":");
  Serial.print(millis());
  
  Serial.println("}");
}

The Error

I got the following output in the Arduino IDE Serial Monitor:

15:50:06.080 -> {"Left":[1023,1023,1023,1023,1023,1020,60],"Right":[1023,1023,1023,1023,1023,1023,70],"millSecSinceOn":6599}
15:50:06.536 -> {"Left":[1023,1023,1022,1023,1023,1022,63],"Right":[1023,1023,1023,1022,1023,1023,71],"millSecSinceOn":7025}
15:50:06.949 -> {"Left":[1023,1023,1022,1023,1023,1020,62],"Right":[1023,1023,1023,1023,1023,1023,77],"millSecSinceOn":7451}
15:50:07.370 -> {"Left":[1023,1021,1021,1023,1023,1023,66],"Right":[1023,1023,1023,1023,1023,1023,76],"millSecSinceOn":7877}

The arduino function analogRead which is used by the manufactures code can return 0-1023 as a int value. So the analogRead Method now every times returnes MAX Value, even if there is no music input.

My Analysis

My first thoughts were, there must be a bypass anywhere between 5V input and the analog read Pin, but i cannot detect any (checked by multimeter). On my board there is a 2.53k-2.59k ohm resist beween the arduino board Pin 5V and A0 (and A1 too) when the board is offline. there also is a 4.36k ohm resist between A0/A1 and Ground.

1
Where did you add the call to that function in the sketch? What exactly is your expected output? There are some samples that are different from 1023 in both arrays. I'm not really sure if I understand what you're asking.Guille
I added the code instead the call of the Graph_Frequencies function. My expected output is something between 100-300 when its silent (because there is always a kind of noice). Yea I know, this is a kind of, what is wrong here question, but i dont know the right value because i want to measure it.ooyen
maybe the last value of the json is valid, so i expect something in the 60isch rangeooyen
I suspect this is a hardware problem. You've got one or more things incorrectly connected (or you did once, and that may have damaged the chip). The folks on the Arduino SE site may be better suited to help you.Adrian McCarthy
The initial reset and strobe sequence in setup() in the sketch doesn't seem to match the diagram in the chip's datasheet. sparkfun.com/datasheets/Components/General/MSGEQ7.pdfAdrian McCarthy

1 Answers

0
votes

analog pin is getting random reading from static charges in the air and to overcome this problem we should use pull down resistor between analog pin and ground,

"10k ohm resistor" is recommended