Making a simple clap switch

Summary of Making a simple clap switch


This article describes a beginner-friendly clap switch project that controls electrical appliances using two consecutive claps. The system utilizes an electret microphone to convert sound into an electrical signal, which is then amplified by a transistor before being processed by a PIC12F683 microcontroller for switching actions.

Parts used in the Simple Clap Switch:

  • Electret microphone (OBO-04FN-0B)
  • Transistor
  • PIC12F683 microcontroller
  • Capacitor C1
  • Digilent Analog Discovery device

A clap switch is a fun project for beginners. It switches on and off electrical appliances with a sound of clapping hands. Today we will discuss about making a simple clap switch that operates when it detects two clapping sounds in a row. It uses an electret microphone as a transducer for converting a clapping sound into an electrical signal. The microcphone output is amplified by a transistor and is then sent to the PIC12F683 microcontroller which performs an ON/OFF switching action when valid claps are detected.

Making a simple clap switch
Simple clap switch using a condenser mic and PIC microcontroller

Theory

The clap switch requires a transducer at the input to convert sound vibrations from clapping hands into electrical energy. An electret microphone or simply mic (OBO-04FN-0B) is used for this purpose. The output from the mic is very low in magnitide and so we need an amplifier circuit to boost the detected sound signal. The following circuit diagram shows the mic along with a single transistor amplifier. When there’s no sound, the collector voltage (Vout) of the transistor, which is saturated, is approximately 0.2V. When the mic detects a clap sound, the voltage across it drops suddenly. Since the condenser mic’s output voltage is coupled to the base of the transistor through capacitor C1, the base-emitter voltage is also lowered and as such the base-emitter junction is less forward biased or cutoff (in case of high clap sound). Therefore, every time a clapping sound is detected, there is a sudden peak arising at the collector voltage.

Schematic Making a simple clap switch
Sensor part

The following picture shows the peaks in the collector voltage due to multiple clap sounds. You can see the peak voltage can go as high as 4.0V depending on the loudness of the clap. This waveform of the collector voltage is captured using Digilent’s Analog Discovery device.

For more detail: Making a simple clap switch

Quick Solutions to Questions related to Simple Clap Switch:

  • How does the clap switch operate?
    The device switches on and off electrical appliances when it detects two clapping sounds in a row.
  • What component converts sound vibrations into electrical energy?
    An electret microphone serves as the transducer to convert sound vibrations from clapping hands into electrical energy.
  • Why is an amplifier circuit needed?
    The output from the microphone is very low in magnitude, so an amplifier circuit is required to boost the detected sound signal.
  • Which microcontroller performs the switching action?
    The PIC12F683 microcontroller performs the ON/OFF switching action when valid claps are detected.
  • What happens to the collector voltage when no sound is present?
    When there is no sound, the collector voltage of the saturated transistor is approximately 0.2V.
  • How does the transistor react to a clap sound?
    When a clap is detected, the base-emitter junction becomes less forward biased or cutoff, causing a sudden peak at the collector voltage.
  • What is the maximum peak voltage observed during clapping?
    The peak voltage can go as high as 4.0V depending on the loudness of the clap.
  • Can you identify the specific model of the electret microphone used?
    The article specifies the use of an OBO-04FN-0B electret microphone.

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter