0% found this document useful (0 votes)
527 views

Automatic Room Lights Using Arduino and PIR Sensor

This document describes an automatic room lighting system using an Arduino and PIR sensor. The system turns lights on when it detects a person's presence using the PIR sensor and turns the lights off after 5 seconds if no motion is detected, conserving electricity. It provides the components needed, including an Arduino, PIR sensor, relay module, LED, resistor, and wiring. It also includes the code used to program the Arduino to control the lights. Potential applications mentioned are for garage, bathroom, and security lights.

Uploaded by

dunga madhuri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
527 views

Automatic Room Lights Using Arduino and PIR Sensor

This document describes an automatic room lighting system using an Arduino and PIR sensor. The system turns lights on when it detects a person's presence using the PIR sensor and turns the lights off after 5 seconds if no motion is detected, conserving electricity. It provides the components needed, including an Arduino, PIR sensor, relay module, LED, resistor, and wiring. It also includes the code used to program the Arduino to control the lights. Potential applications mentioned are for garage, bathroom, and security lights.

Uploaded by

dunga madhuri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Automatic Room Lights using Arduino

and PIR Sensor


In this project, we will see the Automatic Room Lights using Arduino and PIR
Sensor, where the lights in the room will automatically turn ON and OFF by detecting
the presence of a human.

Such Automatic Room Lights can be implemented in your garages, staircases,


bathrooms, etc. where we do not need continuous light but only when we are present

Also, with the help of an automatic room light control system, you need not worry
about electricity as the lights get automatically off when there is no person.

So, in this DIY project, we have implemented Automatic Room Lights using Arduino
and PIR Sensor.

Circuit Diagram of Automatic Room Lights using


Arduino
The following image shows the circuit diagram of the project implemented using
Arduino UNO, PIR Sensor and a Relay Module.
Components Required for Automatic Room Lights using
Arduino
 Arduino UNO
 PIR Sensor
 5V Relay Module (Relay Board)
 LED
 100Ω Resistor (1/4 Watt)
 Connecting Wires
 Breadboard
 Power Supply

Code
int in1 = 9;

int sensor = 8;

int led = 13;

unsigned long t=0;

void setup() {

Serial.begin(9600);

pinMode(in1, OUTPUT);

pinMode(sensor, INPUT);

pinMode(led, OUTPUT);

digitalWrite(in1,HIGH);

digitalWrite (in1,LOW); Commented [U1]:

digitalWrite(led,LOW);

while(millis()<13000)

{
digitalWrite(led,HIGH);

delay(500);

digitalWrite(led,LOW);

delay(500);

digitalWrite(led,LOW);

void loop()

digitalWrite(in1,HIGH);

digitalWrite(led,LOW);

if(digitalRead(sensor)==HIGH)

t=millis();

while(millis()<(t+5000))

digitalWrite(in1,LOW);

digitalWrite (led,HIGH);

If ((millis()>(t+2300)) &&(digitalRead(sensor)==HIGH))

t=millis();

}
}

Applications
I’ve already mentioned a few applications of the Automatic Room Lights concept.
Some of them are:

 Garage Lights
 Bathroom Lights
 Hand Dryers
 Toilet Flushers
 Security Lights

You might also like