Find more projects

Clap Switch Circuit

Join the forum discussion on this post

A clap switch circuit is a classic beginner’s project. Equipment can be switched on and off by just clapping your hands. Add a tiny microcontroller and you can easily build-in some more useful features.
The microcontroller in this circuit makes it a simple job to add some useful features that are not seen on other clap switch designs:

Clap Switch circuit diagram

clap switch diagram

– Changeover relay contacts enable the unit to be wired in conjunction with a manual changeover switch so
that manual override of the switched equipment is always possible.
– The unit is only responsive to a specific sequence of sounds i.e., two claps within a defined time window.
– A safety feature masks the input for a given time window if misuse (repeated commands) is detected (useful if children have discovered how it works).
The safety feature and two-clap sequence detector can be built using TTL or CMOS flip-flops but by using a single microcontroller the circuit can be greatly simplified. A mains power supply is included so no additional power source is required.

The Microchip flash PIC12F629 microcontroller is a neat device; the small 8-pin package contains a complete microcontroller including clock generator, reset circuitry, Flash ROM, RAM and EEPROM. Two of the eight pins are used for the supply connections while the remaining six are general-purpose I/O pins. A few of these pins have special function like the comparator inputs. The sound sensitivity of the circuit can be adjusted by programming the comparator threshold level in software.

Maplin Velleman Clap On/Off switch Video

Ready-made clap switch products

velleman-clap-on-off-switchVelleman Clap On/ Off Switch : MK139 – at only $17
Microprocessor controlled!
Electronic kit, assembly required.
Operates your lighting with a simple handclap!

rf-clapperRF Clapper Plus Cl84512 – at $25
Clap Your Hands & Turn Your Appliances On Or Off
Now With RF Technology You Can Also Press A Remote Control Button & Your Lights Will Effortlessly Turn On Or Off.

The circuit diagram in Figure 1 shows that besides the microcontroller there are very few other components. The two-pin electret microphone produces an electrical signal in response to sound pressure waves. Transistor T1 amplifies the signal and preset P1 allows some adjustment of the circuit sensitivity by altering the bias voltage of T1.

Two of the PIC output pins are used to drive a bistable relay via transistors T2 and T3. This type of relay has two energising coils. A short electrical pulse on one of the coils is enough to switch the relay in one direction while a pulse to the other coil will cause the relay to switch back. This type of relay has two main advantages: the relay is latching in both open and close direction so a short pulse is all that is necessary to switch it. Secondly the latching feature ensures that the relay retains its switched state even during a power failure. Changeover relay contacts enable the unit to be wired together with a changeover type manual switch, allowing the equipment to be switched manually if for any reason the clap switch is switched off.

Pins 2 and 7 are used to switch a twocolour LED providing a visual indication of the switched state of the relay. The last output pin of the PIC is not used and is connected to a jumper to allow switching software options.
Clapping relay Software
When the signal level at GP1 goes low (clap detected) the program waits for approximately 200 ms during which time the LED glows red. After this period the LED switches to green and the software samples the input for approximately three seconds. If a second clap is detected during this period, the controller switches the output. After switching, the controller ignores any further clap sounds for approximately 10 s and the LED lights red. The output state is stored in EEPROM so that if a power failure occurs the software will switch the correct relay coil when power is re-established.

A safety feature counts each switching event on an internal counter, which is decremented slowly in software. Should this counter exceed a threshold level, the circuit will ignore any input signals for approximately one minute and the LED blinks red. This will ensure that the circuit does not respond to an extended burst of noise (e.g., applause).

Clap switch PCB

clap relay pcb
The PCB layout shown in Figure 2 accommodates all components apart from the electret microphone. This is attached to the board at the MIC +/– connections with a length of shielded audio lead (keep the wire length to less than around 10 cm).

Mounting the components onto the PCB should be quite straightforward. Start by fitting the single wire bridge next to rectifier B1. Ensure that all polarised components (diodes, LEDs, capacitors and the IC) are fitted the correct way round. The LED leads should be trimmed so that when it is soldered to the board it protrudes through a hole in the lid when the case is assembled; alternatively use a translucent enclosure.

Once all components have been fitted and all solder connections have been inspected the PCB can be fitted into an insulated enclosure. The mains input lead will require some form of strain relief. Be aware that some tracks carry lethal voltages. All appropriate safety guidelines must therefore be adhered to. A small hole can be made in the lid directly over preset P1 if it is necessary to adjust the sensitivity of the circuitwithout dismantling the unit. Lastly, don’t forget to add perforations in the case so that sound waves can reach the microphone capsule.

Clap switch COMPONENTS LIST:
Resistors:
R1,R6,R7 = 4kΩ7
R2 = 150kΩ
R3 = 22kΩ
R4 = 10kΩ
R5 = 150Ω
P1 = 100kΩ preset H
Capacitors:
C1 = 220μF 25V radial
C2 = 100nF
C3 = 1μF 16V
Semiconductors:
B1 = B80C1500 (round case, 80V piv, 1.5A)
D1,D2 = 1N4148
D3 = bicolour LED (red/green)
IC1 = 78L05
IC2 = PIC12F629CP, programmed
T1,T2,T3 = BC238 or BC547
Miscellaneous:
JP1 = 2-way pinheader with jumper
K1 = 2-way PCB terminal block, lead pitch 7.5mm
K2 = 3- way PCB terminal block, lead pitch 7.5mm
MIC1 = 2-terminal electret microphone capsule
Re1 = bistable relay, 2 x changeover (e.g., Schrack RT314F12)
Tr1 = mains transformer 1 x 6V, min. 2VA, short-circuit proof (e.g., Marschner VN30.15/10522 or Era 030-7340.0T; Conrad Electronics # 506141)

Find more projects


94 Responses to “Clap Switch Circuit”

  1. vlad says:

    Is not working. On collector in T1 I seen with an oscilloscope that the mic is working, the signal is amplified and is reaching IC pin 6. The LED between 2 and 7 is not active, 0 V on pin 7. Ive made a bridge from +5V to pin 3 and 5 to see if my REL work and was fine. Please give me some clues about this problem.
    Thank You.

  2. vlad says:

    i also try with a wire from T1 collector to groung and still nothing

  3. electrolover says:

    I am so sorry, but the circuits schematics on this site are not tested, they are informative.

  4. shakti parmar says:

    resacted sir,
    pls send me mobile jammer circuit diagram and pcb layout at my mail add.

  5. samson says:

    pls send me a inverter circuit diagram

  6. pramod says:

    Sir where is the program for 12f629

  7. Thomas says:

    Can you please send me the hex file or the programm for the pic.
    thankfully,
    Thomas

  8. Hrutuja Shankar Limbhore says:

    Respected sir,
    I want detail information about VK123 claping switch to connect circuit.
    Hrutuja

  9. Omar says:

    Can you send me the program for the 12F629…. Or can you tell me where can I find it?
    Thank you!

  10. Written by Heena Sangwan says:

    Respected sir,
    Can you also write information on voice switch as i want it for science day to present it in the class…

  11. Greg Fong says:

    If you need a circuit I have a few thousand clap detector circuits on premounted on a 1″ by 1.5″ board. It also has a built in motion detector to disable the circuit when it is in motion. The unit uses a piezo to detect claps. I have the schematic somewhere if anyone is interested.

    • Genadijus says:

      could you please send me link to clap switch schematics you have ?

    • nhel romano says:

      its a big help for me if you could send me the schematic diagram of one of your clap switch, i badly need it for my subject in control system. thank you

    • anna says:

      Could u please mail me a copy of that..

    • deva says:

      plz send me a copy of it… is it tested?

    • ANNA says:

      Sir please mail me the circuit diagram of the clap circuit having builtin motion detector as fast as possible.It’s very urgent please

    • Ching Suarez says:

      Dear Greg,

      I’m working on a science project and I need the microcontroller or microprocessor that I can install in my gadget (is not electrical one), so that when I calp my hands, this gadget can respond or do what it’s supposed to do. Sorry I’m not too clear on my question but essentially I think I need what you posted. Thank you for any assistance you can provide.

      Ching

  12. Surendra says:

    Dear Sirs,
    We are located in Mumbai.We want suppliers of clap switches in India.
    Regards
    Surendra

  13. Greg Fong says:

    I am trying to find the schematic but I can send you a picture of the switch. Could you send me your email?

  14. Greg Fong says:

    I am located in Canada

  15. Kaushik says:

    Respected Sir,
    Please send a circuit diagram of FM Transmitter at my e-mail address.

  16. dvirh says:

    Hello. I’ve seen and designed the circuit before. However now I’m trying to make it responde only to hand calps by designing the right band pass filter. I’m in need of a help to find the right freq. range of the hand calp.

    If anyone knows please post it here.

    Thanks. (:

    • vibha pant says:

      hey…as u said you’ve already made this ckt…can you please help me out in making it…its really importnat….and if you have any files,layouts etc related to this can you please forward it to me….i have to submit my synopsis by 24th feb…
      my id is: vibzpant@gmail.com

  17. parvez says:

    how i proceed the project of clap switch

  18. nagarjuna says:

    sir,i’m nagarjuna i want to prepare a loud speaker with microphone

  19. respected sir, could you please send me the program for the PIC12F629. Thank you.

  20. Leandro says:

    Es posible que me facilites el codigo?
    mi mail es roblesleandro@hotmail.com

  21. jess says:

    any one cant say this layout are tested?

  22. Paras Sharma says:

    Respected Sir,
    Can we use a clap switch in computer also plzzzzzzzzz reply
    as possible

  23. vicky says:

    i think it is not easy becoz a easy circuit also avalable.

  24. KISHAN says:

    THIS IS EASY CIRCUIT.I SHOULD TRY TO MAKE THIS PROJECT.

  25. Ujjwal says:

    hey please anyone send me a clap switch circuit diagram using ic 555 only if it is possible i would be greatly obliged

  26. Leandro says:

    Arme el circuito y ya programe el PIC 629 y arme el Clapper ….me anduvo Barbaro!

  27. venki says:

    hey my friend sherly is trying this project
    she says its difficult
    but
    i say its simple for her knowledge…………………………

  28. Bosla says:

    dear sir, i`m wery intrasted to try this project. Please send me program for the PIC12F629. Thanks in advance.

    • ravi says:

      did anyone sent u the program for pic 12f629?if yes, can u send the program to my mail(ravi131665@gmail.com).i have to show this program for my mini project by October 30.This would be really helpful.thanks in advance

  29. Ajaxs says:

    Hello. I would like to build a circuit that will turn on when it senses a high pitch sound, an alarm, and will saty on until manually reset… Any help/suggestions are greatly appreciated.

    • Ching Suarez says:

      Hey, did you find what you were looking for in your post in 2010? I need exactly what you were looking fornow in 2012.
      Could you kindly let me know where or if you got what you’re looking for. I will appreciate it a lot. I’m from Pa in the US.

  30. wiredu marfo says:

    I want a powerful frequency moderator circuit diagram that can transmit about 1000 kilometres range

  31. Julieta says:

    I’m interested to know if you manufacture these mini circuits with some other specifications. I’really appreciate your response or guide. Thanks.

  32. solo says:

    What is the specific measurement of the PCB???

  33. lee_ann says:

    i wud like to know what can i do to measure sound/frequecy of a hand clap through a mic used in a clap switch.im using pic to control the motion of when to switch on or off the lights as my appliance…

  34. ryan says:

    is the PIC12F629 what you program the clap too?… i want circuit to activate to other sound, any ideas

  35. tani says:

    clap switch is easy..you will need just two transistor..mail me.titanus_666@yahoo.com

  36. gurjant says:

    please! help in making a clap switch i have its pcb ckt bt i m not understand hw 2 place in the ckt

  37. gurjant says:

    sorry hw 2 manufacture a relay in the ckt

  38. henky says:

    please send me programmed for pic12f629cp. its for my project. please. send to punkek_abie@yahho.co.id

  39. henky says:

    can you send me the program for the PIC12F629CP please…
    I need it, for my study…please…

  40. Tom says:

    Hi, What is the black box that is in the video? Also, how would i connect this pcb to a normal light switch, and what power supply would I need to use? Thanks. Please email: thegruffaloman@hotmail.co.uk

  41. DISHANT KUMAR says:

    plz… help me making a clap switch…. i need to submit it by 24 jan… send me files, pics… watever that cn help me… thnks…

    • Ching Suarez says:

      Hey, did you get what you were looking for in your post? If you did, can you share info to me as I need exactly the same thing. Thanks a lot for your help.”Ching from Pennsylvania, US.

  42. reshma says:

    hey can u plz help me in making a clap switch….plzzzz… i need to submit it by 24 feb… send me files,program,… whatever that cn help me… thnkz…

  43. Abdul Rahman says:

    my clap switch is working

    • vibha says:

      hey if you have got all the programs,files ,layout etc…please send me the details i need it urgently…as i have o submit it as my mini project…

    • Patrick says:

      Hello Abdul Rehaman,
      If u have made this circuit, could u tell me what is the time delay on this circuit.

    • Patrick says:

      Hello Abdul rehman,

      Could u pls let me know the details of ur circuit, such as what is the delay time, did u program etc.,

  44. stephin says:

    i am very intrested in making a clap switch.please anybody can give the equipments so that i can make it

  45. Tom says:

    I would also like to make this switch,but my programming knowledge is very basic.Could somebody,please,send me .asm for this project.Thanks

  46. shermaine says:

    can we use a” tammia” (a toy car with four wheels) for the application of clap switch?? we will use the clap switch to control or drive the tammia,…is it possible??..we need it now plzzz…

  47. vibha says:

    hey..i reallly like this project and want to make this as my mini project..can you please send me all tha data:layouts,files,ppts.etc associated to it please….i have to submit it by 24th feb…please its quite urgent…
    my id is : vibzpant@gmail.com

  48. rajan soni says:

    Hi please send me the program of this PIC. I want this for my project

  49. joe says:

    how does the microcontroller recognize the so called clap, if it only causes a weak signal?
    shouldn’t it be switching the rellay on/off, by just talking to somebody in the room, where the clap switch is placed. Talking also makes noise within sound pressure waves doesn’t it??

  50. onome sheriff says:

    how can one prevent other sound from activating the switch

  51. balakrishna reddy says:

    how to make the bulb to turn off wit out removing the power supply

  52. warsi hasan says:

    sir ,please tell me about future aspects of clap switch.

  53. sahil says:

    plz temme abt ckt of clap switch using 555timer

  54. i didn't got it says:

    i didn’t got anything

  55. JEAN says:

    HOW TO BURN AN MCU?

  56. sumit basak says:

    hi sir

  57. Pol says:

    Hi Sirs,

    I am really a newbie in electronics. Is the type of sound dependent on how you program the pic? What if i use a buzzer sound to trigger the circuit? I really need your help…thank you so much…

  58. lily says:

    could you pls send me da program 4 PIC12F629CP..Its 4 my project pls help me……..

  59. lily says:

    could u pls tell me hw 2 program da pic12f629cp means i m asking 4 its program…thank u

  60. vimal says:

    sir,
    could you please give the program for the above microprocessor.

  61. solokool says:

    this is real gud…it work perfect.

  62. Sunny says:

    Respected, sir
    before assembling circuit on PCB is it compulsary to check the circuit on breadboard.?.

  63. nani says:

    ur comments r helping so much to do a particular project

  64. Sujit Kumar says:

    Can you please send me the specification of all the apparatus used and also the circuit Diagram……
    I have to submit it by 20th February…
    Plz send Me to my E-mail.

  65. iman says:

    can you pls send me a copy of the source code, or atleast help me with the source code pls?? my email: jim.anthony.julaton@gmail.com

  66. Divyank says:

    Respected sir,
    I am making a project on clap controlled car without using microcontroller,
    ie- simply a clap switch PCB and H-bridge,
    so if you could pls help me out,
    i would be highly obliged.
    or even if you can give any other good idea of an RC car without use of microcontrollers.
    thanking you

    PS
    (anyone of u if possible pls help)

  67. Joseph says:

    Greeting,
    the project was great and i want to know more about it. i just want to know the clear PCB lay out of this one or can you give any switching project? thanks…

  68. st says:

    Hi sir
    please send me the program of this PIC 12f629cp. I want this for my project

  69. martin says:

    sorry sir but i dont see any program for pic12f629 would u send me on my e-mail hex-file for the pic12f629 tnx

  70. kuldip says:

    Please send me program code for this project..immediately.

  71. jimi says:

    Please send me program code for this project..immediately.

  72. tanishkjain says:

    i like this vedio and i try to make this circuit

Leave a Reply