• Register
  • Login
  • looking for something?

    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:

    • 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.

    Clap Switch Circuit Schematic

    clap switch circuit diagram

    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.

    Buy a assembled clap switch
    2137158
    Velleman MK139 at $17
    “1-clap” or “2-clap” mode selection
    “2-clap” mode features built-in safety turn-off timer (5h approx.)
    Microprocessor controlled
    With DC adaptor socket

    Maplin Velleman Clap On/Off switch Video

    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
    
    subscribe to newsletter

    121 Responses to "Clap Switch"

    1. 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. i also try with a wire from T1 collector to groung and still nothing

    3. P. Marian electrolover says: on January 30, 2009 at 1:15 pm

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

    4. shakti parmar says: on March 26, 2009 at 5:44 am

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

    5. pls send me a inverter circuit diagram

    6. Sir where is the program for 12f629

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

    8. Hrutuja Shankar Limbhore says: on November 5, 2009 at 4:59 am

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

    9. 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: on February 7, 2010 at 10:53 am

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

    11. it is very usefull

    12. Greg Fong says: on March 4, 2010 at 10:05 pm

      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: on March 17, 2010 at 6:50 pm

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

      • nhel romano says: on October 12, 2011 at 3:36 pm

        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

      • Could u please mail me a copy of that..

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

      • 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: on January 24, 2012 at 12:59 am

        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

      • yes i need copies

      • Hi Greg,

        i am looking for a double clap circuit with a 15 second delayed off. kindly help.

        best regards
        arjun

    13. Surendra says: on March 13, 2010 at 8:07 am

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

    14. Greg Fong says: on March 21, 2010 at 1:20 pm

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

    15. Greg Fong says: on March 21, 2010 at 1:34 pm

      I am located in Canada

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

    17. 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: on February 21, 2011 at 6:25 am

        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

    18. how i proceed the project of clap switch

    19. nagarjuna says: on July 26, 2010 at 2:18 pm

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

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

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

    22. any one cant say this layout are tested?

    23. Paras Sharma says: on August 16, 2010 at 7:37 am

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

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

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

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

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

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

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

    30. 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: on January 24, 2012 at 1:07 am

        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.

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

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

    33. What is the specific measurement of the PCB???

    34. 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…

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

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

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

    38. sorry hw 2 manufacture a relay in the ckt

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

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

    41. 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

    42. DISHANT KUMAR says: on January 16, 2011 at 5:27 pm

      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: on January 24, 2012 at 1:09 am

        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.

    43. 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…

    44. Abdul Rahman says: on February 11, 2011 at 4:56 pm

      my clap switch is working

      • 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…

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

      • 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.,

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

    46. 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

    47. 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…

    48. 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

    49. rajan soni says: on March 14, 2011 at 10:30 pm

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

    50. 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??

    51. onome sheriff says: on April 3, 2011 at 6:28 pm

      how can one prevent other sound from activating the switch

    52. balakrishna reddy says: on April 23, 2011 at 9:05 am

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

    53. warsi hasan says: on July 31, 2011 at 4:07 pm

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

    54. plz temme abt ckt of clap switch using 555timer

    55. i didn't got it says: on August 11, 2011 at 5:18 am

      i didn’t got anything

    56. HOW TO BURN AN MCU?

    57. sumit basak says: on September 13, 2011 at 7:38 pm

      hi sir

    58. 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…

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

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

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

    62. this is real gud…it work perfect.

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

    64. ur comments r helping so much to do a particular project

    65. Sujit Kumar says: on February 14, 2012 at 8:31 pm

      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.

    66. 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

    67. 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)

    68. 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…

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

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

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

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

    73. i like this vedio and i try to make this circuit

    74. OverpwMonster says: on June 12, 2012 at 12:28 am

      Can you somehow build this into a PC and use it instead of a button? That would be EPIC!!!!!

    75. sai swathi.k says: on July 10, 2012 at 5:00 pm

      I wanted to make it.

    76. Pls i need a very good project topic related 2 computer/electrical engineering.

    77. sadashiva das says: on July 21, 2012 at 5:56 pm

      sir ,we are from orissa and we are unable to find the IC12f629. plz give us the local address it is available.

    78. mubarak says: on August 6, 2012 at 4:43 pm

      plz send me some more projects i like these projects

    79. hey
      please sir could you please send me a PIC12F629CP program.it’ll be big help to my project sir.
      please send the program.
      thank you….

    80. respected sir/madam,
      i want the same project but on controller based
      pl z send me a description of micro controller based clap switch project.
      i shall be grateful to u
      yrs faithful
      gauravsharma
      yamunanagar

    81. did you program the micro-controller ic chip?

      thanks

    82. PLZ REPLY…..

      How this circuit detects only the clap sound ??? is it possible to use any different sounds ?

    83. Shane Otto says: on January 31, 2013 at 3:45 pm

      Excuse me sir,
      please send me the program for the PIC12f629 ASAP. This is for a school project and i need the program.

    84. can you please send me the program for the PIC12f629

    85. Hi, can you share with me by the HEX file with program for PIC. Thank you

    86. ketanpansal says: on February 14, 2014 at 10:42 am

      plz send me coding of clap switch project

    87. saulin1965 says: on April 10, 2014 at 7:38 pm

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

    88. tanishk jain says: on April 16, 2014 at 1:03 pm

      please friends help me to build this clap swich .
      oi’ll do any thing tomake this..
      because i have another idia to make something related to clap swich

    89. Hi, can you share with me by the HEX file with program for PIC. Thank you

    What do you think about this article? Leave a comment!

    You may add a picture too