Trybotics Logo

Control LED By Clap Using Arduino and Sound Sensor

DESCRIPTION

This video shows how to use KY-038 Sound Sensor using Arduino. It also shows how you can control LED by clap with the help of Arduino and Sound Sensor. We have shown only to control LED, but by using the same concept you can control any electronic device.

KY-038 Sound Sensor having 4 Pins:

  • AO – Analog Output
  • G – Ground
  • + – VCC
  • DO – Digital Output
For more info visit www.iotboys.com

For more details visit www.iotboys.com

Description:

Description:

This video shows how to use KY-038 Sound Sensor using Arduino. It also shows how you can control LED by clap with the help of Arduino and Sound Sensor. We have shown only to control LED, but by using the same concept you can control any electronic device.

KY-038 Sound Sensor having 4 Pins:

  • AO – Analog Output
  • G – Ground
  • + – VCC
  • DO – Digital Output
For more info visit www.iotboys.com

For more details visit www.iotboys.com

Description:

Source CodeC/C++
Source Code for Control LED using Clap
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);
    }
  }
 } 

Description:

Circuit Design
Circuit Diagram
Sound sensor connection iotboys com wiring wkfols3kjv


YOU MIGHT ALSO LIKE