Clap Switch Using Sound Sensor

Magic with claps. Switch on light using clap.

Jun 4, 2018

•

26095 views

•

3 respects

Components and supplies

1

Arduino UNO

1

SparkFun Audio-Sound Breakout - WTV020SD

Apps and platforms

1

Arduino IDE

Project description

Code

Clap Switch

arduino

Downloadable files

Clap Switch

Clap Switch

Clap Switch

Clap Switch

Documentation

Clap Switch

Clap Switch

Clap Switch

Clap Switch

Comments

Only logged in users can leave comments

Anonymous user

2 years ago

I wrote the code to turn on and off the light with claps. // Prepared by Jojo John Periapuram // Buy a good microphone board for clap switch purpose // You may turn off the Serial Print // jojojohnp@gmail.com int analog = A0; //Input int digital1 = 5; //Outputs int analogValue; int digital_sensor; void setup() { pinMode(digital1, OUTPUT); Serial.begin(19200); } void loop() { digital_sensor = digitalRead(digital1); analogValue = (analogRead(analog)); if(digital_sensor==0 && analogValue>500){ digitalWrite(digital1, HIGH); Serial.print("Value1 ON "); Serial.println(analogValue); delay(2000); } if (digital_sensor==1 && analogValue>500){ digitalWrite(digital1, LOW); Serial.print("Value1 OFF "); Serial.println(analogValue); delay(2000); } }

Anonymous user

2 years ago

Nice Article Sir I really Appriciate Your Work Good Job 👌👌 <a href="https://punjabistatus.net/">Visit Here For Punjabi Status</a>

Anonymous user

4 years ago

I wrote the code to turn on and off the light with claps. // Prepared by Jojo John Periapuram // Buy a good microphone board for clap switch purpose // You may turn off the Serial Print // jojojohnp@gmail.com int analog = A0; //Input int digital1 = 5; //Outputs int analogValue; int digital_sensor; void setup() { pinMode(digital1, OUTPUT); Serial.begin(19200); } void loop() { digital_sensor = digitalRead(digital1); analogValue = (analogRead(analog)); if(digital_sensor==0 && analogValue>500){ digitalWrite(digital1, HIGH); Serial.print("Value1 ON "); Serial.println(analogValue); delay(2000); } if (digital_sensor==1 && analogValue>500){ digitalWrite(digital1, LOW); Serial.print("Value1 OFF "); Serial.println(analogValue); delay(2000); } }

Anonymous user

4 years ago

Nice Article Sir I really Appriciate Your Work Good Job 👌👌 <a href="https://punjabistatus.net/">Visit Here For Punjabi Status</a>

Anonymous user

5 years ago

Hi, quick question. I have been figuring out how to apply this in the real world, where i would like to use this clapper for my room ceiling lights which are controlled by wall mounted switch. The wirings are the standard built-in wall wirings. Can you advise? Thanks

Anonymous user

2 years ago

To do this with live wires you would need to use a relay instead of the led and then connect the wires to the relays ''COM'' and ''NO'' ports