You are on page 1of 13

Automatic Room Lighting System using Microcontroller

A PROJECT REPORT
SUBMITTED IN FULFILMENT OF THE
REQUIREMENTS FOR THE MID TERM EVALUATION OF
[COA 206: Computer Organization and Architecture]

SUBMITTED BY:

Isha Bashir
2K20/CO/204
JAYA DEO
2K20/CO/213
DISHA BHATI
2K20/CO/149

SUBMITTED TO:
DR. Pawan Singh Mehra

DELHI TECHNOLOGICAL UNIVERSITY


(FORMERLY DELHI COLLEGE OF ENGINEERING)
BAWANA ROAD, DELHI-110042
ABSTRACT

The Automatic Room Lighting System is a microcontroller-based system that turns on and off
the lights in a room automatically. Electricity, being one of the most valuable resources, must
be used with caution. When we leave a room, we frequently forget to turn off lights or fans.
We may purposely forget about the lights when we use this system since the system will take
care of them in the digital world. The world we live in now allows us to employ various
technologies to execute certain activities automatically. Such automation is beneficial in a
variety of areas, including energy consumption, human effort reduction, and improved living
standards, among others. The idea here is one in which a microcontroller-based system controls
the room lighting and exits the room autonomously. The goal is to detect human movement
and automatically switch on or off the lights in a room. We used an 8051 microcontroller and
two infrared (IR) sensors to make it work. Because the circuit's function is to switch on the
light when someone enters the room and turn it off after the last person leaves, the work must
count the number of visitors entering and exiting the room inside. As a result, it serves as a
bidirectional visitor counter as well as an automatic room lighting system.
ACKNOWLEDGEMENT

We Would Like To Express Our Special Thanks Of


Gratitude To Our Teacher Dr. Pawan Singh Mehra
Who Gave Us The Golden Opportunity To Do This Wonderful

Project On The Topic:


Automatic Room Lighting System using Microcontroller

Which Also Helped Us In Doing A Lot Of Research And We

Came To Know About So Many

New Things.

We Are Really Thankful To Him.

Secondly, We Would Also Like To Thank Our Parents And


Friends Who Helped Us A Lot In Finishing This

Project Within The Limited Time.

Thanks Again To All Who Helped Me


INTRODUCTION

The Automatic Room Lighting System is a microcontroller-based project that turns on and off
lights in a room automatically. Electricity, being one of the most valuable resources, must be
used with caution. When we leave a room, we frequently forget to turn off lights or fans. We
may forget about the lights when we use this system since it will take care of them
automatically. In today's digital world, we may employ many technologies to execute specific
activities automatically. Such automation is beneficial in a variety of areas, including energy
consumption, human effort reduction, and improved living standards, among others. The
project shown here is an example of this type of project, in which a microcontroller-based
system controls the room lights automatically.

The goal of this project is to detect human movement and automatically switch on or off the
lights in a room. We used an 8051 microcontroller and two infrared (IR) sensors to complete
this project. The project must internally count the number of people entering and departing the
room because the circuit's function is to turn on the light when someone enters the room and
turn off the light when the last person leaves. As a result, the project serves as a Bidirectional
Visitor Counter as well as an Automatic Room Lighting System.

COMPONENTS USED

The tools used in making this project report are:


1. 8051 Development Board
2. 8051 architecture based microcontroller
3. 2 x Infrared Sensors
4. Connecting Wires
5. 16 x 2 LCD Display
6. 5V Relay Module
7. Power Supply
8. Lamp
COMPONENTS DISCRIPTION

1. 8051 Development Board

Any of the 8051 40 pin microcontrollers may be programmed and prototyped using the 8051
Development Board. The on-board RS232 driver makes it simple to connect to a PC or other embedded
hardware (Easy to flash 89v51Rd2 Thru flash magic). User buttons and status LEDs are included on the
board. This board can be powered by both AC and DC power supply adapters thanks to the bridge
rectifier.

2. 8051 architecture based microcontroller

Intel created the 8051 microcontroller in 1981. It's a microcontroller with an 8-bit resolution.
It has a 40-pin DIP (dual inline package) with 4KB of ROM and 128 bytes of RAM and two
16-bit timers. It has four parallel 8-bit ports that may be programmed and addressed to meet
the needs of the user. The microcontroller has an on-chip crystal oscillator with a crystal
frequency of 12 MHz. Let's have a look at the 8051 Microcontroller's architecture. The system
bus connects all of the support devices to the CPU in the figure below. An 8-bit data bus, a 16-
bit address bus, and bus control signals make up the system bus.
3. Infrared Sensors
A simple circuit called an infrared or IR sensor is used to detect objects (proximity sensor) or
measure distance (Range Finder). An infrared sensor is made up of three parts: an IR transmitter
(IR LED), an IR receiver (similar to a photo diode), and a signal processing circuit. In this
project, we used reflecting type IR sensor modules. The following figure depicts the module's
detailed circuit diagram.
4. Connecting Wires
Because electricity requires a medium to go through, connecting wires allows an electrical
current to travel from one point on a circuit to another. Wires are inserted into circuit boards
of computers, transmitting electrical pulses that are interpreted as binary signals of zeros and
ones.

5. 16 x 2 LCD Display
A liquid-crystal display (LCD) is a flat-panel display or other electronically modified optical
device that employs liquid crystals and polarizers to manipulate light. Liquid crystals do not
directly generate light, but rather need a backlight or reflector to create colour or monochrome
pictures.

6. 5V Relay Module

In this project, a 5V Relay Module is utilised to allow the 8051 Microcontroller to control high
voltage AC loads such as a lamp. The Relay Module's detailed circuit is depicted in the diagram
below. A 5V Electromechanical Relay, an Optocoupler IC, a transistor, two resistors, and two
diodes make up the circuit.
THE PROJECT'S PROGRESS
In this project, an automatic room lighting system is developed using 8051 microcontroller.
The working of the project is explained here. The IR Sensor is the most important part of the
project, and we used two of them. The location of the sensors is crucial since it will impact
how well the project works.

Practically speaking, both sensors must be installed on either side of the room's door or entry.
Sensor 1 is the sensor on the outside of the room, while Sensor 2 is the sensor on the inside.
When someone attempts to enter the room, Sensor 1 detects them first, followed by Sensor 2.
The 8051 Microcontroller will be notified if someone is entering the room by this action.

As a result, the microcontroller turns on the light and increases the visitor counter by one. If
there are additional visitors, the microcontroller keeps the light on and the visitor counter is
incremented proportionately. When someone attempts to exit the room, Sensor 2 detects them
first, followed by Sensor 1. This method will cause the microcontroller to recognise that
someone is attempting to exit the room, and so the number of visits will be reduced. The light
will not be turned off until the last person has left the room, according to the microcontroller.
The visitor count will be decremented when people leave the room, and when the final person
departs, the count will be zero. The microcontroller recognises that there is no one in the room
at this moment and shuts off the light.

CODE
#include<reg51.h> void view (int);

#define lcd P1 int count=0;

sbit rs=P3^6; int


no[10]={48,49,50,51,52,53,54,55,56,57};
sbit e=P3^7;
void delay (int d)
sbit relay=P0^0;
{
sbit s1=P2^0;
unsigned char i=0;
sbit s2=P2^1;
for(;d>0;d--)
void delay (int);
{
void cmd (char);
for(i=250;i>0;i--);
void display (char);
for(i=248;i>0;i--);
void init (void);
}
void string (char *);
}
void cmd (char c) }

{ void init (void)

lcd=c; {

rs=0; cmd(0x38);

e=1; cmd(0x0c);

delay(5); cmd(0x01);

e=0; cmd(0x80);

} }

void display (char c) void main()

{ {

lcd=c; init();

rs=1; string("counter........");

e=1; cmd(0xc0);

delay(5); view(count);

e=0; while(1)

} {

void string (char *p) if(s1==1)

{ {

while(*p) while(s2==0);

{ if(count!=99)

display(*p++); count=count+1;

} while(s2==1);

} view(count);

void view (int n) }

{ else if(s2==1)

cmd(0xc0); {

display(no[(n/10)%10]); while(s1==0);

display(no[n%10]); if(count!=0)
count=count-1; relay=0;

while(s1==1); else if(count==0)

view(count); relay=1;

} }

else if(count==1) }

Fig: Circuit diagram for automatic room lighting system using microcontroller
APPLICATIONS
1. When a person enters a room, the Automatic Room Lighting with Bidirectional
Visitor Counter may be used to automatically turn on the light and turn it off when the
person leaves.
2. The project, also known as a Bidirectional Visitor Counter, is an important component
of the Automatic Room Lighting system.
3. LEDs may be added to the project, and as the number of people in the room grows, so
does the number of LEDs that turn on.

CONCLUSIONS
In this competitive world of power, this project compacts with the use of energy. It is well-
organized enough to inform someone of the correctness of the person who entered and exited
the room. It is quite difficult to count the number of people in a large venue because of the
congestion. In such a case, this proves to be a helpful hand because it displays the count on an
LCD display. It also adjusts the lighting system automatically based on the number of people
in the room. As the number of people in a room grows, so does the number of lights that are
turned on. As the number of people in a room decreases, the number of lights that are turned
on will drop. As the number of people in a room grows, so does the number of lights that are
turned on. As the number of people in a room decreases, the number of lights that are turned
on will drop. A voice alarm system might be implemented in the future to notify that the room
is filled and that no one can enter. By installing an external EEPROM IC, we can expand the
number of people who can be counted and transfer the data to a remote place through mobile
or the internet.

REFERENCES

1. http://mjbas.com/data/uploads/5006.pdf#:~:text=ABSTRACT%20Automatic%20Room%20Li
ghting%20System%20is%20a%20microcontroller,lights%20or%20fans%20when%20we%20le
ave%20a%20room.
2. Automatic Room Lighting System using Microcontroller (electronicshub.org)

You might also like