How to use the Sound Detection Sensor with Arduino

How to use the Sound Detection Sensor with Arduino

Sound Detection Sensor for Arduino

INTRODUCTION

The sound sensor is a simple microphone based on the LM358 amplifier to detect sounds in the environment. The potentiometer (blue turn knob) can be used to adjust the sensitivity of the module.

APPLICATIONS

Microphones are used in many everyday items such as cell phones and laptops. A robot can be controlled using a combination of sounds or the sound sensor can be used to build a sound detection alarm system to detect intruders.

WIRING DIAGRAM

VCC – 5V

OUT (D0) – Digital Pin 7

GND - GND

 Sound detection sensor for Arduino

 

CODE

int sensorPin=7;
boolean val =0;

void setup(){
  
  pinMode(sensorPin, INPUT);
  Serial.begin (9600);
}
  
void loop (){
  val =digitalRead(sensorPin);
  Serial.println (val);
  // when the sensor detects a signal above the threshold value, LED flashes, adjust sensitivity using the blue potentiometer
  if (val==HIGH) {
    Serial.println("noise");
  }
  else {
    Serial.println("silence");
  }
}

END RESULT

Open serial monitor to see the output. Make sure you are in a quiet place to observe the “silence” output. Then try to make a sound by snapping your fingers or saying hello and observe the output “noise”.

ADDITIONAL RESOURCES

http://www.instructables.com/id/Arduino-Sound-Sensor-with-LED/

https://randomnerdtutorials.com/guide-for-microphone-sound-sensor-with-arduino/

https://create.arduino.cc/projecthub/iotboys/control-led-by-clap-using-arduino-and-sound-sensor-e31809

https://learn.sparkfun.com/tutorials/sound-detector-hookup-guide/all

https://www.hackster.io/MisterBotBreak/how-to-use-a-big-sound-sensor-657ec6