Sound Sensor / Noise Meter with Electret Mic

This is a sound sensor that will make red LEDs light up when the noise level reaches a certain threshold. It could be useful for a classroom. It will respond to talking from across the room.

It was made using an electret microphone, which is cheap and surprisingly sensitive. Also, I used an opamp to amplify the microphone signal, it’s available for five dollars at this site.

There is a special circuit to make the microphone work. You can look at the first circuit drawing on this site: or my drawing below.

                                                  • 5v
                                                    2k Resistor
                                                    0 - - - - - - 10 uF capacitor - - - - - 0 - - - - - - to Op-Amp “in”
                                                    | |
                                                    +mic 10 k Resistor
  • mic |
    | |
                                                                    • Ground

Then op amp “out” goes to an arduino analog pin, pin 4 with the code below.
The sensitivity of the mic can be adjusted by turning the potentiometer on the op amp with a screwdriver.

//SOUND MONITOR for the classroom 

int sensorPin = 4;    //Microphone Sensor Pin
int YellowLED = 1;    
int RedLED = 4;    
int sensorValue = 0; 

void setup() {
  pinMode(YellowLED, OUTPUT); 
 pinMode(RedLED, OUTPUT); 

void loop() {
  // read the value from the sensor:
  sensorValue = analogRead(sensorPin);    
 /* If you feel that the sensor values on the serial monitor
 are going by too quickly for you to read, you can make it 
 so that the values only show up on the serial monitor 
 if you make a noise.  You can replace 
 if (sensorValue < 509){

  digitalWrite(YellowLED, HIGH);  //Yellow is always on.

  if (sensorValue<509){  //The 'silence' sensor value is 509-511
    digitalWrite(RedLED, HIGH);
    delay(2000);            // The red LEDs stay on for 2 seconds
} else {
    digitalWrite(RedLED, LOW);