Going further to explain How To Use Sound Sensor ? Control LED By Clap Using Arduino And Sound Sensor. We are covering how to use KY-038 Sound Sensor using Arduino. Also showing how you can control LED by clap with the help of Arduino and Sound Sensor. We have shown only to control LED by clapping, but using the same concept you can control any electronic device. Once you watched full video you will understand everything.
What is KY-038 Sound Sensor ?
KY-038 Small sound sensor acts like a microphone which detects sound signals. The sensor will detect sound signals an provide digital or analog output. The sound sensor can be used to make exciting projects like clap switch or any project we can make any action based sound detection. It’s very cheap you can buy it within 2-3 USD dollar. Let’s task about KY-038 architecture :-
KY-038 Sound Sensor having 4 Pins :-
-
AO – Analog Output
-
G – Ground
-
+ – VCC
-
DO – Digital Output
How KY-038 Sensor Works :-
The sensor has 3 main components on its board. First ,the sensor unit at the front of the module which measures the area physically and sends an analog signal to the second unit, the amplifier. The amplifier amplifies the signal, according to the resistant value of the potentiometer, and sends the signal to the analog output of the module. The third component is a comparator which switches the digital out and the LED if the signal falls under a specific value.
We can control the sensitivity by adjusting the potentiometer attached in KY-38 sensor.
Note : The signal will be inverted; that means that if you measure a high value, it is shown as a low voltage value at the analog output.
7 Components Required to Control LED By Clap Using Arduino And Sound Sensor :-
- 1 x Arduino Uno Board
- 1 x USB cable
- 1 x KY-038 Sound Sensor
- 1 x 1K Pull up Register
- 5 x Male to Female Jumper Wire
- 1 x Breadboard
- 1 x LED
Connection for Control LED By Clap Using Arduino And Sound Sensor :-
Sketch/Source Code :-
int soundSensor=2; int LED=4; boolean LEDStatus=false; void setup() { pinMode(soundSensor,INPUT); pinMode(LED,OUTPUT); } void loop() { int SensorData=digitalRead(soundSensor); if(SensorData==1){ if(LEDStatus==false){ LEDStatus=true; digitalWrite(LED,HIGH); } else{ LEDStatus=false; digitalWrite(LED,LOW); } } }
2 thoughts on “How To Use Sound Sensor ? Control LED By Clap Using Arduino And Sound Sensor”
Salve il programma del battimani quando lo inserisco mi da un errore mi puoi dire perché??
kindly share screenshot with error message.