how to use sound sensor iotboys

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 :-

  1.  AO  – Analog Output

  2. G – Ground

  3. + – VCC

  4. 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. 1 x Arduino Uno Board
  2. 1 x USB cable
  3. 1 x KY-038 Sound Sensor
  4. 1 x 1K Pull up Register
  5. 5 x Male to Female Jumper Wire
  6. 1 x Breadboard
  7. 1 x LED

Connection for Control LED By Clap Using Arduino And Sound Sensor :-

Sound Sensor Connection

Sketch/Source Code :-

int soundSensor=2;
int LED=4;
boolean LEDStatus=false;

void setup() {


void loop() {

  int SensorData=digitalRead(soundSensor); 

How To Use Sound Sensor ? Control LED By Clap Using Arduino And Sound Sensor
How To Use DS18B20 Water Proof Temperature Sensor

Sensors: Different Types of Sensors


Leave a Reply

Your email address will not be published. Required fields are marked *