Professional Documents
Culture Documents
Automatic Bidirectional Visitor Countor & Temp Controller
Automatic Bidirectional Visitor Countor & Temp Controller
Automatic Bidirectional Visitor Countor & Temp Controller
Declaration
We Eleyas Bekele, Gashaw Shimelash, Ayena Wakene and Teshale Kebede being members of
group Eight, declare that this report contains only work completed by members of our group except
for information obtained in a legitimate way from literature review. We clarify that our work is
based on project writing Guide line given by the Institute
1. ELEYAS BEKELE………………….04369/06
2. GASHAW SHIMELASH……………04481/06
3. AYENA WAKENE…………………..04143/06
4. TESHALE KEBEDE………………...05176/06
BIDIRECTIONAL VISITOR COUNTER AND TEMPRATURE CONTROLLER
Acknowledgement
Our deepest gratitude and appreciation goes to our Advisor Mr. V. ANAND for his constructive
Advises, feedbacks and suggestions until the end of the project. We consider ourselves very
fortunate for being able to work with a very considerate and encouraging advisor like him. And
also we would like to extend our appreciation and thanks to our instructors for providing some
useful advice and feedback while we are doing the project. Finally our gratitude goes to JIMMA
INSTITUTE OF TECHNOLOGY for giving the chance to do project.
i|Page
BIDIRECTIONAL VISITOR COUNTER AND TEMPRATURE CONTROLLER
ABSTRACT
The need for a device that can automatically capable of taking count of number of people
in a room and control their safty by controlling the temperature on its own has been needed. It is
the need of time to revolutionize the traditional methods of counting visitors inside hotels,
recreational places, meeting rooms and cinemas. In this system a person who inter to the desired
place is counted and number is displayed on the LCD and also a system decrement the number of
the person when someone leave the place. This increment and decrement is done by considering
the two IR sensors. One IR sensor for increment and the other for decrement purpose. This system
also used to control the temperature of the room when someone inters to the place and make the
fun start when the temperature is above the threshold level.
ii | P a g e
BIDIRECTIONAL VISITOR COUNTER AND TEMPRATURE CONTROLLER
Table of Contents
Acknowledgement ..................................................................................................................................... i
ABSTRACT.................................................................................................................................................. ii
CHAPTER ONE ............................................................................................................................................... 1
INTRODUCTION ............................................................................................................................................. 1
1.1 Project background ............................................................................................................................. 2
1.2 statement of the problem................................................................................................................... 2
1.3 project Objective................................................................................................................................. 2
1.3.1 General objective ............................................................................................................................. 2
1.3.2 Specific objective ............................................................................................................................. 2
1.4 Scope of the project ............................................................................................................................ 2
CHAPTER TWO .............................................................................................................................................. 3
LITERATURE REVIEW ................................................................................................................................. 3
2.1 IR radiation .......................................................................................................................................... 3
2.1.1 Properties of infrared system ...................................................................................................... 3
2.1.2 Advantages over RF...................................................................................................................... 4
CHAPTER THREE ............................................................................................................................................ 5
OVERVIEW OF THE PROJECT ..................................................................................................................... 5
3.1 Block diagram...................................................................................................................................... 5
CHAPTER FOUR ............................................................................................................................................. 8
SYSTEM DESIGN AND IMPLIMENTATION .................................................................................................. 8
4.1 Circuit Design ...................................................................................................................................... 8
4.2 Circuit operation ................................................................................................................................. 8
4.3 A general description of the component used ................................................................................... 9
ARDUINO UNO .......................................................................................................................................... 9
CHAPTER FIVE ............................................................................................................................................. 14
SIMULATION RESULT & DISCUSSION ...................................................................................................... 14
CHAPTER SIX................................................................................................................................................ 16
CONCLUSION AND RECOMMENDATION ................................................................................................ 16
6.1 Conclusion ......................................................................................................................................... 16
6.2 Recommendation.............................................................................................................................. 16
BIDIRECTIONAL VISITOR COUNTER AND TEMPRATURE CONTROLLER
List of Figure
Figure 3.1 Block diagram of Bidirectional Visitor counter and temperature controller……………………..5
Figure 4.1 Bidirectional Visitor counter and temperature controller circuit diagram………………………8
CHAPTER ONE
INTRODUCTION
This project titled “Bidirectional Visitor counter and temperature controller” is designed
and presented in order to count the visitors of an offices, malls, sports venue, hospitals and control
the temperature by considering the visitors entering and other natural phenomena’s. The system
counts both the entering and exiting visitor of the hall or other place, where it is placed. Depending
upon the interrupt from the sensors, the system identifies the entry and exit of the visitor. This
system can be implemented in all the places where the visitors have to be counted and their safety
should be controlled.
Bidirectional Visitor Counter is a system used to count the visitors entering and leaving a
room and control the temperature of the place where they are. The word bidirectional signifies the
count of both types i.e. entering and leaving. Bidirectional counters are designed accordance with
the real time demands. The design becomes important for single door systems where all the visitors
are going in and coming out through a single channel
Visitor counter and temperature controller is a reliable circuit that takes over the task of
counting number of Persons Visitors in the Room very accurately and monitor their room’s
temperature. When somebody enters into the Room then the Counter is Incremented by one. The
total number of Persons inside the Room is displayed on the LCD module. The Arduino does the
above job it receives the signals from the sensors, and this signals operated under the control of
software which is stored in ROM.
This circuit divided in four parts: sensor, controller, counter display and fun motor. The
sensor part divide in to two, one is the two PIR sensor that would observe an interruption and
provide an input to the controller which would run the counter to count up or down. The same
count is displayed on LCD. The other is temperature sensor which sense the temperature and
provide input to the controller which allow the value to be displayed and the fun to run.
As it is known, when there is a lot of people in a limited area the temperature of the room
will change accordingly.so the temperature controller used to control the temperature of the room
by allowing the fun to run when it is necessary and deny the permission when the temperature is
low(the number of visitors decrease).
1|Page
BIDIRECTIONAL VISITOR COUNTER AND TEMPRATURE CONTROLLER
2|Page
BIDIRECTIONAL VISITOR COUNTER AND TEMPRATURE CONTROLLER
CHAPTER TWO
LITERATURE REVIEW
2.1 IR radiation
Infrared (IR) radiation is a type of electromagnetic radiation. Infrared light has a longer
wavelength than visible light. The infrared has a wavelength of 750 nm to 100 µm. The infrared
radiation is invisible to humans but we can feel it as heat. Infrared region can further be divided
into sub-regions as follows:
The MWIR and LWIR is known as the thermal infrared. All objects emit IR known as
black body radiation (thermal radiation). This is emitted from the surface of an object which is due
to its temperature. Human body at normal body temperature radiates IR approximately at
wavelengths around 9.4 µm.
Pyro electricity (from the Greek pyro, fire, and electricity) is the ability of certain materials
to generate a temporary electrical potential when they are heated or cooled. It is a migration of
positive and negative charge to opposite ends of a crystal's polar axis as a result of a change in
temperature, and this causes an electrical polarization. This polarization change gives rise to a
temporary electric potential, although this disappears after the dielectric relaxation time
3|Page
BIDIRECTIONAL VISITOR COUNTER AND TEMPRATURE CONTROLLER
b) Higher security
IR also presents advantages over radio in terms of security. Because IR radiation behaves like
visible light, it does not penetrate walls, which means that the room where the energy is generated
encloses the emitted signal completely (assuming there are no windows or transparent barriers
between rooms). This prevents the transmitted information from being detected outside and
implies intrinsic security against eavesdropping. In addition, IR offers the possibility of rapid
wireless deployment and the flexibility of establishing temporary communication links.
a) Low cost
4|Page
BIDIRECTIONAL VISITOR COUNTER AND TEMPRATURE CONTROLLER
CHAPTER THREE
OVERVIEW OF THE PROJECT
3.1 Block diagram
Power supply
PIR LCD
SENSOR 1
ARDUINO UNO
PIR
SENSOR 2
RELAY FAN
TEMPRATURE
SENSOR
Figure 3.1 Block diagram of Bidirectional Visitor counter and temperature controller
The basic block diagram of the bidirectional visitor counter is shown in the above figure. Mainly
this diagram consist of the following essential blocks
Power supply
Arduino uno
Relay
PIR sensor
Temperature sensor
Fun motor
LCD
5|Page
BIDIRECTIONAL VISITOR COUNTER AND TEMPRATURE CONTROLLER
Power supply
Here we use +5v dc power supply, the main function of this block is to provide the required
amount of voltage to essential circuits. +5v is given to two PIR sensor, Arduino uno and LCD
device and also we use 24v battery for the fan motor.
Arduino uno
This block contain Arduino uno. That controls everything in the circuit. It accept the data
from the two types of sensors(PIR sensors and temperature sensor) and order the LCD to right
the number of the objects pass through the sensors and allow the fun to run when it is necessary
according to the temperature sensor. It allow the number of visitors to increase and decrease by
referring the two PIR sensor.
Relay
The term Relay generally refers to a device that provides an electrical connection between
two or more points in response to the application of a control signal. The most fundamental control
of any equipment is the ability to turn it “ON” and “OFF”. The easiest way to do this is using
switches to interrupt the electrical supply. Although switches can be used to control something,
they have their disadvantages. The biggest one is that they have to be manually (physically) turned
“ON” or “OFF”.
Here, relay do normal switching “ON” and “OFF”. When the temperature become greater
than that of the threshold temperature the output pin of arduino become high and make the relay
ON state otherwise it is at OFF state.
PIR sensor
PIR sensors used to sense motion, almost always used to detect whether a human has
moved in or out of the sensors range. They are small, inexpensive, low-power, easy to use. For
that reason they are commonly found in appliances and gadgets used in homes or businesses. They
are often referred to as PIR, "Passive" or “Pyro electric" IR motion sensors.
6|Page
BIDIRECTIONAL VISITOR COUNTER AND TEMPRATURE CONTROLLER
Two PIR sensors are used each for up and down counting respectively. Whenever an
interruption is observed by the first PIR sensor, it increments the counter value. Similarly, when
the second sensor detects an obstacle, the count is decremented. The count value is calculated
depending upon this sensors input and is displayed on a LCD
Temperature sensor
This block contain a Temperature Sensor which is a great chip for measuring temperature.
Here we use a temperature sensor called LM35, which is low voltage, precision centigrade
temperature sensors. It provide a voltage output that is linearly proportional to the Celsius
(centigrade) temperature.
LCD is the most basic electronic display device that can display digits. They find wide
application in devices that display numeric information like digital clocks, radio, microwave
ovens, electronic meters etc., so it used to display the counted number corresponding to the two
PIR sensors. Here the LCD is ordered by the controller (Arduino).
Fan motor
This block contain a fun motor (24V DC Motor) which used to maintain the temperature
of the desired place by rotating when the temperature is greater than the threshold value.24V DC
Motor is any of a class of rotary electrical machines that converts direct current electrical power
into mechanical power.
7|Page
BIDIRECTIONAL VISITOR COUNTER AND TEMPRATURE CONTROLLER
CHAPTER FOUR
SYSTEM DESIGN AND IMPLIMENTATION
4.1 Circuit Design
LM016L
BATTERY
9V
LCD1
VDD
VSS
VEE
RW
RS
D0
D1
D2
D3
D4
D5
D6
D7
E
1
2
3
4
5
6
7
8
9
10
11
12
13
14
RELAY
5V
0 0
13
12
11
10
9
8
7
6
5
4
3
2
1
0
DUINO1
PB5/SCK
PD4/T0/XCK
PB0/ICP1/CLKO
AREF
TX PD1/TXD
RX PD0/RXD
PD7/AIN1
~ PD6/AIN0
~ PD5/T1
~ PD3/INT1
PD2/INT0
~PB3/MOSI/OC2A
~ PB2/SS/OC1B
~ PB1/OC1A
PB4/MISO
ARDUINO UNO R3
DIGITAL (~PWM)
TestPin
Vcc OUT GND
TestPin
ATMEGA328P-PU Vcc OUT GND
1121
microcontrolandos.blogspot.com
PC4/ADC4/SDA
PC5/ADC5/SCL
ANALOG IN
PC0/ADC0
PC1/ADC1
PC2/ADC2
PC3/ADC3
RESET
A0
A1
A2
A3
A4
A5
2
VOUT
www.TheEngineeringProjects.com
27.0
1
www.TheEngineeringProjects.com
3
PIR2
PIR SENSOR
U1 PIR1
LM35
PIR SENSOR
Figure 4.1 Bidirectional Visitor counter and temperature controller circuit diagram
8|Page
BIDIRECTIONAL VISITOR COUNTER AND TEMPRATURE CONTROLLER
The ATmega328 has 32 KB (with 0.5 KB involved by the boot loader). It likewise has 2 KB of
SRAM and 1 KB of EEPROM (which can be perused and composed with the EEPROM library).
9|Page
BIDIRECTIONAL VISITOR COUNTER AND TEMPRATURE CONTROLLER
5) Driven: 13. There is an implicit LED driven by advanced pin 13. At the point when the pin
is HIGH esteem, the LED is on, when the pin is LOW, it's off.
6) TWI: A4 or SDA pin and A5 or SCL pin. Support TWI correspondence utilizing the Wire
library.
The Uno has 6 simple Analog inputs, named A0 through A5, each of which give 10 bits of
determination (i.e. 1024 unique qualities).
There are a few different pins on the board:
1) AREF. Reference voltage for the simple inputs. Utilized with analog Reference.
2) Reset. Convey this line LOW to reset the microcontroller. Normally used to add a reset
catch to shields which obstruct the one on the board.
A 16x2 LCD means it can display 16 characters per line and there are 2 such lines. In this
LCD each character is displayed in 5x7 pixel matrix. This LCD has two registers, namely,
Command and Data. The command register stores the command instructions given to the LCD. A
command is an instruction given to LCD to do a predefined task like initializing it, clearing its
screen, setting the cursor position, controlling display etc. The data register stores the data to be
displayed on the LCD. The data is the ASCII value of the character to be displayed on the LCD.
PIR SENSOR
The PIR (Passive Infra-Red) Sensor is a pyro electric device that detects motion by sensing
changes in the infrared (radiant heat) levels emitted by surrounding objects. This motion can be
detected by checking for a sudden change in the surrounding IR pattern. When motion is detected
the PIR sensor outputs a high signal on its output pin. This logic signal can be read by a
microcontroller or used to drive an external load; see the source current limits in the features list
below
PIRs are basically made of a pyro electric sensor, which can detect levels of infrared
radiation. Everything emits some low level radiation, and the hotter something is, the more
radiation is emitted. The sensor in a motion detector is actually split in two halves.
The PIR sensor has two slots in it, each slot is made of a special material that is sensitive
to IR. When the sensor is idle, both slots detect the same amount of IR, the ambient amount
radiated from the room or walls or outdoors .When a warm body like a human or animal passes
by, it first intercepts one half of the PIR sensor, which causes a positive differential change between
the two halves. When the warm body leaves the sensing area, the reverse happens, whereby the
sensor generates a negative differential change. These change pulses are what is detected
Features
11 | P a g e
BIDIRECTIONAL VISITOR COUNTER AND TEMPRATURE CONTROLLER
12 | P a g e
BIDIRECTIONAL VISITOR COUNTER AND TEMPRATURE CONTROLLER
LM35 is a very low cost and easily available Sensor. Main advantage of LM35 is that it is
linear i.e. 10mv/°C which means for every degree rise in temperature the output of LM35 will rise
by 10mv. So if the output of LM35 is 220mv/0.22V the temperature will be 22°C. So if room
temperature is 32°C then the output of LM35 will be 320mv i.e. 0.32V.
RELAY
Relays are one of the oldest, simplest, and yet, easiest and most useful devices. Before the
advent of the mass produced transistor, computers were made from either relays or vacuum tubes,
or both. A relay, quite simply, is a small machine consisting of an electromagnet (coil), a switch,
and a spring. The spring holds the switch in one position, until a current is passed through the coil.
The coil generates a magnetic field which moves the switch. It's that simple. Anyone can use a
very small amount of current to activate a relay, and the switch can often handle a lot of current.
13 | P a g e
BIDIRECTIONAL VISITOR COUNTER AND TEMPRATURE CONTROLLER
CHAPTER FIVE
SIMULATION RESULT & DISCUSSION
Case 1:
No one intercept the sensor
LM016L
BATTERY
9V
LCD1
VDD
VSS
VEE
RW
RS
D0
D1
D2
D3
D4
D5
D6
D7
E
1
2
3
4
5
6
7
8
9
10
11
12
13
14
RELAY
5V
0 0
13
12
11
10
9
8
7
6
5
4
3
2
1
0
DUINO1
PB5/SCK
PD4/T0/XCK
PB0/ICP1/CLKO
AREF
TX PD1/TXD
RX PD0/RXD
PD7/AIN1
~ PD6/AIN0
~ PD5/T1
~ PD3/INT1
PD2/INT0
~PB3/MOSI/OC2A
~ PB2/SS/OC1B
~ PB1/OC1A
PB4/MISO
ARDUINO UNO R3
DIGITAL (~PWM)
T estPin
Vcc OUT GND
T estPin
ATMEGA328P-PU Vcc OUT GND
1121
microcontrolandos.blogspot.com
PC4/ADC4/SDA
PC5/ADC5/SCL
ANALOG IN
PC0/ADC0
PC1/ADC1
PC2/ADC2
PC3/ADC3
RESET
A0
A1
A2
A3
A4
A5
2
VOUT
www.T heEngineeringProjects.com
27.0
1
www.T heEngineeringProjects.com
3
PIR2
PIR SENSOR
U1 PIR1
LM35
PIR SENSOR
BATTERY
9V
LCD1
VDD
VSS
VEE
RW
RS
D0
D1
D2
D3
D4
D5
D6
D7
E
1
2
3
4
5
6
7
8
9
10
11
12
13
14
RELAY
5V
0 1
13
12
11
10
9
8
7
6
5
4
3
2
1
0
DUINO1
PB5/SCK
PD4/T0/XCK
PB0/ICP1/CLKO
AREF
TX PD1/TXD
RX PD0/RXD
PD7/AIN1
~ PD6/AIN0
~ PD5/T1
~ PD3/INT1
PD2/INT0
~PB3/MOSI/OC2A
~ PB2/SS/OC1B
~ PB1/OC1A
PB4/MISO
ARDUINO UNO R3
DIGITAL (~PWM)
T estPin
Vcc OUT GND
T estPin
ATMEGA328P-PU Vcc OUT GND
1121
microcontrolandos.blogspot.com
PC4/ADC4/SDA
PC5/ADC5/SCL
ANALOG IN
PC0/ADC0
PC1/ADC1
PC2/ADC2
PC3/ADC3
RESET
A0
A1
A2
A3
A4
A5
2
VOUT
www.TheEngineeringProjects.com
26.0
1
www.TheEngineeringProjects.com
3
PIR2
PIR SENSOR
U1 PIR1
LM35
PIR SENSOR
14 | P a g e
BIDIRECTIONAL VISITOR COUNTER AND TEMPRATURE CONTROLLER
Case 3:
Somebody intercept sensor 2
LM016L
BATTERY
9V
LCD1
VDD
VSS
VEE
RW
RS
D0
D1
D2
D3
D4
D5
D6
D7
E
1
2
3
4
5
6
7
8
9
10
11
12
13
14
RELAY
5V
1 0
13
12
11
10
9
8
7
6
5
4
3
2
1
0
DUINO1
PB5/SCK
PD4/T0/XCK
PB0/ICP1/CLKO
AREF
TX PD1/TXD
RX PD0/RXD
PD7/AIN1
~ PD6/AIN0
~ PD5/T1
~ PD3/INT1
PD2/INT0
~PB3/MOSI/OC2A
~ PB2/SS/OC1B
~ PB1/OC1A
PB4/MISO
ARDUINO UNO R3
DIGITAL (~PWM)
TestPin
Vcc OUT GND
TestPin
ATMEGA328P-PU Vcc OUT GND
1121
microcontrolandos.blogspot.com
PC4/ADC4/SDA
PC5/ADC5/SCL
ANALOG IN
PC0/ADC0
PC1/ADC1
PC2/ADC2
PC3/ADC3
RESET
A0
A1
A2
A3
A4
A5
2
VOUT
www.TheEngineeringProjects.com
27.0
1
www.TheEngineeringProjects.com
3
PIR2
PIR SENSOR
U1 PIR1
LM35
PIR SENSOR
15 | P a g e
BIDIRECTIONAL VISITOR COUNTER AND TEMPRATURE CONTROLLER
CHAPTER SIX
CONCLUSION AND RECOMMENDATION
6.1 Conclusion
From the whole project we conclude that by doing some modification, the area of
application can be extended in various fields’ i.e. automatic light system. This project gives us a
great deal of knowledge about the arduino chips, and the PIR. This type of device provides us with
the working of arduino chips and the PIR. PIR is a type of sensor which provides a sensing only
(mostly) when human being pass through it. In this project as soon as the PIR sense the arduino
accept the input and allow or deny a conducting path to be established between terminals of it and
the load.
This circuit is very simple to make and is very useful to the places where counting visitors
is needed. But the major disadvantage of this circuit is that it count visitors who pass
simultaneously in the same PIR sensor as one. So care has to be taken to avoid this kind of false
counting and the circuit should not be used in two different doors. In conclusion, this project is a
design which should be encouraged and put into large scale manufacturing because of its various
advantages.
6.2 Recommendation
This project is a viable one in the sense that it will go a long way in making it more
convenient easier for users to easily control their appliances, lighting points automatically in their
homes, hotel, conference rooms, and classrooms. Because of its importance as a household need,
efforts must be geared towards designing a viable project like this one. we strongly recommend that
the department should see this project as a priceless possession and should try to provide financial
assistance and more research works relating to this project to support and encourage students who
tries to do this type of project.
16 | P a g e
BIDIRECTIONAL VISITOR COUNTER AND TEMPRATURE CONTROLLER
References
http://www.engineersgarage.com/electronic-components/atmega328P-microcontroller.
www.datasheets4u.com
http://electronicshub.com/microcontroller-projects/automatic-room-light-controller-with-
bidirectional-visitor-counter-using-arduino
http://www.pelonistechnologies.com/blog/advantages-and-disadvantages-of-ac-fans-and-dc-
fans
17 | P a g e
BIDIRECTIONAL VISITOR COUNTER AND TEMPRATURE CONTROLLER
Appendix
#include<LiquidCrystal.h>
LiquidCrystal lcd(2,4,8,9,10,11);
#define pir 5
#define out 6
int count=0;
void IN()
count++;
lcd.clear();
lcd.setCursor(0,0);
lcd.print(count);
temprature();
void OUT()
count--;
lcd.clear();
lcd.setCursor(0,0);
18 | P a g e
BIDIRECTIONAL VISITOR COUNTER AND TEMPRATURE CONTROLLER
// lcd.setCursor(0,1);
lcd.print(count);
temprature();
void setup()
Serial.begin(9600);
lcd.begin(16,2);
lcd.print("Visitor Counter");
delay(100);
pinMode(pir, INPUT);
pinMode(out, INPUT);
pinMode(lm35pin, INPUT);
pinMode(motorpin, OUTPUT);
lcd.clear();
lcd.print("No Person:");
delay(200);
lcd.setCursor(0,1);
lcd.print(count);
void loop()
19 | P a g e
BIDIRECTIONAL VISITOR COUNTER AND TEMPRATURE CONTROLLER
int value1=digitalRead(pir);
int value2=digitalRead(out);
if(value1==HIGH&&value2==LOW){
IN();
delay(300);
else if(value2==HIGH&&value1==LOW){
if(count>0)
OUT();
delay(300);
else if(value1==HIGH&&value2==HIGH){
lcd.clear();
lcd.setCursor(0,0);
lcd.print(count);
temprature();
delay(250);
else if(count>0){
temprature();
if(count<=0)
20 | P a g e
BIDIRECTIONAL VISITOR COUNTER AND TEMPRATURE CONTROLLER
lcd.clear();
lcd.print("Nobody In Room");
delay(200);
lcd.setCursor(0,1);
void temprature(){
int analog;
float temprature;
analog=analogRead(lm35pin);
temprature=float(analog)/1023;
temprature=temprature*500;
lcd.setCursor(0,1);
lcd.println("TEMP: ");
lcd.print(temprature);
lcd.print("c");
if (temprature>=27){
digitalWrite(motorpin,HIGH);
if (temprature<27){
digitalWrite(motorpin,LOW);
}}
21 | P a g e
BIDIRECTIONAL VISITOR COUNTER AND TEMPRATURE CONTROLLER
22 | P a g e