CLAP SWITCH WITH ARDUINO


Components Required:-

1.Sound detecting module:-



2. Arduino Uno:-



3.1-Channel Relay Module:-



 SOUND DETECTING MODULE WITH ARDUINO



SOUND DETECTING MODULE:- This module is used for detecting sound waves and then producing a corresponding output signal in analog and digital form.

First the sound waves are detected by an electret or condenser mic which then gets passed to an amplifier IC for the amplification process. This IC then amplifies the signal and produces an output in the form of analog signals as well as digital signals. For adjusting the sensitivity, PRESET is there whose knob can be rotated to increase or decrease the sensitivity level.



Pinout:-

1.AO PIN:- It is an analog output pin .

2.GND PIN:- connected to the ground pin of Arduino.

3.POSITIVE PIN:-  connected to 5v pin of Arduino.

4.DO PIN:- It is a digital output pin.


SOUND DETECTING MODULE INTERFACING WITH ARDUINO

1.Connect VCC pin of sound detecting module with 5v pin of Arduino.

2.Connect GND pin of sound detecting module with GND pin of Arduino.

3.Connect AO pin of sound detecting module with A0 pin of Arduino.

4.Now connect a relay module whose IN pin is connected with 13 pin of Arduino and GND pin of relay module with GND pin of Arduino.

5.Now connect the VCC pin of the relay module with the positive terminal of the battery .

6. Then ground negative terminal of battery with both Arduino and relay module.

7.Then connect one terminal of AC supply to the COM(common) pin of the relay module and the other pin to the device’s(bulb, fan etc.) one end.

8.The other terminal of the device to be connected to the NO(normally open) pin of the relay module.



ARDUINO CODE

_________________________________________________

int value, threshold = 590, state;

void setup()

{

  pinMode(13, OUTPUT);

  pinMode(A0, INPUT);

}

 

void loop()

{

  value = analogRead(A0);

  if (value > threshold)

  {

    if (state == HIGH)

    {

      state = LOW;

    }

    else

    {

      state = HIGH;

    }

    digitalWrite(13, state);

    delay(500);

  }

}

_______________________________________


To understand this project in detail, CLICK HERE or on this image to watch on YouTube.




Comments