Clap Switch With the Help of Arduino

by hIOTron IoT in Circuits > Arduino

12 Views, 0 Favorites, 0 Comments

Clap Switch With the Help of Arduino

Clap switch.jpg

In this, we have used clap sound and MIC to sense the sound which will turn on and off the device as a switch.

Supplies

Hardware Components

Arduino UNO

Microphone

General Purpose Transistor NPN

Capacitor 100 nF- 2

Capacitor 100 µF- 2

Resistor 1k ohm

Resistor 1M ohm

Resistor, 15 ohm- 2

LED

Software Components

Arduino IDE

​About Project

Condenser MIC.jpg

Basically, a microphone is a sound sensing transducer, which primarily transforms sound energy into electrical energy, so with the help of this sensor, we have sound as a changing voltage. Working is followed basically in four ways such as: Filtration, Amplification, Analog-digital conversion and programming to toggle the LED.

Whenever there is sound, the MIC strikes it up and transforms it into voltage, direct to the magnitude of sound. So for a higher sound, we have a greater value and for the lower sound, we have a deeper value. This value is first filled to the High Pass Filter for the process of filtration.

Then this refined value is filled to the transistor for amplification and the transistor gives the amplified output at the collector. This collector signal is supplied to the ADC0 channel of the UNO, for Analog to Digital conversion.

IoT Course will help you to build Customized IoT Solutions

Run a Program

const int analogInPin = A0; // Analog input pin 0 int sensorValue = 0; void setup() { DDRD = 0xFF; } void loop() { sensorValue = analogRead(analogInPin); //read ADC value on channel 0 if(sensorValue>60) { PORTD ^=(1<<7); //If there is a peak toggle the LED on and OFF on pin7. delay(250); } }