กลับไปหน้ารวมไฟล์
clap-switch-using-arduino-281d0d-en.md

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:

  1. The Sensor: The Sound Detector Module (LM393/KY-037) continuously sends variable voltage to the analog pin.
  2. The Spike: A clap produces a sudden, high-voltage spike.
  3. The Toggle: The code uses a boolean variable (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.

ข้อมูล Frontmatter ดั้งเดิม

apps: []
author: "utsabkayal001"
category: "Home Automation"
components:
  - "1x Male/Female Jumper Wires"
  - "1x Soldering iron (generic)"
  - "1x Solder Wire, Lead Free"
  - "1x Plastic Enclosure, Project Box"
  - "1x Hot glue gun (generic)"
  - "1x Relay Module (Generic)"
  - "1x 5volt smps"
  - "1x Arduino UNO"
  - "1x digital sound sensor"
description: "Control lights with a clap! Build an acoustic switch using a sound sensor module and an Arduino to toggle your appliances hands-free."
difficulty: "Easy"
documentationLinks: []
downloadableFiles: []
encryptedPayload: "U2FsdGVkX19gfki5mpWuu5rrd6Dw6FBywVsK3N6/R/aCKN2xV/oJoQBreP8qu+VuIu7H/iOH3OE6ZBSlwsbbJf3cpZrJnhZn7UiMFp2C6Kxqb2w2p6FUNUBjiPWZzBaf"
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/clap-switch-using-arduino-281d0d_cover.jpg"
lang: "en"
likes: 7
passwordHash: "b66978b2c9e3fdec922bb7eeca2048ee49553b8bc7a11b52a3ee5ba687014f0f"
price: 1120
seoDescription: "Build a simple clap switch circuit using Arduino Uno. An easy DIY project for beginners to control devices with sound."
tags:
  - "audio"
  - "lights"
  - "home automation"
  - "arduino"
  - "ac"
  - "internet of things"
  - "sound sensor"
title: "Clap switch using Arduino"
tools: []
videoLinks:
  - "https://www.youtube.com/embed/M7CTX9F3_yM"
views: 80088