PCB Layout Tips to Design a Clap Switch Circuit
I’m a self-professed workaholic. On a typical workday, lunch breaks become nonexistent as I obsess on my latest project or focus on clearing my list of tasks. During my off-days, however, I move to the opposite end of the spectrum. I became the epitome of laziness as I spend the whole day unwinding.
I become immobilized as I sink deeper into the couch while watching my favorite TV shows. In these moments, I wish I could prepare dinner with a single clap, perhaps using a clap switch circuit. Unfortunately, operating a clap switch doesn’t cause dinner to magically appear, nor it is likely to in the near future. However, clapping certainly does the trick when you need to automatically turn on a lamp.
What is a Clap Switch?
As the name implies, a clap switch is an electronics module that turns on an electrical load with a simple clap. This is quite useful if you need to turn on the bathroom lights in the middle of the night. Instead of fumbling around in the darkness, you can light up the bathroom with a single clap.
The core component of the clap switch is the condenser mic. It is basically a small audio transducer that turns sound into electrical signals. Although the term ‘clap switch’ is used, the condenser mic responds to any similar sound generated that is loud enough to be picked up.
Building a Simple Clap Switch
The most simple and clap switch uses the 555 timer chip. The 555 timer is a well-known integrated circuit used to provide oscillation for timers or delays in electronics applications. It is relatively cheap and simple to use. In a simple clap switch circuit, the 555 timer is configured to be in the monostable mode.
In a monostable mode, the 555 timer output asserts to a high logic state when the input is triggered with a low pulse. The output then holds itself in the high state for a certain duration, determined by the values of the resistor and capacitor (RC) that are connected to the discharge pin of the 555 timer.
The following schematic shows a simple connection of a clap switch circuit using the 555 timer:
Layout of a potential clap switch circuit
In the idle state, the condenser mic doesn’t generate any voltage and has high impedance. This causes the transistor Q1 to be turned off and Vcc is observed at the collector that connects to the trigger pin of the 555 timer.
When the condenser mic picks up an audio signal and generates a voltage larger than the base-emitter threshold of the transistor (normally 0.7 V), the transistor is turned on and current flows through the collector-emitter. The trigger pin of the 555 timer is then pulled down to low, and the output is asserted. The LED, or any external electrical load connected to the output of the 555 timer, is turned on for a specific duration before being turned off.
PCB Layout Tips for Clap Switch
The clap switch is a generally simple electronics circuit with mostly digital components. The following tips may help you reduce any potential problems in the PCB layout:
- Keep trace of condenser mic short: The condenser mic produces an analog signal and it takes a relatively low voltage to trigger the 555 timer. To prevent coupling of external electrical interference into the circuit and causing a false trigger, it is best to keep the trace of the condenser mic short.
- Consider using a mechanical relay: While the example schematic may show an LED is being used as a load, actual applications may involve a light bulb, fan or other electrical appliances that are powered by the mains voltage. In such cases, using a mechanical relay is necessary to provide electrical separation on the PCB.
- Route traces with significant voltage away from clap switch components: To prevent the effect of electromagnetic interference from the relay, a flyback diode is connected to the coil of the relay. Any traces of medium or high voltage should also be routed far away from the clap switch components.
Using strong PCB design software will enable you to get your devices working
Designing a clap switch circuit is relatively simple when your design software includes libraries and components for your PCB. When you need to access an easy-to-use PCB layout tool that includes everything needed to build high-quality manufacturable circuit boards, look no further than CircuitMaker. In addition to easy-to-use PCB design software, all CircuitMaker users have access to a personal workspace on the Altium 365 platform. You can upload and store your design data in the cloud, and you can easily view your projects via your web browser in a secure platform.