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

}

}

Comments

author
baudot (author)2017-01-09

What model sound sensor are you using?

author
DAEHWANL (author)baudot2017-01-10

I used a old model.

Now, following site sells new model.

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

author
Swansong (author)2017-01-09

That's a fun setup :)