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:

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);
}
}
















