用户工具

站点工具


en:ocrobot:modules:max4466

The microphone module

Introduce

This is a delicately designed microphone module, equipped with a 20-16 KHZ electret microphone, use the special microphone amplifier, has the very good power supply noise suppression, almost no noise or rustle.

Thismodule has a potentiometer, it is used to adjust the gain margin (sensitivity).

It is also very simple to use,with gnd pin link to ground, pin VCC use a 2.4-5 v DC. In order to get the best effect, please use a separate LDO to supply power to prevent other noise from other device. ( you can use a 3.3 V with your arduino). Audio output waveform through OUT pins. Output has the VCC / 2 DC bias, so when the environment is completely quiet,that will be a stable voltage VCC / 2 v (DC coupling).

If your device need ac coupling audio, you need to add a 100 uf capacitance between the microphone output pins and device input pins . If it is connected to the audio amplifier with difference input and contains the back coupling capacitance, then you don't need 100 uf capacitance.

The out pin of this module is not directly connected to the speakers or headphones, if you need to connect to speakers or headphones, you need an audio amplifier. If you are connected to the microcontroller ADC , then there is no need for amplifier, also do not need back coupling capacitance, directly connect OUT pin to the ADC interface.

Parameter

Sensitivity: - 42 db ± 2 db Signal to noise ratio: 60 db Detection frequency range: 20 hz - 16 KHZ Interface: 2.54 spacing standard needle

The sample code 1, measure the intensity of the sound code, VCC to 3.3 V. This code to the Arduino ()

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;  // convert to volts
 
   Serial.println(volts);
}
en/ocrobot/modules/max4466.txt · 最后更改: 2023/06/07 04:23 由 127.0.0.1