First, let me say that I'm a total beginner and will probably have some obvious and clear mistakes in my design. Any help would be appreciated. I am trying to build a VU meter using a MAX9814, MSGEQ7 and Arduino Nano. In this test, I'm powering the project from the USB port of my computer.
Circuit Diagram:
I'm working on the spectrum analysis circuit and I'm seeing values of 400-600 with no sound in the room. To my untrained eye, I think I'm having an issue with the voltage divider between the MAX9814 and MSGEQ7. From what I've read, the MAX9814 outputs 2Vpp and the MSGEQ7 is expecting a 300mVpp. I tried to calculate the voltage drop and choose R1 value of 47k and since i didn't have a single 268k resistor for R4 I used a 220k and 47k in series. Did I mess up the voltage divider and allow too much voltage to enter the MSGEQ7 to measure accurately? I figure the breadboard would add a little bit of noise but usually I see people sitting at 40-50 in a quite room but my values are 10x that. Is that to be expected?
I'm also seeing overlap in the peaks when using Audacity to step through the MSGEQ7 frequencies (63hz, 160hz, 400hz, 1000hz, 2500hz, 6350hz and 16000hz). The MSGEQ7 also doesn't read the first and last frequency very well at all. The others peak out pretty well aside from the overlap.
I have 3 MSGEQ7s and they all show the same output pattern
Below is my code, a picture of the layout, and a video of the serial plotter/monitor during an Audacity sweep of frequencies played from my computer:
Code:
#define STROBEPIN 10
#define RESETPIN 6
#define MSGEQ7READPIN A1
#define TOTALFREQUENCIES 7
uint16_t RawFrequencies[TOTALFREQUENCIES];
void PrintData()
{
for (int FrequencyIndex = 0; FrequencyIndex < TOTALFREQUENCIES; FrequencyIndex++)
{
Serial.print(RawFrequencies[FrequencyIndex]);
Serial.print(" ");
}
Serial.println("");
}
void GetFrequencyData()
{
digitalWrite(RESETPIN, HIGH);
digitalWrite(RESETPIN, LOW);
delayMicroseconds(80);
for (int FrequencyIndex = 0; FrequencyIndex < TOTALFREQUENCIES; FrequencyIndex++)
{
digitalWrite(STROBEPIN, LOW);
delayMicroseconds(40);
RawFrequencies[FrequencyIndex] = analogRead(MSGEQ7READPIN);
digitalWrite(STROBEPIN, HIGH);
delayMicroseconds(40);
}
}
void setup()
{
Serial.begin(9600);
pinMode(RESETPIN, OUTPUT);
pinMode(STROBEPIN, OUTPUT);
digitalWrite(RESETPIN,LOW);
digitalWrite(STROBEPIN,HIGH);
}
void loop()
{
GetFrequencyData();
PrintData();
delay(200);
}
Picture of my circuit
Test Run:
MSGEQ7 and MAX9814