Hello friends, In this video you'll learn how to make a clap circuit using Arduino Uno. You can control your AC appliances using your clap. Watch the full video.
Acoustic Control: The Clap Switch
Remember those old "Clapper" commercials? The Arduino Clap Switch lets you build that exact device. It uses an analog sound sensor to listen for sharp, loud noises (like a handclap) and toggles a relay to turn devices on or off.
The Sound Threshold Logic
Microphones pick up all noise. Your Arduino's job is to filter it:
- The Sensor: The Sound Detector Module (LM393/KY-037) continuously sends variable voltage to the analog pin.
- The Spike: A clap produces a sudden, high-voltage spike.
- The Toggle: The code uses a
booleanvariable (true/false state). When a loud spike crosses a specific threshold, the variable flips, turning the relay ON. If it claps again, the variable flips back, turning the relay OFF.
Hardware Components
- Arduino Uno/Nano: The sound processor.
- KY-037 Sound Sensor Module: The microphone and amplifier.
- 1-Channel Relay Module: The high-voltage switch.
- Desk Lamp or Appliance: For testing the relay safely.
Debouncing Sound
Just like mechanical buttons, acoustic signals are messy. The hardest part of this project is programming a non-blocking delay (millis()) to ensure that a single, slightly long clap isn't registered as two or three claps, preventing the light from flickering rapidly.