![](https://leeselectronic.com/50073-large_default/max9812-microphone-amplifier-module.jpg)
![](https://leeselectronic.com/50073-large_default/max9812-microphone-amplifier-module.jpg)
location_on 4131 Fraser St. Vancouver BC Get Directions
phone 604-875-1993 Call us
access_time Hours
Monday - Friday | 9AM - 5:30PM |
Saturday - Sunday & Holidays | Closed | See Holiday Hours |
The module is based on the MAX9812 chip from Maxim Integrated. It’s a low-cost fixed gain (20dB) microphone amplifier IC.
Here’s the Arduino sketch I used:
// selecting the analog input pin
const int inputPin = A0;
// size of the window
const int inputWindow = 100;
// placeholder for a single measurement
unsigned int inputSample;
void setup() {
// initializing the analog input
pinMode(inputPin, INPUT);
// initializing the serial communication
Serial.begin(9600);
}
void loop() {
// two variables for minimum and maximum values in window
unsigned int inputMax = 0;
unsigned int inputMin = 1024;
// loop for the window
for (unsigned int i = 0; i < inputWindow; i++) {
// read in a single value
inputSample = analogRead(inputPin);
// get the minimum and maximum value
inputMin = min(inputMin, inputSample);
inputMax = max(inputMax, inputSample);
}
// send the values on serial
Serial.print("Min: ");
Serial.print(inputMin);
Serial.print(" Max: ");
Serial.print(inputMax);
Serial.print(" Diff: ");
Serial.print(inputMax - inputMin);
Serial.println();
}
And this is the output after uploading and running the sketch: