Motion Detection Automatic Light On/Off with Arduino | Home Automation

Robotica DIY
Robotica DIY
20.5 هزار بار بازدید - 4 سال پیش - Motion Detection Automatic Light On/Off
Motion Detection Automatic Light On/Off with Arduino | Home Automation
Scroll down for code.....

Automating home stuff is fun. In this tutorial we are using PIR motion detection sensor to detect motion and turn ON LED bulb and it will remain ON for 2 minutes if no motion detected. Obviously you can increase this time from 0.3 seconds to 5 minutes to 10 minutes. For more information you can see your manufacturer data sheet. If you are continuously in detecting zone it will not turn off, it will increase its delay time.

If you want to support my video please buy any product through my amazon affiliate link. I will receive a commission, at no extra cost to you.

LIST OF COMPONENT (affiliate links)

http://amzn.to/2fvSRJq   (Arduino)
http://amzn.to/2y8horo (Relay Module)
http://amzn.to/2vqnDHc   (PIR sensor)
http://amzn.to/2wxPmWz  (Breadboard)
http://amzn.to/2vJ3lvo   (Jumper wire)


Track: Murad - Run [NCN Release]
Music provided by NoCopyrightNation
Watch: Murad - Run (Inspired By Alan Walker)...
Stream/Download: https://NCN.lnk.to/Run

int Bulb = 8;
int PIR = 3;
int val = 0;

void setup() {
pinMode(Bulb, OUTPUT);
pinMode(PIR, INPUT);
}

void loop(){
val = digitalRead(PIR);
if (val == HIGH) {
digitalWrite(Bulb, HIGH);
delay(200);
} else {
digitalWrite(Bulb, LOW);
delay(200);
}
}
4 سال پیش در تاریخ 1399/01/18 منتشر شده است.
20,554 بـار بازدید شده
... بیشتر