Picture of How to make a Clap-Clap on / Clap-Clap Off switch circuit!
Hi all!
This instructable not only gives the reader the information needed to create a clap-clap on/clap clap off switching circuit, but the logic used to make a hardware-only clap-on, clap off circuit.  More information on a hardware-only version can be found in the final section of this instructable.

This circuit employs some very simple and cheap circuitry, and a simple program. It is relatively easy to make a hardware only clap on/off circuit, but I wanted to create a circuit that required two claps to switch on, and two claps to switch off.  The claps must be in quick succession, as seen in the video below, or else it does not work, which is the entire point of the circuit =)  I will go into detail about the circuitry, and the program.  I will also do my very best to answer any questions you guys may have.  This device can be thrown together in a single evening.

The software works like this:
1) The software waits for an initial loud noise, then starts a countdown sequence.
2) If the device detects another loud noise within about 250 milliseconds, then the relay will toggle on.  If the timer runs out of time without detecting another loud noise, the program resets.
3) Once two claps have been detected, and the relay toggles on.  The software then starts the same sequence over again, only waiting to toggle the relay off. 
4) Once the relay toggles off again after detecting two claps in succession, the program resets back to the original state.

Since the PIC10F222 has a limited instruction set, I had to add in some extra lines of code.  I would have used the PIX18F1220, but that would have been over-kill.  Ah, but how I miss the BTF (Bit Toggle) instruction =)
1-40 of 61Next »
hey guys I need some help
my led goes automatically of after 5-6 seconds......how to fix it????
plzz reply
HCN472 months ago

Hello EngineeringShock!
Loved the detailed explanation with all the steps and schematics
Is it possible to make a HARDWARE ONLY triple clap on/triple clap off circuit based on this one? If so, how?
Thank you :)

Gabrielle14F3 months ago

i cant understand the complete schematic in step 6 .. anybody can explain .. ? thanks

ohoilett4 months ago

Nice Instructable. How close are you to the microphone when you do this?

ivver2 years ago
do you have some scheme to connect it on 230V (or 110V for America) , or you can do it with that circuit then just connect it to some relay which will work as switch?
GabryDX ivver4 months ago

Have you found an answer to your question? Because I'm going to use a 230V instead of a 9V and I'm wondering if I have to change something...

ivver GabryDX4 months ago

Yes, you can connect it to 230V with no problem, but under condition that you have 5V power supply for your circuit and relay ( if you're using the one which works on 5V) , on relays you can attach up to 380V(I think they are rated to this voltage)

romainhuon5146 months ago

can you please send me the hex file? I'm lost with asm compilation...

I really don't understand how to compile it. It will be awsome if you could send me the hex file



goldenshuttle10 months ago

great post. Another alternative if someone does not want to program and code ; we can use a counter like CD4017 which counts the claps from LM324 output, and you can easily set 2 or 3 or even 4 claps on or off.

U made one ?
Warhead_699 months ago

good day all ..

thanks a lot for the great work, but I only have one question; what is the use of

100k Ohm Multi-Turn Potentiometer ?

thanks a lot and will be waiting for your answer :D

i want to use my arduino uno as microcontroller because i havnt worked on PIC10F222..

so, can I ?

This is a simple one clap switch circuit using 555 Timer


I hope it will help you...

Clap Switch Circuit Electronic Project Using 555 Timer and BC547 Transistor.png

Thanks Bro

EngineeringShock (author)  vinesh.saini.5211 months ago

I just made this:


I hope that you find it helpful!

jhunmar1001 year ago

Seems that the code up there is not working Pat.

Assembler Code build failed

Can u make a video of compiling the code and share it to us Pat?

martinibb1 year ago
Hello! I made the circuit but I have a question. What pins of 10f222 I have to use to programming it; I don't know very well the programming stage of circuits. Thank you!
EngineeringShock (author) 1 year ago
Sorry for taking so long to get back to this, guys. I don't have the hex file available. Just the code posted in the instructable =(
Sorry! =(
syedj942 years ago
Will it turn off by itself? If yes, how could I keep it from turning off by itself?
abehambino2 years ago
Hello! I'm new to electronics and was looking to make something like the clapper but that responds to other sounds. Does anyone know how to make one?
markee23 years ago
Nice instructables, but the project needs some engineering background i guess , or needs higher level of intellect in electrical or electronics, where ordinary hobbyist like me cant understand . 
As what i understand, this clap switch can detect false triggering from claps where it protects your circuit from turning on and off due to unnecessary sounds or unintended sounds or claps.
Very nice clap circuit actually but needs some programming.

I have a circuit here from my friend and very good for beginners like me, i guess. just see the diagram below if you are interested.  If you are interested only.
copied from: http://www.simple-electronics.com/2010/11/clap-activated-relay-or-switch-220v.html

220V clap switch.png
MROHM markee23 years ago
Isn't Patrick's Battery Operated circuit More Safer since He's Using A 9 Volt Battery???? Your Friend's Circuit uses 220/120 Vac which I believe is a little Dangerous for a Beginner!!! Until you get a little Experience in Electronics I would Suggest You stay with 9 Volts!!! If you still want to Dabble with Line Powered Projects get yourself a Variac/Isolation Transformer So that You can Test Your Line Powered circuit at lower ac voltage Levels,,,safety First!!!! A Variac is a Variable Ac Voltage Transformer while a Isolation Transformer Can Prevent Accidental Shocks If By Chance You Touch a Metal Chassis(Especially in Old Tube radios) It scares me half to DEATH why there are Instructables that have plans to restore tube radios WITHOUT the Use of a Variac/isolation tranformer. Remember 120/220 Vac will respect You if You respect it!!!
ivver MROHM2 years ago
True, but markee2's have more possibilities to use it in practical sense. Ofcourse you have to know how to protect your self and circuit to make something like that with some level of protection, otherwise you are just like bookie.
pdnashe2 years ago
would be glad if you send me the pic program for the circuit,email me at pdnashe@gmail.com
danm_daniel2 years ago
faizikhan2 years ago
Sir please Teelll mee The Apllication for this clap detector....???? please reply here fast......
sekkei2 years ago
I did it without software, using a 555 timer as a monostable multivibrator and a JK flip-flop. BUT I have a problem.
The out of the comparator is a VOLTAGE signal, and the 555 timer is activated with GROUND..... how am I supposed to connect this 2 circuits???? =S

entegrel sekkei2 years ago
you need to switch the input to the lm324, between the voltage from the divider and the signal comming from the mic. (This is the comparation stage of the LM324, not the amplification stage)
May be this links can help you a little bit
entegrel2 years ago
I did it with a different uController, thanks for your post, it helps me with the electret mic.
Wickedweed3 years ago
Hi. Just need to check...is there a missing resistor to the right of the dc blocking cap that connected to 5v since this is a single rail supply?
dbuot633 years ago
hi this project is somewhat similar to my project by i am using different microcontroller...is it ok if i ask for the codes??? please email me at dbuot63@yahoo.com.
hi im currently going to LTI and i want to do this for my final project. the only problem is our school can only program 8251 microcontrollers or chips like that. is there a chip that is equivalent to the one you used that i could get instead? please email me at dmfbaseball92@yahoo.com.

Thank you.
haske3 years ago
Hello, I really like your circuit and code, but could you please tell me where in code can I increase the time interval for detecting second clap? I would like about 1s interval. Thanks
krrran0003 years ago
I am Karan Shrestha And I wnt to build it but I dont know how to use the software. I m reading in class 11. Please help me. My email is krrran000@gmail.com or brokenheart418@gmail.com
Yadi7863 years ago
Hi Patrick

My name is Riyad, I am currently building a clap switch circuit that I found on the internet for University but it is a single clap switch and I would like to change it to a double clap the hardware way but I don't know hoe to do this. Can you help me please? I don't have much time left as it is due 3days time. My email is riyad.abrahams@gmail.com if you are able to email me I can show you what circuit I am using.

Thanks a Million
tt44553 years ago
do you have the code for 16f628a
leandro00124 years ago
Where are you using the LM78L05 Mini 5v Regulator?

Can i do the circuit without this component?

I like the circuit you made. It is simple and very understandable.
EngineeringShock (author)  leandro00124 years ago
If you look at the upper right hand side of the board, you will see a transistor and the regulator. They have the same package.
Thanks, a few days ago I did the circuit and it worked great! Thanks for all your help.
Sorry, I got it, you are using this in the power supply.
Anyways, why using the LM78L05 instead of using a resistor to resist 9v into 5v?

Can I do the circuit without this component ? Because I live in Argentina and it is hard to get this kind of things here.

Thanks for all, and sorry for my bad english.
1-40 of 61Next »