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 =)
Remove these ads by
Signing UpStep 1PART LIST:
I'll start of by giving you guys a part list. The box and the screws are not necessary for this project, but I'll add them to the list.
PART LIST:
1x Prototyping board (Roughly 1" by 1") or bread board.
1x 9v Connector
1x LM324 Quad Op-Amp IC
1x LM78L05 Mini 5v Regulator
1x PIC10F222 Micro controller
1x Electret microphone
1x 5v Relay SPDT or SPST
1x 2N2222 NPN Transistor
2x 0.1uF Ceramic capacitors
1x 1N4001 Diode
1x 100k Ohm Multi-Turn Potentiometer
1x 100k Ohm 1/4W resistor
2x 10k Ohm 1/4W resistor
1x 3k Ohm 1/4W resistor
1x 7k Ohm 1/4W resistor
1x 1k Ohm 1/4W resistor
1x Project Box
| « Previous Step | Download PDFView All Steps | Next Step » |















































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
Riyad
Cya!
marC:)
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
Can i do the circuit without this component?
I like the circuit you made. It is simple and very understandable.
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.
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.
Is it okay if I use a 5.7 volts power supply, and skip the voltage regulator? Or is it too much.
Also, how sensitive is this device? Will it work fine on a few meters range indoors without the need to clap like a mad man?
Thanks! I'd not change 5.7v. I'd use the regulator. However, a 7805 reguires about 6.5v-7v minimum to regulate properly to 5v.
I just completed a better version of this circuit that does not require an amplifier.
The sensitivity of this circuit is cased on your amplifiers. You can adjust them for your required sensitivity.
I don't think you'd see much at the secondary end of the coupling capacitor if you placed the microphone between5v and ground, with the coup0ling capacitor connected to the power line as well.
Thanks.
I can not compile the program
thanks
roberto
betoroma@ig.com.br
Nice project!
if it work on AC Volt Input can i light up a CFL bulb in Output?
thanks
my email : nmc6903@yahoo.com.vn
I buy and sell directly from China in bulk, so not very much. The little yellow component on the back is a relay that is capable of turning your AC lights on and off =)
Thanks for the question.
Pat
$20? I have a hobby store, so I have tons of components lying around.
I'm asking this because in Argentina it's very difficult to get the PIC10F222 Micro controller. Do you know any china store with this microchip and worldwide shipping?
Thanks a lot.
PIS10F220 is almost identical.
Thanks
Pat