Description of the image.
Home Creativity Arduino Projects How To Use Sound Sensor With Arduino | Arduino projects with code

How To Use Sound Sensor With Arduino | Arduino projects with code

How To Use Sound Sensor With Arduino | Arduino projects with code
How To Use Sound Sensor With Arduino | Arduino projects with code

A sound sensor is an electronic component used to capture sound signals and convert them into an electrical signal. Sound sensors are used in various devices, from simple to sophisticated. They are used to transmit sound signals or to control a device or robot using sound. In this post, we will learn How To Use Sound Sensor With Arduino.

Electronic components that we need:

  • Arduino UNO
  • Breadboard
  • Sound Sensor
  • 1 LED lights
  • 1 resistor 220 Ohm
  • Electrical wires

Circuit diagram:

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

Programming Code:

const int ledpin=11;
const int soundpin=A2;
const int threshold=200;
// by www.andprof.com
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(ledpin,OUTPUT);
pinMode(soundpin,INPUT);
}

void loop() {
// put your main code here, to run repeatedly:
int soundsens=analogRead(soundpin); // reads analog data from sound Sensor
if (soundsens>=threshold){
digitalWrite(ledpin,HIGH); //turns led on
delay(1000);
}
else {
digitalWrite(ledpin,LOW);
}
}

Explanatory video:

Watch the Explanatory video on YouTube, arduino project with code

Watch the video on YouTube

Previous articlehow to use 16×2 lcd display with arduino | arduino project with code
Next articleHow To Make Clap Switch with Arduino and Sound Sensor | Arduino projects