Arduino Sound Detection Sensor: Tutorial and User Manual

Basic Description

Sound Detection SensorThis module allows you to detect when sound has exceeded a set point you select.  Sound is detected via a microphone and fed into an LM393 op amp.

The sound level set point is adjusted via an on board potentiometer.    When the sound level exceeds the set point, an LED on the module is illuminated and the output is sent low.

Get One of These

This tutorial focuses on the three pin variety that provides single digital output.  There is another flavor that also includes an analog output.  As you’re shopping, you will want to pay attention to what it is you’re buying.  Below are some the vendors that I have found selling these at a reasonable price.

eBay

Amazon

IC Station

Bang Good

 

Uses for the Arduino Sound Detector

Given that this device measures whether or not sound has exceeded a threshold,  you’re basically left with determining what it is you want to do.   What I mean by this is that you can do something when it is quiet and/or you can do something when it is loud.  For example:

  • You could detect whether or not a motor is running.
  • You could set a threshold on pump sound so that you know whether or not there is cavitation.
  • In the presence of no sound,  you might want to create an ambiance by turning on music.
  • In the presence of no sound and no motion, you may go into an energy savings mode and turn off the lights.

Arduino Sound Detection Sensor Pin Outs

The image and table below detail the controls, pin outs, and other key components.

When referring sensititivity, I mean this:

  • When less sensitive,  it takes more sound to trigger the device
  • When more sensitive, it takes less sound to trigger the device

Arduino Sound Detection Sensor Pin Outs

ParameterValue
VCC5 Vdc from your Arduino
GroundGND from your Arduino
OutConnect to Digital Input Pin
Power LEDIlluminates when power is applied
Sound Detection LEDIlluminates when sound is detected
Sound Set Point AdjustCW = More Sensitive
CCW = Less Sensitive

Arduino Sound Detection Sensor Tutorial

Connect the Sound Sensor Module to your Arduino

This is your typical three pin hook up.

Arduino Sound Detection Sensor TutorialCopy This Tutorial Sketch and Upload It

 

//Henry's Bench
//Arduino Sound Detection Sensor Module

int soundDetectedPin = 10; // Use Pin 10 as our Input
int soundDetectedVal = HIGH; // This is where we record our Sound Measurement
boolean bAlarm = false;

unsigned long lastSoundDetectTime; // Record the time that we measured a sound


int soundAlarmTime = 500; // Number of milli seconds to keep the sound alarm high


void setup ()
{
  Serial.begin(9600);  
  pinMode (soundDetectedPin, INPUT) ; // input from the Sound Detection Module
}
void loop ()
{
  soundDetectedVal = digitalRead (soundDetectedPin) ; // read the sound alarm time
  
  if (soundDetectedVal == LOW) // If we hear a sound
  {
  
    lastSoundDetectTime = millis(); // record the time of the sound alarm
    // The following is so you don't scroll on the output screen
    if (!bAlarm){
      Serial.println("LOUD, LOUD");
      bAlarm = true;
    }
  }
  else
  {
    if( (millis()-lastSoundDetectTime) > soundAlarmTime  &&  bAlarm){
      Serial.println("quiet");
      bAlarm = false;
    }
  }
}

Run The Sketch and Verify Output

Once your sketch is running,  you will want to open your serial monitor.    Make some loud noises and view the result.   Your output should look something like the picture below:

Arduino Sound Detection Moduel - Tutorial Output

36 Comments

  1. Edo Pasaribu June 13, 2017
  2. Efrain Gonzalez March 23, 2017
  3. Carien Ross March 22, 2017
  4. Colby February 22, 2017
  5. capnfatz@gmail.comAuthor February 9, 2017
  6. Ellehcir February 9, 2017
  7. charles callebs December 21, 2016
  8. capnfatz@gmail.comAuthor December 6, 2016
  9. JC December 5, 2016
  10. Yohanes Prasetya December 4, 2016
  11. Surgess Santacruz November 28, 2016
  12. capnfatz@gmail.comAuthor November 21, 2016
  13. Michael November 20, 2016
  14. Ali akram November 6, 2016
  15. capnfatz@gmail.comAuthor October 31, 2016
  16. Pierre Salsiccia October 31, 2016
  17. Fiza95 October 15, 2016
  18. capnfatz@gmail.comAuthor October 14, 2016
  19. fiza95 October 13, 2016
  20. capnfatz@gmail.comAuthor September 27, 2016
  21. lesa September 27, 2016
  22. KM SHEETAL BANGA September 27, 2016
  23. Surgess Santacruz September 24, 2016
  24. capnfatz@gmail.comAuthor August 24, 2016
  25. Jang August 23, 2016
  26. Melesa August 18, 2016
  27. capnfatz@gmail.comAuthor August 15, 2016
  28. malou August 11, 2016
  29. capnfatz@gmail.comAuthor August 9, 2016
  30. malou August 9, 2016
  31. Marcin August 3, 2016
  32. DoctorFunk July 24, 2016
  33. Kris July 16, 2016
  34. peterb July 2, 2016
  35. ashad February 3, 2016
  36. Walt Johnson January 22, 2016

Add a Comment

Your email address will not be published. Required fields are marked *