edge lab LIVE! starts Tuesday in Munich. Grab a workshop seat and take home the board you build on. Code FRIEND-HACKSTER saves 20%. () Learn more!
ENERGEN
Published © Apache-2.0

Make Automated Smart light

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

IntermediateFull instructions provided1,777
Make Automated Smart light

Things used in this project

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

Comments