Clap Switch

31,956

708

40

Hello Friends,

Here is a clap switch. You can turn any home appliance on/off with a clap. I personally designed the circuit for better accuracy and customized filtration. You can see the working of the switch in the video attached.

I hope you will enjoy building this project.

Step 1: Circuit Explanation

The signal processing done in the circuit is explained in the image.


There are 4 stages of the signal procesing:

  1. In first step, the input from the mic is anplified.
  2. In second step the comparator is used to put a threshold value on the amplified value, to be considered as a clap or not.
  3. In third step the pulse from the comparator is converted into a longer pulse, this is helpful to reduce the noise in the clap.
  4. In fourth step, the signal is first used to turn on the LED, and next time it turn the LED off. This is done using a decade counter and resetting the counter on the Q2. Q0 is left blank, Q1 is the led/relay attached to.

Q0,Q1,Q2 are the outputs of the decade counters. if you see the datasheet of 4017. First time clock is given to 4017, it gives output on Q0, on next clock, output shifts to Q1, and so on.

POT1 = used for the voltage for the microphone

POT2 = used for initial biasing for the transistor

POT3 = used to set the reference voltage for the comparator

Step 2: Building the Circuit

Things you will need to build the circuit :

  1. potentiometer - 100K,20kX2
  2. LEDs X3
  3. BC547 X2
  4. 12v RElay
  5. diode
  6. resistors 160k, 470X3, 1k, 22k.
  7. Condenser MIC
  8. LM358
  9. NE555
  10. CD4017
  11. Switch
  12. 12v Adapter/batter
  13. Prefboard/dotted PCB
  14. IC base - 2x8pin, 1x16pin
  15. 100nF capacitor (104)
  16. 10uF capacitor (any voltage)

You can build the PCB in many ways :

The best way is the one in which i made it. You dont need to spend money or time on preparing designs and PCB print for the circuit.,

or you can build it on breadboard,

or you can design your own PCB and solder the components on it.

Happy soldering :)

I hope you will enjoy building the project, any suggestions or questions are most welcomed.

Step 3: Calibration of the Potentiometers

To calibrate the device, the first step would be that you should use lowest voltage LED available to you, in the place of LED1. This is because the low voltage LEDs glow at lower voltage consumption and you will be easily able to identify the glow when you make a clap sound near the mic. (i dont remember my blue LED's voltage consumption but its very low, may be lower than even 1 volt, you can try using small LEDs).

Second thing you need to keep in mind is that you need to set POT2 such that initially the LED1 (low voltage LED) must be off. It must be fine calibration. Its Not hard to do so. The thing is that initially we need to give nearly 0.7 volts at the base of the first transistor. and we can do it by adjusting POT2. POT1 is easy to calibrate. First set the POT2 such that LED1 is off, then make a clap near the mic and notice the glow of the LED1. NOW, Change the POT1 value, set the POT2 again such that LED1 is off, then make a clap and notice the glow of LED1. you will notice the difference in the glow of LED1. you have to set the POT1 and POT2 such that the glow is highest in lowest sound. (POT1 must be greater than 5 kilo ohms). Once you are done with the glowing of LED1, now you should go to LED2 with POT3. POT3 sets the reference voltage to be compared to the voltage after amplification from the transistor (LED1). here you can set the sensitivity of the device, that on how much volume should the switch work. the output can be seen on LED2. you will have better idea when you will adjust it a couple of times. one thing is that you should never calibrate the pots all at the same time, i.e. you should first change the value of one portion of the circuit and notice the change, then change the other part's calibration.

4 People Made This Project!

Recommendations

  • 1 Hour Challenge

    1 Hour Challenge
  • Fandom Contest

    Fandom Contest
  • Colors of the Rainbow Contest

    Colors of the Rainbow Contest

40 Discussions

0
None
MatthewO95

Question 3 months ago

Hello,
I trying to make this clap switch, but can't quite seem to make it work. I've so far been able to get all the lights to light up at once initially, but during my attempt to calibrate LED 1, when I clap, LED 1 does a short flicker, which I can assume isn't supposed to happen. No matter how much I calibrate it, that is the most I can get out. Does anyone by chance know what might be causing this issue? Furthermore, how do I know when I'm ready to do calibrating rather than needing to fix a mistake? I know this comment is being made 2 years after the previous comment, but if possible, I would really like some help. Attached is an image of my current work on the clap switch, in a non-calibrated state. Thank you for reading.

IMG_2619.JPG
2 answers
1
None
SamartistMatthewO95

Answer 3 months ago

Today is your lucky day MatthewO95... how are you?
First thing is that i dont exactly remember how i calibrated the circuit, i had to read the article once again to have good idea about it... Actually it will help me if you upload a working video of your circuit instead of the image... anyways, see what i have got to say to you...
1. "when I clap, LED 1 does a short flicker, which I can assume isn't supposed to happen.", its good that you have a flicker at LED1, this means that your circuit works fine till LED1. Now next thing is caliberating LED2, which is very easy, you just tune it till the point where is stops glowing.... It should be off in ideal situation, but it should be at the peak to glow... For example, if the LED2 glows in 0' - 90' degree of the potentiometer (one quarter of a circle), and its off in 91' - 180' degree(next quarter), then you should tune it to 91' degree... i.e. closest point when the LED is off...
2. i think you should remove the relay, it doesnt help if the clap detection anyway, you can use it later when you want to on or off any appliance..
3. its better to make this circuit IC by IC from left to right, i.e. first make the transistor part on the board, then caliberate it, then add the LM358, then caliberate it and so on...

0
None
MatthewO95Samartist

Reply 3 months ago

Hello,
I'm doing fine. Thank you for responding back. I did some of your suggestions, and while LED 1 is dimmer than the other lights, I got the switch to work. Thank you so much for helping me out, despite it being 2 years since you made this. I hope you have a good day.

0
None
jwbrooks0

2 years ago

The original clapper design was a 2-clap system, and this appears to be a single clapper design. Is there an advantage of a 1-clap to 2-clap design?

1 reply
0
None
Samartistjwbrooks0

Reply 3 months ago

you can easily convert this circuit into two clapper design by changing the output and resets of the last IC 4017

0
None
Agustinus bruin

2 years ago

please help me. i have problem. ic ne555 cant give clock. how to give clock with ic 555. thank you

1 reply
0
None
SamartistAgustinus bruin

Reply 2 years ago

ok, what are you trying to do? How did you get to know that 555 is not generating the signal? Show me pics of your circuit...

0
None
Jaseelt6

2 years ago

can u plz give circuit diagram???

0
None
SamartistĐứcS

Reply 3 years ago

sorry, i cant give it to you...

haha its already in the instructable :D

0
None
SamartistNguyễnQ12

Reply 3 years ago

sorry about that,

Q0,Q1,Q2 are the outputs of the decade counters. if you see the datasheet of 4017. First time clock is given to 4017, it gives output on Q0, on next clock, output shifts to Q1, and so on.

0
None
rajesh dhusu

3 years ago

can anyone give me the circuit diagram

0
None
anooooos

3 years ago

Nic to met yuo

0
None
dimasgomez

3 years ago

I tried it yesterday, bought everything in the list and realized that the capacitors were not listed. I was very lucky, I had them for another circuit. Im a beginner (or a repeatedly starter), so took a lot of time to figure out every polarity. Internet is a bliss. First time I studied elet. was in 2003. Unfortunately, it didn't work. Not yet, at least. I think it might be the mic.

145642325335014338966.jpg
2 replies
0
None
Samartistdimasgomez

Reply 3 years ago

sorry for replying late :

To calibrate the device, the first step would be that you should use lowest voltage LED available to you, in the place of LED1. This is because the low voltage LEDs glow at lower voltage consumption and you will be easily able to identify the glow when you make a clap sound near the mic. (i dont remember my blue LED's voltage consumption but its very low, may be lower than even 1 volt, you can try using small LEDs).

Second thing you need to keep in mind is that you need to set POT2 such that initially the LED1 (low voltage LED) must be off. It must be fine calibration. Its Not hard to do so. The thing is that initially we need to give nearly 0.7 volts at the base of the first transistor. and we can do it by adjusting POT2.

POT1 is easy to calibrate. First set the POT2 such that LED1 is off, then make a clap near the mic and notice the glow of the LED1. NOW, Change the POT1 value, set the POT2 again such that LED1 is off, then make a clap and notice the glow of LED1. you will notice the difference in the glow of LED1. you have to set the POT1 and POT2 such that the glow is highest in lowest sound. (POT1 must be greater than 5 kilo ohms).

Once you are done with the glowing of LED1, now you should go to LED2 with POT3. POT3 sets the reference voltage to be compared to the voltage after amplification from the transistor (LED1). here you can set the sensitivity of the device, that on how much volume should the switch work. the output can be seen on LED2. you will have better idea when you will adjust it a couple of times.

one thing is that you should never calibrate the pots all at the same time, i.e. you should first change the value of one portion of the circuit and notice the change, then change the other part's calibration.

feel free to ask about any doubts. i may reply late, but i am happy to help.

0
None
dimasgomezSamartist

Reply 3 years ago

Thank you very much for all your help. Your instructions help me a lot. After two days, I realized the only thing that could be wrong would be the mike. Since it wasn't really responding at all, I replaced it, and then just needed to follow the POT steps. I would humbly recommend that you add them as a third step in the instructable. I will be adding pictures and a litte "made it" movie. Thank you once again. Best regards.

0
None
Huntsman064

3 years ago

I may be 9, but that I think is cool! also I would be able to make that

1 reply
0
None
SamartistHuntsman064

Reply 3 years ago

just 'making' this circuit is not enough, i think you must make small circuits first, which are very basic circuits...

you should make the following very-simple-circuits first, and understand those workings and then it will be very easy for you to make circuits like clap switch...
1 - LDR + comparator circuit = darkness detector
2 - 555 led blink
3 - 555 +4017 chaser circuit
4 - darkness detector using transistors
5 - 555 as monostable

as a beginner you should build circuits on breadboard : enjoy making circuits

0
None
tijoecon

3 years ago

I noticed the 555 IC has two pin7 i think the one connected to 12V should be pin4 am i correct?