MAX4466 output not accurate at all under certain noise level

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
fabiensen
 
Posts: 12
Joined: Mon Jul 25, 2016 10:21 am

MAX4466 output not accurate at all under certain noise level

Post by fabiensen »

Hi,

we are testing the output of a sketch using the MAX4466 microphone for Arduino. The sketch is the following:

Code: Select all

const int sampleWindow = 50; // Sample window width in mS (50 mS = 20Hz)
unsigned int sample;

void setup() 
{
   Serial.begin(9600);
}


void loop() 
{
   unsigned long startMillis= millis();  // Start of sample window
   unsigned int peakToPeak = 0;   // peak-to-peak level

   unsigned int signalMax = 0;
   unsigned int signalMin = 1024;

   // collect data for 50 mS
   while (millis() - startMillis < sampleWindow)
   {
      sample = analogRead(0);
      if (sample < 1024)  // toss out spurious readings
      {
         if (sample > signalMax)
         {
            signalMax = sample;  // save just the max levels
         }
         else if (sample < signalMin)
         {
            signalMin = sample;  // save just the min levels
         }
      }
   }
   peakToPeak = signalMax - signalMin;  // max - min = peak-peak amplitude
   double volts = ((peakToPeak * 3.3) / 1024) * 0.707;  // convert to volts
   double first = log10(volts/0.00631)*20;
   double second = first + 94 - 44;
   Serial.println("misurazione "+String(second));
}
We are comparing the dB output (variable is named second) with a professional phonometer. Strangely, above 65 dB (we tested up to 94 dB) we have a very good measurement. However, under 60-65 dB we have larger difference the lower is the amount of dB. For example, with a noise of 40 dB as measured by the phonometer we have an output with MAX4466 of 60 dB, with 55 dB from phonometer we have 65 dB from the output, etc.
Probably we are missing something obvious but still we ask if you are aware of something we can add/remove from the code. What is strange, is that it is very precise above a certain level of dB.

Thank you very much,

Regards
Fabio Ricci

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: MAX4466 output not accurate at all under certain noise l

Post by adafruit_support_mike »

Please stick to a single thread: viewtopic.php?f=25&t=106446

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Arduino products from Adafruit”