Clap Lamp

As I was seeing in many homes there is only a on-off switch light in which we have to use switch. But I think creatively and made one clap light in which we have to clap our hands the light we automatically on. The main propose of my project was to make people’s life easy .
Materials used
Arduino Uno
Jumper wires
Sound sensor module
Relay module
Bulb+holder
Source Code:
const int Sensor = 7;
const int relay = 8;
int x = 0;
int y = 0;
void setup() {
pinMode(relay, OUTPUT);
pinMode(Sensor, INPUT);
}
void loop(){
x = digitalRead(Sensor);
y = digitalRead(relay);
if (y == HIGH && x == LOW) {
delay(250);
digitalWrite(relay, LOW);
}
if (y == LOW && x == LOW) {
delay(250);
digitalWrite(relay, HIGH);
}}

See More Related Posts -

13 thoughts on “Clap Lamp”

Leave a Comment

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

Scroll to Top