Arduino clap switch – SOUND CONTROL SWITCH

Hello world! Today i made a Arduino clap switch with a DIY sound control module. I soldered the Sound control Module a few months ago, and today i decided to check out if it works, and it does. I had a hard time getting another value then 0 and then found a way to get 2 values. You can clap, knock, or say any word + you can blow into it.. for the last 2 you need to be close to the device. You can also use it as a shock/knock sensor. Check the next step for the schematic Code & Parts list.

For the Sound Switch Module:
Attach the Blue wire to SCL on arduino.
Attach the Yellow wire to RXD.
Attach the + to VIN.
– to ground.

arduino clap switch

Just connect it like the schematic, upload the code and it should work.

Parts list:
Arduino uno, i used the RobotDyn Uno.
KY-019 Relay module. Any other will work to, or make your own relay module.
DIY Sound Switch Module. (You need to solder it yourself)
9v 1000ma AC/DC adapter
Lamp socket + power cable. (optional)


//Author: Danny van den Brande, BlueCore Tech.
//This code is a simple example for the DIY clap switch that you need to solder yourself.
// find it at this link,searchweb201602_5_10037_10017_9878_10021_507_10022_10032_10009_10020_10008_10018_10019,searchweb201603_1&btsid=ef9560f7-7d93-4f72-ace9-a158709dabe3
const int Clap_Pin = 0;

int Relay = 12;
boolean sensorValue;// define numeric variables val
void setup ()
  pinMode(Clap_Pin, INPUT);
  pinMode(Relay, OUTPUT);

void loop ()
    if (sensorValue == 1) {
    digitalWrite(Relay, LOW);
    if (sensorValue == 0 ){
    digitalWrite(Relay, HIGH);
  sensorValue = digitalRead(Clap_Pin);
  Serial.println (sensorValue, DEC);

Danny van den Brande

Programmer, Game Designer, 3D Designer, Web Designer, Graphic Designer. Jup this website looks crappy.. :) But enjoy the projects! Everything you need is here.

Leave a Reply

Your email address will not be published. Required fields are marked *