Sound Sensor + Arduino + Clap(ON/OFF)

698

10

3

Posted in TechnologyArduino

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

    • Spotless Contest

      Spotless Contest
    • Microcontroller Contest

      Microcontroller Contest
    • Space Challenge

      Space Challenge
    user

    We have a be nice policy.
    Please be positive and constructive.

    Tips

    Questions

    3 Comments

    What model sound sensor are you using?

    1 reply

    I used a old model.

    Now, following site sells new model.

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

    That's a fun setup :)