You are on page 1of 22

A U T O M A T I C

R O O M L I G H T I N G

S Y S T E M U S I N G

M I C R O C O N T R O L L E
R

BY
M ANG ES H PAT IL 42
SHRUTI SHARMA 3
TA N V I WA G H M A R E 2
KSHITIJ 1
SUMMARY
1

THE AIM OF THIS PROJECT IS TO  TURN ON OR


O F F T H E   L I G H T S I N  A  R O O M B Y  D E T E C T I N G T H E
H U M A N M O V E M E N T . .W E I M P L E M E N T E D T H I S
P R O J E C T   U S I N G 8 0 5 1 M I C R O C O N T R O L L E R  A N D
TWO INFRARED (IR) SENSORS. IT IS
U S U A L LY E M B E D D E D A S PA R T O F A C O M P L E T E
D E V I C E I N C L U D I N G H A R D WA R E A N D
M E C H A N I C A L PA R T S . E M B E D D E D S Y S T E M S H AV E
B E C O M E V E R Y I M P O R T A N T T O D AY A S T H E Y
CONTROL MANY OF THE COMMON DEVICES.
S I N C E T H E E M B E D D E D S Y S T E M I S D E D I C AT E D T O
S P E C I F I C TA S K S , D E S I G N E N G I N E E R S C A N
O P T I M I Z E I T, R E D U C I N G T H E S I Z E A N D C O S T O F
T H E P R O D U C T, O R I N C R E A S I N G T H E
RELIABILITY AND PERFORMANCE.
ADVANTAGES
• Remodelling a home’s lighting fixtures is a great way to update and modernize a
dwelling, and an important thing to focus on if you’re building a new house. This is
convenient, enhances security and saves money. The amount and quality of light
affects us, our moods, our ability to see, and our sleep cycles. It also indicates to
anyone outside the home that someone is present inside. When we renovated our
home, we turned to home automation solutions to better help us control the thing
that affects the atmosphere in the home more than anything — the lighting.When it’s
time to close the book and get some rest, a lot of light can prevent you from getting
a good night’s sleep. So can getting out of a bed to turn lights off. Having a light
control module to turn lamps around the house on and off from a single control can
help you ease into a healthy sleep. During the day, we need light to help us feel
awake and alert. At night, we need less light to signal to our bodies it’s soon time to
doze off. An automated lighting control system that turns lights on and off on a timer
is a great way to ease our bodies and minds through the day. More light can be mood
elevating, and dimmer light can be relaxing or sedating, so timed lights and a
dimmer work well together to set our moods.
Disadvantages 
• It is used only when one person cuts the rays of the sensor hence
cannot be used when two or more persons cross the door
simultaneously. When anybody is inside the room and we need to
switch off the power then we've to do it manually. So, in this case we
fail to automatically control the light
PROPOSED ALGORITHM FOR DENSITY
BASED ROOM LIGHT CONTROLLER
• . •In this paper, an automatic room lighting system is developed using 8051 microcontroller. The main
component is IR Sensor. The placement of the sensors is important as it will determine the functioning
of the Density Based Room Light Controller.
• • Practically speaking, both the sensors must be placed on the either side of the door or entrance of the
room. The sensor placed on the outside of the room is named as Sensor 1 and the sensor, which is
placed on the inside is named Sensor 2.
• •When a person tries to enter the room, Sensor 1 detects the person first and then Sensor 2. This action
will indicate the 8051 Microcontroller that the person is entering the room.
• Hence, the microcontroller will turn on the light and also increments the visitor counter to 1. If there
are more visitor, the microcontroller will keep the light turned on and increments the visitor counter
accordingly.
• • When a person tries to leave the room, Sensor 2 detects the person first and then Sensor 1. This
process will make the microcontroller to understand that a person is trying to leave the room and
hence, it will decrement the count of visitors. The microcontroller will not turn off the light until the
last person has left the room.
• •As the visitors start leaving the room, the visitor count will be decremented and when the last person
leaves the room, the count be comes 0. During this point, the microcontroller understands that there is
CONCLUSION :
• :This paper compacts with the usage of the energy in this competitive world
of electricity. It is well-organized enough to letsomeone know about the
accuracy of the person entered and have taken the exit from the room. In any
big hall if we want to count number of individuals it is very difficult as it
results in congestion. This turns out to be serving hand in such situation
because it gives the count on LCD display. Also it controls the lighting system
automatically according to how many persons are there in a room. Turning
ON of lights will increase with increasing the individuals in a room. Turning
ON of lights will decrease with decreasing the individuals in a room.In future
Voice alarm system can be added to indicate that room is full and persons
can’t enter inside. We can increase the maximum number of persons that can
be counted by implementing the external EEPROM IC and We can send this
data to a remote location using mobile or internet.
SUMMARY 2
S O F T WA R E
USED
KEIL UVISION5.
COMPONENTS REQUIRED

• 8051 Development Board

• 2 x Infrared Sensors

• 16 x 2 LCD Display

• 5V Relay Module

• Lamp

• Connecting Wires

• Power Supply
THEORY

• T H E A I M O F T H I S P R O J E C T I S T O A U T O M AT I C A L L Y
TURN ON OR OFF THE LIGHTS IN A ROOM BY
D E T E C T I N G T H E H U M A N M O V E M E N T. W E I M P L E M E N T E D
THIS PROJECT USING 8051 MICROCONTROLLER AND
TWO INFRARED (IR) SENSORS.
IR SENSOR
AN INFRARED (IR) SENSOR IS AN
E L E C T R O N I C D E V I C E T H AT M E A S U R E S A N D
D E T E C T S I N F R A R E D R A D I AT I O N I N I T S
S U R R O U N D I N G E N V I R O N M E N T.
I N F R A R E D R A D I AT I O N WA S A C C I D E N T A L LY
DISCOVERED BY AN ASTRONOMER NAMED
WILLIAM HERCHEL
IN 1800. WHILE MEASURING THE
T E M P E R AT U R E O F E A C H C O L O R O F L I G H T
( S E P A R AT E D B Y A P R I S M ) , H E N O T I C E D
T H AT T H E T E M P E R AT U R E J U S T B E Y O N D T H E
R E D L I G H T WA S H I G H E S T .
IR IS INVISIBLE TO THE HUMAN EYE, AS
I T S WAV E L E N G T H I S L O N G E R T H A N T H AT O F
VISIBLE LIGHT (THOUGH IT IS STILL ON
THE SAME ELECTROMAGNETIC SPECTRUM).
A N Y T H I N G T H AT E M I T S H E AT
( E V E R Y T H I N G T H AT H A S A T E M P E R AT U R E
A B O V E A R O U N D F I V E D E G R E E S K E LV I N )
5 V R E L AY
MODULE
2-Channel 5V Relay Module is a relay interface board, it can
be controlled directly by a wide range of microcontrollers
such as Arduino, AVR, PIC, ARM and so on. It uses a low
level triggered control signal (3.3-5VDC) to control the relay.
Triggering the relay operates the normally open or normally
closed contacts. It is frequently used in an automatic control
circuit. To put it simply, it is an automatic switch to control a
high-current circuit with a low-current signal.5V relay signal
input voltage range, 0-5V. VCC power to the system. JD-
VCC relay in the power supply. JD-VCC and VCC can be a
shorted.
The main component of the project is IR Sensor and we
have used two of them. The placement of the sensors is
important as it will determine the functioning of the project.
As the visitors start leaving the
room, the visitor count will be
decremented and when the last Practically speaking, both the
person leaves the room, the sensors must be placed on the
count be come 0. During this either side of the door or
point, the microcontroller entrance of the room. The
understands that there is nobody sensor placed on the outside of
in the room and turns OFF the the room is named as Sensor 1
light and the sensor, which is placed
on the inside is named Sensor 2.

When a person tries to leave the


room, Sensor 2 detects the
person first and then Sensor 1.
This process will make the When a person tries to enter the
microcontroller to understand room, Sensor 1 detects the
that a person is trying to leave person first and then Sensor 2.
the room and hence, it will This action will indicate the
decrement the count of visitors. 8051 Microcontroller that the
The microcontroller will not Hence, the microcontroller will turn on the person is entering the room.
turn off the light until the last light and also increments the visitor counter to
person has left the room. 1. If there are more visitor, the microcontroller
will keep the light turned on and increments
the visitor counter accordingly.

CODE
#define lcd P1
sbit rs=P3^6;
sbit e=P3^7;
sbit relay=P0^0;
sbit s1=P2^0;
sbit s2=P2^1;
void delay (int);
void cmd (char);
void display (char);
void init (void);
void string (char *);
void view (int);
int count=0;
int no[10]={48,49,50,51,52,53,54,55,56,57};
void delay (int d)
{
unsigned char i=0;
for(;d>0;d--)
{
for(i=250;i>0;i--);
for(i=248;i>0;i--);
}
}
void cmd (char c)
{
lcd=c;
rs=0;
e=1;
delay(5);
e=0;
}
void display (char c)
{
lcd=c;
rs=1;
e=1;
delay(5);
e=0;
}
void string (char *p)
{
while(*p)
{
display(*p++);
}
}
void view (int n)
{
cmd(0xc0);
display(no[(n/10)%10]);
display(no[n%10]);
}
void init (void)
{
cmd(0x38);
cmd(0x0c);
cmd(0x01);
cmd(0x80);
}
void main()
{
init();
string("counter........");
cmd(0xc0);

view(count);

while(1)
{
if(s1==1)
{
while(s2==0);
if(count!=99)
count=count+1;
while(s2==1);
view(count);
}
else if(s2==1)
{
while(s1==0);
if(count!=0)
count=count-1;
while(s1==1);
view(count);
}
else if(count==1)
relay=0;
else if(count==0)
relay=1;

}
}
O
U
T
P
U
T
WE
S U C C E S S F U L LY
IMPLEMENTED
C O N C L U S I O N A U T O M AT I C
LIGHTING SYSTEM
USING
MICROCONTROLLE
R

You might also like