Sound Sensor + Arduino + Clap(ON/OFF)

1. Sound Sensor INPUT

analog input, A0

2. LED OUT

digital output, PIN 3

3. Code

int LED = 3;

void setup(){

pinMode (LED, OUTPUT);

}

void loop() {

int statusSensor = analogRead(A0);

if (statusSensor > 200){

delay(100);

while(true){

digitalWrite(LED, HIGH);

int statusSensor = analogRead(A0);

if(statusSensor>200){

break;

}

}

delay(100);

}

else{

digitalWrite(LED, LOW);

}

}

Share

    Recommendations

    • Weaving Challenge

      Weaving Challenge
    • Build a Tool Contest

      Build a Tool Contest
    • Trash to Treasure

      Trash to Treasure

    3 Discussions

    0
    None
    baudot

    2 years ago

    What model sound sensor are you using?

    1 reply
    0
    None
    DAEHWANLbaudot

    Reply 2 years ago

    I used a old model.

    Now, following site sells new model.

    https://www.dfrobot.com/index.php?route=product/product&product_id=83

    0
    None
    Swansong

    2 years ago

    That's a fun setup :)