This project shows you how to make an Arduino clap switch. Also, I show you how to interface an LM393 Sound Sensor with Arduino and implement a LED and Relay control project using Arduino, LM393 Sound Sensor, and a Relay Module.
For more details, watch the video below or read the written tutorial below.
Components Required for Arduino Clap Switch
Arduino Uno | × 1 | Amazon |
LM393 Sound Sensor Module | × 1 | Amazon |
5V Relay Module | × 1 | Amazon |
LED and resistor kit | × 1 | Amazon |
Breadboard | × 1 | Amazon |
Jumper wires kit | × 1 | Amazon |
USB cable type A/B | × 1 | Amazon |
Software
LM393 Sound Sensor Module
The sound sensor module makes it simple to detect sound and is commonly used to determine sound intensity. For protection, switching and monitoring applications, this module can be used. It is easy to adjust its precision to ease of use. It uses a microphone that provides an amplifier, high detector, and buffers for the signal.
When a sound is detected, the sensor generates an output signal voltage, which is then sent to a micro-controller, which performs the required processing.
The sound detector sensor module for Arduino determines whether or not sound has crossed a predefined threshold value. A microphone detects sound, which is then fed into an LM393 op-amp. An onboard potentiometer is used to change the sound level set point. As the sound frequency reaches the threshold, an LED on the module illuminates and the output is reduced.
LM393 Sound Sensor Module Specifications
Operating voltage | 3.3 V – 5 V |
Sensitivity | 48-66 dB |
Outputs | one analog + one digital |
Impedance | 2.2 kΩ |
Operating temperature | -40 °C to +85 °C |
Frequency response | 50 Hz – 20 kHz |
Indicator LED | 1 power indicator + 1 comparator output indicator |
Dimensions | 44 x 15 x 10 mm |
Cost | Check price |
The LM393 Sound Sensor Module is made by PRC. For more information, you can check out the LM393 Sound Sensor Module datasheet below:
5V Relay Module
A relay consists of three pins: NO (Normally Open) terminal, NC (Normally Closed) terminal, common pin, and coil. The contacts connected to each other are created when a coil is powered on the magnetic field.
The part of a relay that moves is called the COM (Common) terminal. The COM is connected to the NC (Normally Closed) terminal when a relay is turned off. The relay’s NO (Normally Open) terminal is not connected until the relay is turned on. The COM moves from NC to NO when the relay is turned on.
5V Relay Module Specifications
Operating voltage | 3.75V – 6V |
Quiescent current | 2mA |
Current when the relay is active | ~70mA |
Relay maximum contact voltage | 250VAC or 30VDC |
Relay maximum current | 10A |
Cost | Check price |
For more information, you can check out the 5V Relay Module Datasheet below:
Arduino Clap Switch with LED Circuit Schematics


The following connections are also shown in the table:
LM393 Sound Sensor Module Connections
LM393 Sound Sensor Module | Arduino |
VCC | 5 V |
GND | GND |
A0 | A0 |
D0 | Digital pin 2 |
Resistor’s one terminal goes to LED and another terminal goes to digital pin 3.
Arduino Clap Switch with Relay Circuit Schematics


Connections are also shown in the table:
Relay Module Connections
5V Relay Module | Arduino |
VCC | 5 V |
GND | GND |
IN | Digital pin 2 |
A bulb connects with a 5V relay module’s NO pin and NC pin.
This board interfaces with a high-voltage AC supply. Improper or incorrect use may result in serious injury or death. As a result, it is intended for people who are familiar with and knowledgeable about HIGH AC voltage.
Arduino Clap Switch Code
By clicking the button in the top right corner of the code field, you can copy the code. Copy and paste it into Arduino IDE.
/***** www.arduinopoint.com *****/ /***** Arduino Clap Switch *****/ int SoundSensor=2; // LM393 Sound Sensor Digital Pin D0 connected to pin 2 int LED=3; // LED connected to pin 3 boolean LEDStatus=false; void setup() { pinMode(SoundSensor,INPUT); pinMode(LED,OUTPUT); Serial.begin(9600); //initialize serial } void loop() { int SensorData=digitalRead(SoundSensor); Serial.println(SensorData);//print the value if(SensorData==1){ if(LEDStatus==false){ LEDStatus=true; digitalWrite(LED,HIGH); } else if(LEDStatus==true){ LEDStatus=false; digitalWrite(LED,LOW); }}}