Guided tutorial

Clap Switch

Control a relay with claps using sound sensor.

intermediate · 25 Sept 2026

Difficulty

intermediate

Learning complexity

Sections

6

Structured content blocks

Topics

7

Linked learning concepts

Related links

6

Next steps and references

1. What you will build

Control a relay with claps using sound sensor.

2. Wire Sound Sensor

Connect sound sensor output to Arduino pin 2.

3. Wire Relay

Connect relay module to pin 8 (with proper isolation).

4. Detect Claps

Use threshold to detect loud sounds as claps.

5. Toggle Logic

Each clap toggles the relay state on/off.

6. Add Debounce

Prevent multiple triggers from single clap.

FAQ

Can I try Clap Switch in the simulator?

Yes. Use the Open in Lab action to load the guided build in the browser-based simulator.

Next step

Open this tutorial in the lab

Load the guided build in Ayantrik Lab and follow the same components and steps inside the simulator.