daulayyasir
Published © CC BY

Controlling lamp with Clapping Sound

In this project I made a simple automatic lamp using clapping sound. The component used is sensor KY-037, LED, and Arduino Nano.

BeginnerFull instructions provided3,810
Controlling lamp with Clapping Sound

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
In this project, we are using Arduino nano. However, if you want to use other types of Arduino, that's fine.
×1
ADLINK Sensor KY - 037
×1
LED (generic)
LED (generic)
×1

Story

Read more

Schematics

Controlling lamp with Clapping Sound

The components used are LEDs, ky-037 sensors, and Arduino nano.

Code

Controlling_lamp_with_Clapping_Sound.ino

C/C++
This coding design by Syakir Daulay
//Controlling lamp with Clapping Sound
// By Syakir Daulay

int soundSensor = 2;
int pinLED = 3;
boolean condition = 0; 

void setup() 
{
  // put your setup code here, to run once:
  Serial.begin(9600);
  pinMode(pinLED, OUTPUT);
  pinMode(soundSensor, INPUT);
}

void loop() 
{
  // put your main code here, to run repeatedly:
int sensorValue = digitalRead(soundSensor);
if (sensorValue == HIGH)
  {
  condition = !condition;
  digitalWrite(pinLED, condition);
  Serial.print ("There is High Frekuensi Sound");
  }
  delay (1000);
}

Credits

daulayyasir
0 projects • 0 followers
Contact

Comments

Please log in or sign up to comment.