Sound Sensor + Arduino + Clap(ON/OFF)

1,431

11

3

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);

}

}

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Be the First to Share

    Recommendations

    • Made with Math Contest

      Made with Math Contest
    • Multi-Discipline Contest

      Multi-Discipline Contest
    • Robotics Contest

      Robotics Contest

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