Picture of USB powered clapper switch - Extremely little HW Required!
Hi all!
Thanks for having a look at my instructable!  If you have by chance seen my original clap-clap on/clap clap off circuit instructable.  This clapper circuit is very different than my original, in that it requires absolutely no amplification of the audio signal being sampled by the on-board electret microphone! As well, the circuitry is powered exclusively by the USB port on my PC!

For all of you who find this instructable interesting, I would apprecaite your vote in the USB contest.  As well, please rate this instructable.  If you found it to be good, I want to know!  If you found it needed work, I want to know!  Thank you for your consideration!
I'll be creating a kit for this instructable within the next few weeks, but without the relay. It will be available here:
Or here:

Here are some of the key features:
* By simply turning your computer on, you can clap-clap on anything powered by AC that is within the limit of the 5v relay you are using (A desk lamp for example - Seen in the below video)


* No amplifier circuitry required.  The audio is sampled through the use of an ADC (Analog to Digital Converter), located on the MCU.

* Powered SAFELY by the USB port on your PC or laptop.

jukees2 years ago
hello do you think that it's possible to use pic12f675 instead?

also wanna know if i can use the same code but change the pins

hamouz7183 years ago
I managed to write your code in C so the code can work with most MCUs, can u tell me how long are the delays in your asm code?


do you still have the c code?

is your c code working??
jhunmar1001 year ago

Hey Pat About the code do you still have the .hex file format or is it possible to put it in 16F628A PIC? or There are changes in the code so that it can compile to 16F628A?

kkaranam1 year ago
hey a very good and simple tutorial and great explanation :) i just nw saw your kit in the ebay store but i already purchased the components except pic10f222 MCU and i would like to ask you how to program that MCU? is it easy to program??? and thanks in advance. and i just wanted to ask you if u can ship only the programmed MCU to INDIA??? thanks again. :)
GlennFTW2 years ago
Hi. I have a problem when transferring the hexfile into my pic10f220 :/
It's says that the OSCCAL value in invalid, and i can't "Auto regenerate" it.
So I wondering if you know the OSCCAL value so I can set I manually?
(Error: 0x000000)
Thanks! :)
nodoubtman2 years ago
It is possible to do it with pic12f683 : http://embedded-lab.com/blog/?p=6439

thank you!
hamouz7183 years ago
Dude this is amazing!
I understood the most of the steps except for the code, could u plz upload a flowchart of the code if possible?
ssanthosh3 years ago
Can u please E-mail me the diagram of this clap switch that works without connecting to the usb port
My email id is sanjvwin10@gmail.com
ssanthosh3 years ago
can i connect the ac power directly without using a power bar?
cjlopez2134 years ago
This is exactly what I was looking for! However, I am a bit confused, do the claps only turn on one specific object? Or can they turn on any object connected to the power strip?

I'll wait until the kit comes out to make things easier, thank again for the instructable!
EngineeringShock (author)  cjlopez2133 years ago
Kit is on the way! Custom PCB and all =) By Christmas. The PCBs have been manufactured, and are on the way to my home. Check out engineerigshock.com for all of our new kits =)
EngineeringShock (author)  cjlopez2134 years ago
Hi there
Yes, anything on the power bar can be turned on. You have to keep in mind the power rating of the Relay, as the leads can only handle so much power. These relays can handle a ton of current, but I wouldn't use it to power your microwave =) Thanks for the comment!
ggallo3 years ago
We want the kit!
EngineeringShock (author)  ggallo3 years ago
Kit is on the way! Custom PCB and all =) By Christmas. The PCBs have been manufactured, and are on the way to my home. Check out engineerigshock.com for all of our new kits =)
_Ludo3 years ago

I had to adapt the detection level to 5D = 0000 0101B because the relay was going to ON and OFF in a loop. I guess this is due to the very low level of detection and to wireless like Wifi or alike.

Thanks for this nice project, I'll maybe amplify the mic with a single transistor.
EngineeringShock (author)  _Ludo3 years ago
I'm wondering why you had to change anything. You shouldn't need to amplify the mic signal, as the ADC should pick up the smallest sounds. However, changing the value in the detection register can easily change your sensitivity. Did you use the same components?

So glad someone re-created this. Do you have a video?

Thanks again
airabaxter3 years ago
I have a small knowledge of basic electronics and it ends on repairing TVs and radios only. This is a nice tutorial. Thank you for sharing it..

sams club credit card
leandro00124 years ago
This is great. I have tried the clap clap on/ off circuit you did and works nice. But this is even better because you don't need any amplifier. I think I could do it with a PIC 12f629. Nice job!.
PS: Is it possible to use a triac instead of a relay switch?
EngineeringShock (author)  leandro00124 years ago
Hi there
Thank you for the comment =) As long as the Triac will turn on completely using a 5v signal, and is properly heat sinked, then I think it'd be a great idea =)
Let me know how it turns out! If you have time, please rate my instructable.
Thanks again for the comment. If you end up making a video, please send it my way!

Great job! I have been working on one of theese but I was worried about the amplifier circuit...BUT NOT NOW!!!
Hi there
Thanks for the comment =) If you still want to incorporate an amplifier, check my channel out. I hvae a another clap clap circuit that incorporates a simple active amplifier (LM324). Thanks again take taking an interest. Please rate my instructable if you have the time =)

saraandy4 years ago
This is the first time I have visited your site and I am amazed at the amount, the value and the clarity of the information you have provided. This was beautiful and very thought-provoking.
HP LaserJet P1102w
EngineeringShock (author)  saraandy4 years ago
Thank you very much =)
Rolcrz4 years ago
I absolutely love this project and would like to try it out myself. However, just one question, is there a less expensive programming kit that we could use to program the pic10f222? I'm asking because from what I've searched the kits are extremely expensive, specially for something that i'll use maybe once or twice =/ thanks in advance! Great instructable btw =)
EngineeringShock (author)  Rolcrz4 years ago
Hi there
Thanks for the comment =) In the coming week, I'll be placing a kit in my ebay store for this. It will include the programmed PIC, the microphone, and all of the other passive components, minus the relay and relay driver. If you are still interested in a week, and you don't see the kit in my store, let me know =)

You know those dirt cheap tiny USB wall chargers? You should build that directly into the AC line (before the relay so it's always on) to power your 5V circuitry.
EngineeringShock (author)  frank260801154 years ago
Good call.
However, I wanted to have this interfaced with my PC. As well, the dollar store power bars are hard to modify internally. The bars are connected in parallel through metal bars, not wires, which means you have to but the bars internally. I've tried, and it can get messy. Good call though. I see what you're getting at =)