Sie sind auf Seite 1von 5

Automatic Room Light

Controller using Digital


Visitor Counter
Sugandha Gupta, Sanjana Jain, Anoop Yadav
Department of Electrical Engineering
NIT Kurukshetra, Kurukshetra
India
sugandha2395@gmail.com
san10dec@gmail.com

Abstract The project of Automatic Room Light Controller is


based on the interfacing of some components such as sensors,
motors etc. with Arduino microcontroller. This counter can count
people in both directions. This project is divided in three parts
which are circuit of the system, block diagram and programming.
The design of automatic room light controller is made up with a
working combination of mainly four subsystems which are sensors,
controller, display and relay driver systems. The sensor would
observe an interruption and provide an input to the controller
which would run the counter increment or decrement depending on
entering or exiting of the person.
KeywordsLight controller, IR sensor, Gate, counter, arduino
microcontroller
Introduction

In todays world with the increasing demand of energy and


the continuous depletion of resources there is a need to
adopt possible measures to save power wherever possible.
With advent of automation technologies, several methods
can be applied to avoid wastage of energy. This paper
proposes an idea to prevent unnecessary consumption of
energy in the form of internal electrification of an enclosed
space by closing switches of all appliances in the room
which are not required to be used when people are not
present inside the room. This will be a big step towards the
energy efficient lightning systems by optimization of the
use of appliances in a room. This will also lead to reduced
electricity bills for the consumers and in the long run will
become a keystone in modern home automation systems.
Often we see visitor counters at stadium, mall, offices, class
rooms etc. How they count the people and turn on or off the
light when nobody is inside. This paper explains the design
of a digital visitor counter which uses two Infrared sensor
transmitter and receiver pairs[2] to detect the entrance and
exit of person in a room. The controlling of the circuit is
done using UNO Arduino microcontroller[1]. The outputs
of comparators are connected to digital pins of the arduino.
Display section will display the counted number of people
inside the room. A relay driver circuit is added to get
enough voltage and current for relay. Arduino sends

Atma Ram Gupta

Assistant Professor
Department of Electrical Engineering
NIT Kurukshetra, Kurukshetra
India
argupta@nitkkr.ac.in
commands to this relay driver transistor and then light bulb
will turn on and off accordingly. By using digital LCD
display the total count of people in the room can be known
and this information may be useful for many purposes.
I.

COMPONENTS DESCRIPTION

The design of automatic room light controller[3] is made up


with a working combination of mainly four subsystems i.e
sensors, controller, display and relay driver systems.
A. Sensor
In the sensor subsystem two Infra-red(IR) sensor[2]
modules are being used. Each module consists of a pair of IR
transmitter and receiver. A comparator is used where a
reference voltage is set. When the IR sensor detects an
interruption from an object it causes a voltage difference
across the comparator and thus generates a voltage signal at
the output. The reference voltage is set using a potentiometer.
To differentiate between the people entering and leaving the
room a delay is used.
B. Controller
Arduino UNO[1] is used for controlling the whole process
of digital visitor counter system. The outputs of comparator
are connected to the digital pins of the arduino. Arduino
programming is done so as to process the system and send the
signals to the relay driver circuit to drive the circuit. Arduino
consists of both a physical programmable circuit board and a
piece of software or IDE (Integrated Development
Environment)[4] that runs on computer, used to write and
upload computer code to the physical board.
C. Relay Driver Circuit
The relay is used to control the light bulb which indicates
the presence or absence of people in the room. Relay driver
circuit consists of a transistor and a relay. As the arduino does
not supply enough voltage to drive a relay a transistor is used
to amplify the current to drive the relay which in turn controls
the switching of the bulb. The relay works on the count
provided by the counter and when the count becomes zero the
relay turns the light off.

D. Display
A 16x2 alphanumeric LCD display is used to display the
number of people present in the room. The LCD display is
directly controlled by the Arduino UNO. The display depends
upon the increment and decrement count made by the counter.
II.

WORKING

The whole working of the automatic room light controller[3]


with digital visitor counter is based upon the action of sensors
with signal processed by the arduino UNO controller[1] which
in turn drives the relay to control switching of the equipments
inside the room.

blockistosensetheperson.Forsensingtheperson
we are using a TSOP1738 sensor. By using this
sensoranditsrelatedcircuitdiagramwecancount
thenumberofpersons.
Arduino UNO microcontroller[1] - The Arduino Uno
is a microcontroller board based on the ATmega328 .
It has 14 digital input/output pins of which 6 can be
used as PWM outputs, 6 analog inputs, a 16 MHz
crystal oscillator, a USB connection, a power jack,
an ICSP header, and a reset button. It contains
everything needed to support the microcontroller.
Alphanumeric LCD display - Inthissectionwehave
usedLCDdisplaystodisplaynumberofpersonsin
theroom.Wehaveusedtransistorfordisplaydrive
circuit. This display should be placed outside the
room. It displays various messages like Person
Counter
Incremented,
Person
Counter
Decremented, No of Person in Room = XYZ here
XYZ is the actual person count.
Relay Driver Circuit - Inthissectionwehaveused
the transistor and the relays. Output signal from
microcontrollerisgiventothebaseofthetransistor,
whichenergizestheparticularrelay,becauseofthis,
appropriatedeviceisselectedandwhichperformsits
allottedfunction.

Fig. 1. Block Diagram of Automatic room light controller

The basic block diagram[6] of the bidirectional digital visitor


counter is shown in figure 1. Two pairs of Infrared transmitter
and receivers are placed at the entry of the closed room in
such a manner that sensor pair 1 falls before the sensor pair 2
in the arrangement. IR sensors are being used because they
cannot be detected by human eyes. Also IR sensors possess
another advantage that they are not triggered by any other
source in the environment. If the sensor 1 is interrupted first
then the controller will look for sensor 2 and if it is interrupted
then the arduino will increment the count and will switch the
relay. If the sensor 2 is interrupted first then the controller will
look for sensor 1 and if it is interrupted then the arduino will
decrement the count and will switch the relay.

Power Supply - Herewehaveused+5Vdcpower


supply.Themainfunctionofthisblockistoprovide
therequiredamountofvoltagetoessentialcircuits.
+9V is given to relay driver. To get the +5V dc
powersupplyarduinoisusedasthesourceandno
separatedcsupplywillberequired.
Transmitter Section - Inthissectionwehaveused
555TimerICasAstableMultivibrator[5]togenerate
38kHzsquarewavepulseforcontinuouslyblinking
ofIRLEDasatransmittercircuit.Wehaveusedtwo
transmittercircuits,oneforEntersensor&second
forExitsensorcircuit.WecanalsouseRCcircuit
with 555 Timer IC[5] to generate 38 kHz square
wavepulseforcontinuouslyblinkingofIRLED[2]
asatransmittercircuit.
Enter and Exit Sensor Circuit - Thisisoneofthe
mainpartsofourproject.Themainintentionofthis

Fig. 2. Flow chart of automatic room light controller[6]

III.

ALGORITHM

Figure 3 represents the interfacing of various circuit


components along with the pin connections[9]. Here in this
circuit we have used two comparators for two IR sensors.
LM358[5] is used as comparator. LM358 has inbuilt two
low noise Op-amp. The output pins of the sensor are
connected to the digital pin no. 14(A0) and 19(A5) of the
Arduino UNO R3 which are the input pins as shown.
Arduino read these signals and send commands to relay
driver circuit to drive the relay for light bulb controlling .
Relay driver section consist a BC547 transistor and a 5 volt
relay for controlling the light bulb. The relay driver
transistor is connected to digital pin 2 of the Arduino. LCD
is connected in 4 bit mode. RS and EN pin of LCD is

directly connected at 13 and 12. Data pin of LCD D4-D7 is


also directly connected to arduino at D11-D8 respectively.

The functions defined as IN and OUT are respectively


the functions which will sense the entry and exit of the
people in the room.
V.

Fig. 3. Interfacing diagram[3]

IV.

CODE EXPLANATION

The coding[3] for the arduino microcontroller[1] is the


major play master of the whole project. Arduino programming
is basically a physical computing process. Physical computing
is concerned with developing software that interacts with the
world beyond the host computer through a combination of
hardware and software. The Arduino interacts with the world
through actuators and sensors. One common way sensors work
is that their electrical properties change as an effect of the
changes in the conditions in which it is operating. Actuators,
on the other hand, are electronic components that are used to
react to an external event. Sensors and actuators, thus, are
used to achieve complementary objectives: one senses, and the
other reacts. The Arduino is an open-source electronics
prototyping platform composed of two major parts: the
Arduino board which is the hardware interface and the
Arduino IDE[4] which is the software. The Arduino IDE[4] is
used to write the program that will interact with Arduino board
and the devices connected to it. In the Arduino world, such a
program is called a sketch, which has its origin in its mother
language.

First the library for LCD is included and pins are


defined for the same. And also input output pins are
defined for sensors and relay. The pins for LCD are
from 9 to 13. Input pin is at 14, output pin is at 19 and
relay is connected at pin 2.

Next a loop is created which is used for initialization


of the LCD setup. At the beginning of the program the
LCD will display a message of Visitor Counter.
Using the pinmode function the pins in and out are
defined as input pins and relay is defined as output
pin.

In loop function we read sensors input and increment


or decrement the counting depending upon enter or
exit operation. Zero condition is also checked. Zero
condition means number of people in the room are
zero. If zero condition is true then arduino turns off
the bulb by deactivating the relay through transistor.
And if zero condition is false then arduino turns on the
light.

TEST SETUP

Given below is the test setup of the arduino based automatic


room light controller using digital visitor counter. In front
of the IR sensors we are required to place a black screen as
it absorbs all the light. Any object passed through these
sensors can now be easily detected by the sensors. To
provide 5V dc supply to the test setup arduino will itself
act as the source. When we connect the arduino to a
computing unit via USB cable the pin number 16 of the
will act as a 5V source. Instead of a 220V AC supply in the
relay driver circuit a 9V battery is being used as the LED
will represent the light in the room. Hence a battery can be
used to light up the LED bulb. For the liquid Crystal
Display, 5 pins of the the arduino are interfaced with the
LCD.

Fig. 4. Test Setup

VI.

CONCLUSION

The following project has been developed as the part of


home automation system that aims at reducing the wastage of
energy at work places and at home. Also the set up enables the
person to know the number of people present in an enclosed
space. Such a knowledge is useful when there is a need to
reduce congestion in the room or to know the exact number of
people present at a social gathering like a sports complex or a
conference room etc. Such a project can prove to be very
useful in terms of increasing concerns for security issues in
todays world. Also it would prevent any unnecessary wastage
of energy which may be caused due to human negligence.

Applications - Digital Visitor Counter can be used in


various rooms like seminar hall, conference
hall where the capacity of room is limited and should
not be exceeded. Project will display actual number
of persons inside the room. This project can be used

in Cinema halls, multiplex, malls as well as in


temples to count the number of person entering
inside. So that these places should not get over
crowded to avoid congestion. It can also be used in
classrooms and studyrooms in schools and colleges.
Advantages - Main advantage of this project is that it
helps in energy conservation. Because when there is
nobody inside the room then lights are automatically
turned off. Human efforts to count the number of
person are eliminated. Since this project does the
automatic person counting with the help of two
sensors installed on door frame.
VII.

lights. Thus we can reduce the unnecessary wastage of energy.


We can automatically monitor the light availability in a room.
Light intensity in the range of 90 to 100 percent is optimum
for normal sight. If intensity is greater than 90 percent, no
lighting is required. Subsequently for every 20 percent drop in
intensity a 10 Watts lamp is turned ON to maintain optimum
lighting.

Acknowledgment
We would also like to show our gratitude to Professor Atma
Ram Gupta ,NIT Kurukshetra for sharing their pearls of
wisdom with us during the course of this research.

FUTURE SCOPE

To make further enhancements in our project a very good


addition will be that of a LDR which is Light Dependent
Resistor [8]. It controls the amount of lighting in a room by
constantly monitoring the level of luminance in a room .LDR
is a variable resistor whose resistance is inversely proportional
to the intensity of the incident light. As it is a passive
transducer, a potential divider circuit is used to obtain the
corresponding voltage value from the LDRs. The higher the
intensity of light, lower the LDR resistance and hence lower
the output voltage and vice versa. Lights are then controlled
such that required illumination is available in the room. It can
be applied effectively in commercial buildings, homes,
colleges etc. On a normal day when there is a bright sun the
lights will be OFF. And on a cloudy day the illumination
levels will be low the controller calculates the required
lighting by checking the illumination level and turns ON the

References
[1]
[2]

[3]
[4]
[5]
[6]
[7]
[8]
[9]

Alan G. Smith, Introduction to Arduino, September 30, 2011


T. S. Jayadev, Infrared sensors: detectors, electronics, and signal
processing, Society of Photo-optical Instrumentation Engineers 24th july
1999
http://circuitdigest.com/microcontroller-projects/automatic-room-lightcontroller-with-bidirectional-visitor-counter-using-arduino
https://en.wikipedia.org/wiki/Integrated_development_environment
http://www.engineersgarage.com/tutorials/555-timer-ic-introductionbasics-working-different-operating-modes
http://www.ti.com/product/LM358.
http://www.slideshare.net/SINGHNIKHIL/automaticroomlightcontroller
withbidirectionalvisitorcounter
http://www.electrical4u.com/light-dependent-resistor-ldr-workingprinciple-of-ldr/
http://www.academia.edu/1409805/Automatic_Room_Light_Controller_
with_Bidirectional_Visitor_Counter

Das könnte Ihnen auch gefallen