loading

in this tutorial i will be showing you how to make an Arduino clap switch

let's get started!

All you have to do is-

clap once to turn the LED on

and

clap again to turn the LED off

Step 1: ORDER YOUR COMPONENTS:

the components required for this build are:

1xArduino(Any arduino will work)

1x220 ohm resistor

1xLED(Any colour)

1xmicrophone amplifier circuit (variable)

1xBreadboard

some jumper wires or single strand wires

that's all the components!
Now let's move to the next step!

Step 2: CONNECTIONS:

sorry guys, I didn't had the SCHEMATIC so i will tell you all the connections,

here are the connections:

Connect A0 pin of the microphone Amplifier to digital pin 12

Connect GND pin of the microphone amplifier to the GND pin of the Arduino nano

Connect VCC pin of the microphone amplifier to VCC pin of the Arduino nano

Connect one end of the 220 ohm resistor to GND pin of the arduino nano

Connect the other end of the 220 ohm resistor to the cathode(smaller leg of the LED) of the LED

Connect the anode(bigger leg of the LED) to digital pin 12 of the Arduino nano

THAT'S ALL THE CONNECTIONS!

Step 3: THE CODE:

pinMode (micpin, INPUT);

pinMode (ledpin, OUTPUT);

}

void loop() {

if (digitalRead (micpin)==HIGH)

{ if (digitalRead(ledpin)==LOW) { digitalWrite (ledpin, HIGH);} else digitalWrite(ledpin,LOW);

delay(1000);

}

}

Step 4: SUCCESS!

After some small connections and small code we finally get success!

all you have to do is-

clap once the LED turns on

clap again the LED turns off

<p>sir can i connect tube lights into it</p>
No, you will need a 240V. relay
<p>No, you will need a relay to do that. That is the subject for my another tutorial. Wait for my next tutorial(the better version of clap switch).</p>
<p>i know but can u plzz sent me the circuit diagram and the code plzzzzzzzzz.My e mail is lokanathmishra12@outlook.com</p>
<p>I'm currently working on that project.</p><p> I will send you once I'm done;)</p>
<p>can you plzzz give me the list of requirments.i am already having arduino uno r3,12v 4 channel relay,some jumper wires,and adaptor.anything else required???????</p><p>THANK YOU</p>

About This Instructable

3,090views

46favorites

License:

Bio: I love electronics and Arduino.Stay creative!
More by The creator sid :Arduino(nano) Clap Switch How to make a 0-9 counter using an Arduino Nano How to Make a Dark Sensor 
Add instructable to: