How To Use Sound Sensor With Arduino, Arduino project with code

how to use sound sensor with arduino, Arduino projects with code by andprof
how to use sound sensor with arduino, Arduino project + code

The Sound Sensor Module, is an microphone integrated into an electronic circuit, used to detected Sound signals.
So that it is used in many devices to capture and record sound, and it can also be used to control electronic circuits by sound.
In this post we will learn: How To Use Sound Sensor With Arduino.

Electronic components needed :

  • 1 Resistance ( 220 Ohm )
  • 1 Led
  • Sound Sensor Module KY-038
  • Electrical wires
  • Arduino UNO
  • Breadboard

How To Use Sound Sensor With Arduino, Arduino project with code

Schema of the circuit :

how to use sound sensor with arduino, Arduino projects with code

Arduino programming code :


const int ledpin=11; 
const int soundpin=A2;
const int threshold=200;
// By www.andprof.com
void setup() {
Serial.begin(9600);
pinMode(ledpin,OUTPUT);
pinMode(soundpin,INPUT);
}
void loop() {
      // reads analog data from sound sensor
int soundsens=analogRead(soundpin);
if (soundsens>=threshold) {
      //turns led on
digitalWrite(ledpin,HIGH); 
delay(1000);
}
else{
digitalWrite(ledpin,LOW);
}
}

Explainer video :

Discover also :

How to make fire detector using arduino

How to control LED lights with Arduino

How to use digit 7-Segment LED Display with Arduino