ENERGEN
Published © Apache-2.0

Make Automated Smart light

How to make auto on/off the light using PIR sensor

IntermediateFull instructions provided1,727
Make Automated Smart light

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
PIR Motion Sensor (generic)
PIR Motion Sensor (generic)
×1
SparkFun Qwiic Single Relay
SparkFun Qwiic Single Relay
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Breadboard (generic)
Breadboard (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Daigram

Code

arduino automatic light

Arduino
void setup() {
  pinMode(7,OUTPUT);
  pinMode(11,INPUT);

}

void loop() {
  // put your main code here, to run repeatedly:
int val = digitalRead(11);
if( val == 1){
  digitalWrite(7, LOW);
  delay(1000);
}
else{
   digitalWrite(7, HIGH);
   delay(1000);
}

}

Credits

ENERGEN
17 projects • 10 followers
Youtube creator
Contact

Comments

Please log in or sign up to comment.