Introduction: How to Turn ON AC Light and Fan by Clap Using Arduino and Sound Sensor

How to make a clap switch?? It's really easy to make AC appliances work just by snap or clap, be careful when you are using AC appliances , if you are novice please don't try this without understanding some basic stuff about electronics.

Step 1: Components Need and How to Connect the Components.

Arduino Uno

Sound sensor (digital output)

Relay Module

This video I made for double clap switch but both the hardware connections are same.

Note: Make sure you are connecting the sound sensor and relay according the Program.

Step 2: Arduino Program

int Torelay = 8; // signal to drive relay

int soundsensor = 7; // input from sound sensor

boolean state = false;

void setup()

{

pinMode(Torelay, OUTPUT);

pinMode(soundsensor, INPUT);

}

void loop(){

if (digitalRead(soundsensor) == LOW)

{

delay(100);

state = !state;

digitalWrite(Torelay, state);

}

}

______________________________________________________________________________________________

copy the program and transfer the program to your arduino.

Step 3: Working of Clap Switch.

If you are looking for a dual clap switch take a look in this blog : http://www.labviewarduino.in/2015/01/dual-clap-switch-clap-clap-on-clap-clap.html

Comments

author
KonradK8 made it! (author)2016-12-15

Only one "click" sound need to on or off relay :)

IMG_20161215_202356.jpgIMG_20161215_202413.jpg
author
asnah made it! (author)2015-03-15

what type of relay?

About This Instructable

16,127views

49favorites

License:

Bio: I make hobbyist stuffs and play with electronics follow me to know more https://www.facebook.com/arduinolabviewsolidworks https://twitter.com/learnrobotix
More by Magesh Jayakumar:Quick Start to Nodemcu (ESP8266) on Arduino IDECourse on MIT App Inventor and ArduinoHat for the Party
Add instructable to: