Automatic Door Control System

Download as pdf or txt
Download as pdf or txt
You are on page 1of 52

TRIBHUVAN UNIVERSITY

INSTITUTE OF ENGINEERING

KATHFORD INTERNATIONAL COLLEGE


OF ENGINEERING & MANAGEMENT
DEPARTMENT OF ELECTRONICS AND COMPUTER ENGINEERING

A
MINOR PROJECT REPORT
ON
“AUTOMATIC DOOR CONTROL SYSTEM”

Submitted By:
Mukesh Shrestha (Exam Roll No 35111)
Saban Kumar kc (Exam Roll No 35137)
Subhash Shrestha (Exam Roll No 35125)
Vijay Pandit (Exam Roll No 35139)

Lalitpur, Nepal ,October, 2012


i
TRIBHUVAN UNIVERSITY
INSTITUTE OF ENGINEERING

KATHFORD INTERNATIONAL COLLEGE


OF ENGINEERING & MANAGEMENT
DEPARTMENT OF ELECTRONICS AND COMPUTER ENGINEERING

Submitted By:
Mukesh Shrestha (Exam Roll No 35111)
Saban Kumar kc (Exam Roll No 35137)
Subhash Shrestha (Exam Roll No 35125)
Vijay Pandit (Exam Roll No 35139)

A PROJECT WAS SUBMTTED TO THE DEPARTMENT OF ELECTRONICS AND


COMPUTER ENGINEERING IN PARTIAL FULLFILLMENT OF THE
REQUIREMENT FOR THE BACHELOR’S DEGREE IN ELECTRONICS AND
COMMUNICATION ENGINEERING.

DEPARTMENT OF ELECTRONICS AND COMPUTER ENGINEERING


Lalitpur, Nepal, October, 2012

ii
TRIBHUVAN UNIVERSITY
INSTITUTE OF ENGINEERING
KATHFORD INTERNATIONAL COLLEGE OF
ENGINEERING AND MANAGEMENT

LETTER OF APPROVAL

The undersigned certify that they have read and recommended to the Department
of Computer and Electronics Engineering for acceptance, a project report entitled
“Automatic Door Control” submitted by Mr. Mukesh Shrestha, Mr. Saban
Kumar KC, Mr. Subhash Shrestha & Mr. Vijay Pandit in partial fulfillment for the
degree of Bachelor of Engineering in Electronics & Communication Engineering

……………….

Er. Anil Gharti

Project Supervisor

………………

Mr. Uttam Mali

External Examiner

……………….

Er. Nabin Karn

Head of Department

DATE OF Approval: october, 2012

iii
COPYRIGHT

The author has agreed that the library, Department of Electronics and computer,
Kathford International College of Engineering and Management, Institute of
Engineering, Balkumari, Lalitpur may make this report freely available for the
inspection. Moreover, the author has agreed that permission for extensive copying
this project report for scholarly, purposed may be granted by the supervisor who
supervised the project recorded herein or, in the absence by the Head of
Department wherein the project report was done. It is understood that the
recognition will be given to the author of this report and Department of
Electronics and computer, Kathford International College of Engineering and
Management, Institute of Engineering Balkumari, Lalitpur in any use of the
material of this project report. Copying or publication or the other use of this
report for financial gain without approval of Department of Electronics and
Computer, Balkumari, Lalitpur, Institute of Engineering and author’s written
permission is prohibited.

Request of the permission to copy or to make any other use of the material
in this report in whole or in part should be addressed to:

The Head

Department Electronics and Computer Engineering

Kathford International College of Engineering and Management, Lalitpur

Nepal

iv
ACKNOWLEDGEMENT

We would like thank to department of Electronics and Computer Engineering of


Kathford International college of engineering and Management for providing us
with the necessary equipments, components, lab room and superb teachers and
instructors who helped us with our project.

We are grateful to our respected teacher and supervisor Er. Anil Gharti for his
cooperation and guidance throughout the project as a project supervisor. We
would like to express our sincere gratitude to our instructors who helped us with
our project by sharing their suggestions and instruction and experiences.

We are also heartily thankful to our teachers Er. Yangya Murti Pokhrel, and Er.
Ashok Giri for their worthy suggestions and valued instructions.

Last but not the least we would like to thank our Head of Department Er. Nabin
Karna and others who have directly or indirectly contributed for bringing this
project to this stage.

v
ABSTRACT

As we know that the modern electrical automation has made the life more
sophisticated, easier and economical. Our minor project is based on the automatic
door control system in a room or hall based on IR sensor. This project is
applicable at such places where the people are busy and people are in large
number.

This project aims to work on the basis of intensity of IR sensor. Therefore, our
project could be beneficial from the economical point of view as the consumption
of electric power can be saved.

Our major goal is to provide the fully programmable automatic control system
based on microcontroller. Our targeted areas are hotel, restaurant, Airport,
Seminar Hall and so on. In its full working condition it could replace the doorman,
thus providing automatic open/close system in affordable way.

The budget of this project will be around six thousand rupees.

vi
TABLE OF CONTENTS

PAGE OF APPROVAL..........................................................III

COPYRIGHT............................................................................IV

ACKNOWLEDGEMENTS.....................................................V

ABSTRACT..............................................................................VI

TABLE OF CONTENTS........................................................VII

LIST OF FIGURES.................................................................X

LIST OF TABLES...................................................................XI

LIST OF SYMBOLS AND ABBREVIATIONS..................XII

1. INTRODUCTION

1.1 Introduction to Automatic Door Control System………….…1

2. HARDWARE ASPECTS

2.1 Voltage Regulator…………………………………………………2

2.1.1 LM 7805 …………………. ………………………….…2

2.2 Microcontroller ………………………………………………….3

2.2.1Pin Description………………………………………………5

2.2 Sensors…………………………………………………………....10

2.2.1 Microwave sensor ………………………………………....10

2.2.2 IR sensor……………………………………………….…14

vii
2.2.2.1 PIR sensor………………………………………….16

2.3 Relay Driver………………………………………………………18

2.4.1 ULN-2803A………………………………………………….18

3. PROJECT DESCRIPTION

3.1 Block Diagram Description ………………………………….…19

3.1.1Motion Sensors…………………………………………….20

3.1.2 Optocoupler……………………………………………….21

3.1.3 Microcontroller. …………………………………………..22

3.1.4 Relay Driver……………………………………………….22

3.1.5 DC Motor………………………………………………….23

3.1.6 Door System………………………………………………24

3.2 Problems faced …………………………………………………….25

3.2.1 Problems faced on hardware ………………………………25

3.3 Overall circuit diagram of the automatic door control system…….26

3.4 Flowchart of circuit diagram……………………………………….27

3.5 Circuit Design & Implementation………………………………….28

4. SOFTWARE

4.1 Software development process ……………………………………28

4.2. Software language ………………………………………………30

viii
4.2.2 Choosing C language? ………………………………………..30

4.2.3 Software & Equipments ……………………………………….31

4.2 Proteus 6 Professional ………………………………………………..31

4.3 Keil…………………………………………………………………….32

4.4 Problems faced on software …………………………………………..34

5. PROJECT COST ESTIMATION

5.1 Project cost estimation ……………………………………………..34

6. CONCLUSION AND FURTHER WORK

6.1 Applications ……………………………………………………..36

6.2 Limitations ………………………………………………………36

6.3 Enhancement ……………………………………………………...37

6.4 Conclusion ……………………………………………………….38

6.5 References ………………………………………………………..39

ix
LIST OF FIGURE

Figure 1.1 Automatic Door Principle……………………………………….1

Figure2.1.1: Voltage regulator LM7805…………………………………….3

Figure 2..2: AT89S52…………………………………………………….…4

Figure 2.2.1: Pin diagram of AT89S52 Microcontroller……………….…..6

Figure 2.3.2: IR sensor……………………………………………………...14

Figure 2.3.3 :PIR sensor………………………………………………….…17

Figure 2.4:relay driver……………………………….……………………..18

Figure 3.1: Block diagram of automatic door control system………………19

Fig 3.1.2 :optocoupler………………………………………………………21

Figure 3.1.5:DC motor........................................................................23

Figure3.2.6: Sliding door with pulley drive...........................................24

Figure3.3: Designation of Circuit diagram………………………………...26

Figure 3.4 : flowchart of circuit design……………………………………..27

Figure 3.5: PCB layout……………………………………………………..28

Figure 4.2 : Proteus………………………………………………………....32

Figure4.3: Keil…………………………………………………………..…33

x
LIST OF TABLE

Table 2.2.1: Port 1……………………………………………………...7

Table 2.2.2: 89S52 port 3……………………………………………….8

Table2.3.1: Troubleshooting………………………………………..….13

Table2.3.2: Light Comparison…………………………………….…...15

Table5.1: Cost estimate…………………………………………………35

xi
LIST OF SYMBOLS / ABBREVIATIONS

ALE: Address Latch Enable

CMOS: Complementary Metal Oxide


Semiconductor

EN: Enable

GND: Ground

I/O: Input Output

IIL: Injected Integrated Logic

ISP: ln-system programmable

LCD: Liquid Crystal Display

LED: Light Emitting Diode

PSEN: Program Store Enable

RAM: Random Access Memory

TTL: Transistor -Transistor Logic

TXD: Transmit Data Pin

XTAL: Crystal

xii
1.INTRODUCTION

1.1 Introduction to Automatic door control system

Automatic door control system is highly demanded & applicable project which
can be used in Airport, offices, restaurant, home, etc. AT89C52 microcontroller
controls the door mechanism according to the sensor output. LX senses the object
motion & provides AC output which is converted to DC. Opto-coupler takes this
converted DC &provides electrically isolated output which is then fed to
controller. The controller’s output is used as input to relay driver ULN 2803
which drives relay. Now the relay connection moves the motor in a particular
direction to close or open the door. Altogether three Regulators are used one for
controller another for the DC motor and the last for sensor's AC output.

Figure 1.1 Automatic Door Principle

A beam of light is broken by an object. This causes a disruption in the 'close door'
signal to a sensor to be interrupted. This interruption causes the doors to open.
Once the object has moved out of sensor range and the signal is again transmitted
and the doors close.

Automatic door must have some sort of motion sensor which activated sets off a
mechanism which completes an electrical path to make the electromagnet activate
to move the door.

1
2. HARDWARE ASPECTS

We are going to present the fundamentals about the power supply,


microcontroller. These are basic electronic components used in our project. The
detail description about how they are used in our project or system is discussed in
later chapters.

2.1 Voltage Regulator:

Voltage Regulators, also known as voltage stabilizers are semiconductor devices


that output a constant and stable DC voltage at a specified level despite
fluctuations in its input voltage or variations in its load. Voltage Regulators ICs
having already become available in so many forms and characteristics that they’ve
virtually eliminated the need to build voltage regulating circuit from discrete
components.

There are several types of voltage regulators but we used only one type of Voltage
Regulator which is discussed below.

2.1.1 LM7805:

The LM7805 monolithic 3 terminal positive voltage regulators employ internal


current Limiting thermal shutdown and safe area compensation, making them
essentially indestructible. If adequate heat sinking is provided, they can deliver
over 1A of current. They are intended as fixed voltage regulators in a wide range
of applications including local regulation of elimination of noise and distribution
problems.

2
Figure2.1.1: Voltage regulator LM7805

2.2 Microcontroller:

Microcontrollers are designed in a single chip, which typically includes a


microprocessor, certain byte of R/W memory, from 1K to 2K bytes of ROM, and
several signal lines to connect I/O lines. They are used in such functions as
controlling appliances and traffic lights.

The basic advantages of using microcontroller are given below:

 Transient time is very low as the control process is faster.


 Constant monitoring and controlling is possible due to more timely
information.
 It has the decision making power from the interpretation of data.
 Data can be stored, retrieved and transmitted to other controller efficiently.
 It can share information with computer providing possibility of host
computer control.

 We have used ATMEL 89S52 microcontroller in our project. Some


features are summarized below:

 Compatible with MCS-51 products.

3
 8K bytes of ln-system programmable (ISP) Flash memory.
 Endurance: 10000 write/Erase cycles.
 4.0V to 5.5V operating range.
 Fully static operation: 0 Hz to 33MHZ.
 Three-level program memory lock.
 256 X 8-bit internal RAM.
 32 Programmable I/O Lines.
 Three 16-bit Timer/counters.
 Eight Interrupt sources.
 Full Duplex UART serial channel.
 Low-power Idle and power down modes.
 Interrupt recovery from power-down Modes.
 Watch dog Timer.
 Dual Data pointer.
 Power-off flag.
 Fast programming time.
 Flexible ISP programming (byte and page mode).
 Green (Pb/Halide-free) packaging option.

Figure 2..2: AT89S52

4
2.2.1 Pin description

The AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller


with 8K bytes of in-system programmable Flash memory. The device is
manufactured using Atmel’s high-density nonvolatile memory technology and is
compatible with the industry-standard 80C51 instruction set and pin out. The on-
chip Flash allows the program memory to be reprogrammed in-system or by a
conventional nonvolatile memory programmer. By combining a versatile 8-bit
CPU with in-system programmable Flash on a monolithic chip, the Atmel
AT89S52 is a powerful microcontroller which provides a highly-flexible and cost-
effective solution to many embedded control applications. The AT89S52 provides
the following standard features: 8K bytes of Flash, 256 bytes of RAM, 32 I/O
lines, Watchdog timer, two data pointers, three 16-bit timer/counters, a six-vector
two-level interrupt architecture, a full duplex serial port, on-chip oscillator, and
clock circuitry. In addition, the AT89S52 is designed with static logic for
operation down to zero frequency and supports two software selectable power
saving modes. The Idle Mode stops the CPU while allowing the RAM,
timer/counters, serial port, and interrupt system to continue functioning. The
Power-down mode saves the RAM contents but freezes the oscillator, disabling all
other chip functions until the next interrupt or hardware reset.

5
Figure 2.2.1: Pin diagram of AT89S52 Microcontroller

VCC

Supply voltage.

GND

Ground.

PORT 0

Port 0 is an 8-bit open drain bidirectional I/O port. As an output port, each pin can
sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as
high-impedance inputs. Port 0 can also be configured to be the multiplexed low-
order address/data bus during accesses to external program and data memory. In
this mode, P0 has internal pull-ups. Port 0 also receives the code bytes during

6
Flash programming and outputs the code bytes during program verification.
External pull-ups are required during program verification.

PORT 1

Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 1 output
buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins, they
are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port
1 pins that are externally being pulled low will source current (IIL) because of the
internal pull-ups. In addition, P1.0 and P1.1 can be configured to be the
timer/counter 2 external count input (P1.0/T2) and the timer/counter 2 trigger
input (P1.1/T2EX), respectively, as shown in the following table. Port 1 also
receives the low-order address bytes during Flash programming and verification.

Table 2.2.1: port 1

Port Alternate functions


pin
P.0 T2(external count input to timer counter 2) clock-out
P1.1 T2EX(Timer counter 2 capture /reload trigger and director
control)
P1.5 MOSI(used four ln-system programming)
P1.6 MISO(used for ln-system programming)
P1.7 SCK(used for ln-system programming)

PORT 2

Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 2 output
buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins, they
are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port
2 pins that are externally being pulled low will source current (IIL) because of the

7
internal pull-ups. Port 2 emits the high-order address byte during fetches from
external program memory and during accesses to external data memory that uses
16-bit addresses (MOVX @ DPTR). In this application, Port 2 uses strong internal
pull-ups when emitting 1s. During accesses to external data memory that uses 8-
bit addresses (MOVX @ RI); Port 2 emits the contents of the P2 Special Function
Register. Port 2 also receives the high-order address bits and some control signals
during Flash programming and verification.

PORT 3

Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 3 output
buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins, they
are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port
3 pins that are externally being pulled low will source current (IIL) because of the
pull-ups.Port 3 receives some control signals for Flash programming and
verification. Port 3 also serves the functions of various special features of the
AT89S52, as shown in the following table.

Table 2.2.2: 89S52 port 3 [2]

Port Alternate functions


pin
P3.0 RXD(serial input port)
P3.1 TXD(serial output port)
P3.2 INTO(external interrupt 0)
P3.3 INT1(external interrupt 1)
P3.4 T0(timer 0 external input)
P3.5 T1(timer 1 external input)
P3.6 WR(external data memory write strobe)
P3.7 RD(external data memory read strobe

RST

8
Reset input. A high on this pin for two machine cycles while the oscillator is
running resets the device. This pin drives high for 98 oscillator periods after the
Watchdog times out. The DISRTO bit in SFR AUXR (address 8EH) can be used
to disable this feature. In the default state of bit DISRTO, the RESET HIGH out
feature is enabled.

ALE/PROG

Address Latch Enable (ALE) is an output pulse for latching the low byte of the
address during accesses to external memory. This pin is also the program pulse
input (PROG) during Flash programming. In normal operation, ALE is emitted at
a constant rate of 1/6 the oscillator frequency and may be used for external timing
or clocking purposes. Note, however, that one ALE pulse is skipped during each
access to external data memory. If desired, ALE operation can be disabled by
setting bit 0 of SFR location 8EH. With the bit set, ALE is active only during a
MOVX or MOVC instruction. Otherwise, the pin is weakly pulled high. Setting
the ALE-disable bit has no effect if the microcontroller is in external execution
mode.

PSEN

Program Store Enable (PSEN) is the read strobe to external program memory.
When the AT89S52 is executing code from external program memory, PSEN is
activated twice each machine cycle, except that two PSEN activations are skipped
during each access to external data memory.

EA/VPP

External Access Enable. EA must be strapped to GND in order to enable the


device to fetch code from external program memory locations starting at 0000H

9
up to FFFFH. Note, however, that if lock bit 1 is programmed, EA will be
internally latched on reset. EA should be strapped to VCC for internal program
executions. This pin also receives the 12-volt programming enable voltage (VPP)
during Flash programming.

XTAL1

Input to the inverting oscillator amplifier and input to the internal clock operating
circuit

XTAL2

Output from the inverting oscillator amplifier

2.3 Sensors

2.3.1 Microwave sensor LXMV360S2 instruction

The sensor is a motion detector it emits high-frequency electro-magnetic wave


(5.8 GHz) and receives their echo. The sensor detects the change in echo from
even the slightest movement in its detection zone .A microprocessor then triggers
the “switch light ON” command .Detection is possible through door spans of glass
or thin walls.

Important: persons or objects moving towards the sensor are detected best!

NOTE: The high frequency output of this sensor is <10Mw-that is just one 100 th
of the transmission power of a mobile phone or output of the microwave oven.

10
Technical specifications

Power supply: 220-240VAC

Power frequency: 50/60Hz

Installation sit: cell mounting

HF system: 5.8GHz CW radar, ISM band

Transmission power : <10 mW

Rated load: 1200W

Detection load : 360

Reach: 1-8 m (radii), adjustable

Time setting: 8sec to 12 min

Light control: 2-2000LUX

Power consumption: approx 0.9W

Reach setting (sensitivity)

Reach is the term used to describe the radii of the more or less circular detection
zone produced on the ground after mounting the sensor light of 2.5m, turn the
reach control fully anticlockwise to select minimum reach (approx 1m radii)

NOTE: The above detection distance is gained in the case of a person who is
between 1.6-1.7 m tall with middle figure and moves at a speed of 1.0-1.5m/sec. If
person‘s stature, figure and moving speed change, the detection will also change.

11
Time setting

The light can be set to stay ON for any period of time between approx 8sec (turn
fully anti clockwise ) and a maximum of 12min(turn fully clockwise).Any
movement detected before this time elapse will re-start the timer . It is
recommended to select the shortest time for adjusting the detection zone and for
performing the walk test.

NOTE: after the light switches OFF, it takes approx 1sec before it is able to start
detecting movement again. The light will only switch on in response to movement
once this period has elapsed.

Light control setting

The chosen light response threshold can be infinitely from approx 2-


2000LUX.Turn it fully anti-clockwise to select dusk-to-dawn operation at about
2lux.Turn it fully clockwise to select daylight operation at about 2000lux.The
knob must be turned fully clockwise when adjusting the detection zone and
performing the walk test in daylight.

12
Troubleshooting

Malfunction Cause Remedy


The load will Wrong light- Adjust setting
continuous control setting
Change load
movement for selected
detection zone to
Switch ON
Load fully
work

Mains switch
OFF

The load work Continuous Check zone


always movement for setting
detection zone
The load work The sensor not Securely mount
without any mounted for enclosure
identifiable detecting
Check zone
movement movement
setting
reliably

Movement
occurred, but not
identified by the
sensor (movement
behind wall,
movement of a
small object in
immediate lamp
vicinity etc.)

13
The load will not Rapid movements Check zone
work despite are being setting
movement suppressed to
minimize
malfunctioning or
the detection zone
you have set is
too small

Table2.3.1: troubleshooting

2.3.2 IR sensor

Figure 2.3.2: IR sensor

Infrared (IR) light is electromagnetic radiation with longer wavelength than


those of visible light, extending from the nominal red edge of the visible spectrum
at 0.74 micrometer (µm) to 300 µm. This range of wavelengths corresponds to
a frequency range of approximately 1 to 400 THz and includes most of
the thermal radiation emitted by objects near room temperature. Infrared light is
emitted or absorbed by molecules when they change their rotational vibration
movements. The existence of infrared radiation was first discovered in 1800 by
astronomer William Herschel

14
Much of the energy from the Sun arrives on Earth in the form of infrared
radiation. Sunlight at zenith provides an irradiance of just over 1 killowatt per
square meter at sea level. Of this energy, 527 watts is infrared radiation, 445 watts
is visible light, and 32 watts is ultraviolet radiation. The balance between absorbed
and emitted infrared radiation has a critical effect on the Earth's climate. Infrared
light is used in industrial, scientific, and medical applications. Night-vision
devices using infrared illumination allow people or animals to be observed
without the observer being detected. In astronomy, imaging at infrared
wavelengths allows observation of objects obscured by interstellar dust. Infrared
imaging cameras are used to detect heat loss in insulated systems, to observe
changing blood flow in the skin, and to detect overheating of electrical apparatus.

Light Comparison

Photon
Wavelengt Frequenc
Name Energy(eV
h y (Hz)
)

Gamma less than more than 100 keV -


Ray 0.01 nm 10 EHZ 300+ GeV

0.01 nm to 30 EHz - 120 eV to


X-Ray
10 nm 30 PHZ 120 keV

10 nm - 30 PHZ - 3 eV to
Ultraviolet
390 nm 790 THz 124 eV

790 THz
390 nm - 1.7 eV -
Visible - 405
750 nm 3.3 eV
THz

405 THz
750 nm - 1.24 meV
Infrared -
1 mm - 1.7 eV
300 GHz

300 GHz
Microwav 1 mm - 1 1.24 µeV -
-
e meter 1.24 meV
300 MHz

15
1 mm -
300Ghz- 12.4 feV -
Radio 100,000 k
3Hz 1.24 meV
m

Table2.3.2: Light Comparison

Infrared imaging is used extensively for military and civilian purposes. Military
applications include target acquisition,, surveillance, night vision, homing and
tracking. Non-military uses include thermal efficiency analysis, environmental
monitoring, industrial facility inspections, remote temperature sensing, short-
ranged wireless communication, spectroscopy, and weather forecasting. Infrared
astronomy uses sensor-equipped telescopes to penetrate dusty regions of space,
such as molecular clouds; detect objects such as planets, and to view highly red-
shifted objects from the early days of the universe.

Humans at normal body temperature radiate chiefly at wavelengths around 10 μm


(micrometers), as shown by Wine’s displacement law. At the atomic level,
infrared energy elicits vibrational modes in a molecule through a change in
the dipole movement, making it a useful frequency range for study of these energy
states for molecules of the proper symmetry.infrared spectroscopy examines
absorption and transmission of potons, in the infrared energy range, based on their
frequency and intensity.

2.3.3 PIR sensor

A passive infrared sensor (PIR sensor) is an electronic sensor that


measures infrared IR) light radiating from objects in its field of view. They are
most often used in PIR - based motion detector

Operating principles

All objects above absolute zero emit heat energy in the form of infrared radiation
(infrared light). Human eye, Usually infrared light is invisible to the but it can be
detected by electronic devices designed for such a purpose.

16
The term passive in this instance refers to the fact that PIR devices do not generate
or radiate any energy for detection purposes. They work entirely by detecting the
energy given off by other objects.

Construction

Infrared radiation enters through the front of the sensor, known as the 'sensor
face'. At the core of a PIR sensor is a solid states sensor or set of sensors, made
from piezoelectric materials -- materials which generate energy when exposed to
heat. Typically, the sensors are approximately 1/4 inch square, and take the form
of thin film. Materials commonly used in PIR sensors include gallium
nitride (GaN), cesium nitrate (CsNO3), polyvinyl nitride derivatives
of phenylpyrazine and cobalt pathalocyanine. The sensor is often manufactured as
part of an integrated circuit.

Figure 2.3.3 :PIR sensor

17
2.4 Relay Driver

2.4.1 ULN2803A

Figure 2.4:relay driver

The ULN2803A is a high-voltage, high-current Darlington transistor array. The


device consists of eight NPN Darlington pairs that feature high-voltage
outputs with common-cathode clamp diodes for switching inductive loads.
The collector-current rating of each Darlington pair is 500 mA. The Darlington
pairs may be connected in parallel for higher current capability. Applications
include relay drivers, hammer drivers, lamp drivers, display drivers (LED and gas
discharge), line drivers, and logic buffers. The ULN2803A has a 2.7-kΩ series
base resistor for each Darlington pair for operation directly with TTL or 5-V
CMOS devices. The Darlington pair driver provides enough amplified
current for the motor to operate

18
3.PROJECT DESCRIPTION

3.1 Block Diagram

POWER SUPPLY

220VAC 5V DC 12V DC 5V-12V DC

RECTIFIER

(220ACV TO 5VDC DC
DDCDDDDDCDDCD MOTOR
DCDC)

RELAY
MOTION OPTO- AT89C52 DRIVER
DOOR
SENSOR COUPLER
SYSTEM

Figure 3.1: Block diagram of automatic door control system

3.1.1 Motion sensor

19
Motion sensor is available in two types. Active sensor generates electromagnetic
wave whereas Passive sensors do not. Microwave sensor LXMV360S2 is active
motion sensor which can generate high-frequency electro-magnetic wave (5.8
GHz) . It is operated in 220ACV and provides output of same level of voltage. It
receives the echo from the slightest motion of object in the detection zone then
after microprocessor switches the light on thus providing 220ACV as an electrical
output.

3.1.2 Optocoupler

In electronics, an opto-isolator, also called an optocoupler, photocoupler,


or optical isolator, is "an electronic device designed to transfer electrical signals
by utilizing light waves to provide coupling with electrical isolation between its
input and output". The main purpose of an opto-isolator is "to prevent high
voltages or rapidly changing voltages on one side of the circuit from damaging
components or distorting transmissions on the other side."Commercially available
opto-isolators withstand input-to-output voltages up to 10 kVand voltage
transients with speeds up to 10 kV/μs

Operation

An opto-isolator contains a source (emitter) of light, almost always a near


infraredlight-emitting diode(LED), that converts electrical input signal into light, a
closed optical channel (also called dielectrical channe), and a photosensor, which
detects incoming light and either generates electric energydirectly,
or modulates electric currentflowing from an external power supply. The sensor
can be a photoresistor, a photodiode,a phototransistor, a silicon-controlled
rectifier(SCR) or a triac.. Because LEDs can sense light in addition to emitting it,
construction of symmetrical, bidirectional opto-isolators is possible. An
optocoupled solid state relay contains a photodiode opto-isolator which drives a
power switch, usually a complementary pair of MOSFETs.. A slotted optical
switchcontains a source of light and a sensor, but its optical channel is open,
allowing modulation of light by external objects obstructing the path of light or
reflecting light into the sensor.

20
Fig 3.1.2 :optocoupler

In this project optocoupler is an alternation of direct interface & Relay interface


with microcontroller. LDR is used as photo sensor because of fast response,
cheaper & operates at lower current. It’s resistance varies from mega ohms to
ohms. Whenever there is no motion detection by sensor ,optocoupler offers high
impedance around at 10 Megaohm & also provides high signal to microcontroller
& for condition of motion detection by sensor at its detection zone it offers low
resistance at around 10 ohm then provides low signal to microcontroller.
220VAC output by motion sensor is rectified to 5V dc & fed to the input of
optocoupler.

3.1.3 Microcontroller

21
8051 microcontroller has four ports with 8 pins associated to each port.Port 3 is
used as input port & port is used as output port. Sensor output is fed to P3.7.Door
cloasing & opening interface is fed to P3.5 & P3.6 respectively.P2. 7 P2.6 are
used as output pin.This pin is connected to PIN5 & PIN7 of ULN2803 which is a
current driver.

3.1.4 Relay Driver

Digital systems and microcontroller pins lacks sufficient current to drive relay.
While the relay’s coil needs 10 mA or above to be energized ,the
microcontroller’s pin can provide a maximum of 1-2 mA current. For this
reason,we place a driver ULN2803 to drive relay as shown in circuit diagram.

It is an active inverting current amplifier able to give 500mA. When there is high
in its input pin respective outpin goes low driving high current from the source
and thus driving the relay. Similary for low intput there is high output resulting no
current to flow through the relay. In this way ULN 2803 energizes and
deenergizes the relay. Relay is so connected that the direction of motor is
changed.

Normally open contact pin of one relay is connected to normally close of another
and vice versa. Now this two pin is connected two power supply and the common
contact pin is connected to dc motor. When one realy is drived motor gets polarity
to move in one direction and when other gets energized reverse polarity appears in
the motor resulting opposite direction.

Instead of the ULN 2803, we could have used transister as drivers. However,if
transistors are used as drivers,we must also use diodes to take care of inductive
current generated when the coil is turned off.One reason that using the ULN2003
is preferable to the use of transisters as drivers is that the ULN2003 has an internal
diode to take of back EMF.

3.1.5 DC Motor

22
Figure 3.1.5:DC motor

A dc motor is an electrical motor that runs on direct current (DC) electricity. DC


motors were used to run machinery, often eliminating the need for a local steam
engine or internal combustion engine. DC motors can operate directly from
rechargeable batteries, providing the motive power for the first electric vehicles.
Today DC motors are still found in applications as small as toys and disk drives,
or in large sizes to operate steel rolling mills and paper machines. Modern DC
motors are nearly always operated in conjunction with power electronic devices.

23
3.1.6 Door System

Figure3.2.6: Sliding door with pulley drive

24
About Door System:

 Sliding door is used made up of wooden ply.


 Pulley rope drive is used to slide the door.

3.2 Problem Faced

Various genuine problems were faced during the course of completing this
project. Those normal and genuine problems are not addressed in this section.
Only the major problems we came across while completing our project are
addressed in this section.

3.2.1 Problems faced on hardware:

To realize a system using real time electronic components was much more
difficult than to derive their theoretical concept. The commercially available IC’s
and electronic components were not that reliable as we thought it would be.
Hence, many errors and obstacle were faced during their use.

After getting started with our project we realized the simplicity of the circuitry
was just a myth. The synchronization of the hardware with the software succeeded
after several serious attempts. With some modules the circuitry worked out on
first attempt which we felt lucky. On the other hand, most of the modules did not
work on several attempts and caused massive loss of our time even on days.

However designing our complete circuitry system over Proteus 7 Professional


software proved to be the best method to realize how our system works and it
added to debugging the software bugs as well. But Proteus doesn’t include all the
electronic components we used in our project. Though the basic circuitry was easy
to deal with, however this software was a boon to us.

Even after the simulation on Proteus we faced several problems on real time
electronic circuitry. They were optimum contrast to each other. The real time
circuit was very much like the simulation though. Voltage regulation and

25
synchronization between the MCU and various peripheral components was the
major problem we faced. To debug this problem we consulted our supervisor and
senior teachers who helped us to deal with this problem.

3.3 Overall circuit diagram of system automatic door control system

Figure3.3: Designation of Circuit diagram

26
3.4 Flowchart Of Circuit Design

Figure 3.4 :flowchart of circuit design

27
3.5 Circuit Design & Implementation

Figure 3.5: PCB layout

4. SOFTWARE

The software controls the operation of the system and hence it is imperative that
the software is developed in a flawless manner so as to attain the desired result.

In our project, all but one desired coding is stored in the microcontroller.. It is the
software that controls the overall functioning of the system. The stored program in
a microcontroller controls all the basic functionalities of the function and the
operation of the devices used in the system. The inputs are taken from sensors and
output of the program decides action to be taken by the system. Software, being a
crucial part of our project, is going to be discussed in detail in this section.

.1 Software Development Process

28
Software engineering helps in the development of the project. It is important to go
through a series of predictable steps to build a product or a system. Software
process helps to get a series of steps. Software engineers and their managers adapt
the process to their needs and follow on it. Software process is automated process
that simplifies project management and, what is most important, enhances
visibility of the project. It provides stability, control of the project. Software
process requires a systematic and consistent approach to the project.

Software engineer or a team of engineers must incorporate a development strategy


that encompasses the process for solving the problem. This strategy is often
referred to a process model. The development of mobile application systems is
usually realized on the basic of iterative process models of which there are many
different variants. The selection of an appropriate process is a crucial issue for the
success of every system development project, particularly for systems in a highly
volatile environment such as mobile application systems.

There are different types of process models in the software engineering. These
are: - Linear sequential model, prototyping model, Evolutionary process model,
incremental models, Spiral model.

Between these models, the most common used model is sequential model. In our
project we have followed these steps , i.e. project identification and selection,
project initiation and planning ,analysis, design, Implementation, maintenance on
the basics of these models. This model is also called the waterfall model because
the process continues as water falling from the upper surface to the lower surface.
It is generally accepted that classical, sequential process models are not
appropriate for the development of modern, market oriented information systems.
A temporal separation between phases of development and subsequent phases of
operation and maintenance proves not to be useful. This is because an entirely
new system is only comprehensible and realizable through repeated feedback
loops. Alternative models for complex and dynamic systems in recent years were
often captured under the term iterative process model.

29
4.1.1 Software language

The software or any program used for the operation of any system can be written
in any language considering various factors. The choice is made on the basis of
following decisive factors.

 Memory available.
 Required execution speed.
 Accurate control of peripheral devices.
 Programming experience of team members.
 Time available.

Assembly language is considered to be the best for projects that need minimum
memory, the highest execution speed, and precise control of peripheral devices
but since writing in this language is a tedious task with more knowledge in C
programming, we choose to write our source code in the C language. Not only that
C programming is used knowing us the more about it but it has also several
advantages over assembly language.

4.1.2 Choosing C language?

C is a powerful, flexible language that provides fast program execution and


imposes few constraints on the programmer. It allows low level access to
information and commands while still retaining the portability and syntax of a
high level language. These qualities make it a useful language for both system
programming and general purpose programs. C’s power and fast program
execution come from its ability to access low level commands, similar to
assembly language, but with high level syntax. Its flexibility comes from the many
ways the programmer has to accomplish the same tasks. C includes bitwise
operators along with powerful pointer manipulation capabilities. C imposes few
constraints on the programmer. The main area this shows up is in C’s lack of type
checking. This can be a powerful advantage to an experienced programmer but a
dangerous disadvantage to a novice.

30
Another strong point of C is its use of modularity. Section of code can be stored in
libraries for re-use in future programs. This concept of modularity also helps with
‘c’ portability and execution speed. The core C language leaves out many features
included in the core of other languages. These functions are instead stored in the C
standard Library where they can be called on when needed. An example of this
concept would be C’s lack of built in I/O capabilities. I/O functions tend to slow
down program execution and also be machine independent when running
optimally. For these reasons, they are stored in a library separately from the C
language and only included when necessary. The C programming language is used
in many different areas of application, but the most prolific area is UNIX
operating system applications. The C language is also used in computer games:

 UNIX operating system.


 Computer games.

4.1.3 Software & Equipments

This section is intended to give some basic introduction and useful information
about the software and tools that we employed in to develop our system.

4.2 Proteus 6 Professional

Many CAD users dismiss schematic capture as a necessary evil in the process of
creating PCB layout but Proteus 6 Professional has always disputed this point of
view. With PCB layout now offering automation of both component placement
and track routing, getting the design into the computer can often be the most time
consuming element of the exercise. And if you use circuit simulation to develop
your ideas, you are going to spend even more time working on the schematic. ISIS
has been created with this in mind. It has evolved over twelve years research and
development and has been proven by thousands of users worldwide. The strength
of its architecture has allowed us to integrate first conventional graph based
simulation and now - with PROTEUS VSM - interactive circuit simulation into
the design environment. For the first time ever it is possible to draw a complete
circuit for a micro-controller based system and then test it interactively, all from
within the same piece of software. Meanwhile, ISIS retains a host of features

31
aimed at the PCB designer, so that the same design can be exported for production
with ARES or other PCB layout software.

The Proteus Professional v 6.9, Lab Center Electronics 1990-2005, has been used
for the simulation and PCB layout designed purpose in our system. And this
software proved to be the most comprehensive tool for testing many
microcontroller based circuitry with MCU coding, of course and it has also helped
to give professional look to our circuit.

Figure 4.2 :Proteus

4.3 Keil

Keil is a German based Software development company. It provides several


development tools like

• IDE (Integrated Development environment)


• Project Manager
• Simulator
• Debugger

32
• C Cross Compiler, Cross Assembler, Locator/Linker

Keil Software provides us with software development tools for the 8051 family of
microcontrollers. With these tools, we can generate embedded applications for the
multitude of 8051 derivatives. Keil provides following tools for 8051
development

1. C51 Optimizing C Cross Compiler,


2. A51 Macro Assembler,
3. 8051 Utilities (linker, object file converter, library manager),
4. Source-Level Debugger/Simulator,
5. µVision for Windows Integrated Development Environment.
The keil 8051 tool kit includes three main tools, assembler, compiler and linker.

Figure4.3: Keil

33
4.4 Problem Faced On Software

The major problem we faced in course of developing the software for our system
was dealing with various interrupts and developing their respective ISR. We used
C language for programming as developing subroutines and using interrupts is
easy in C than in assembly language. But dealing with the software with C
language of programming instead of the assembly language made our job more
tedious.

As our system uses large number of external components managing the external
interrupt also proved to be an obstacle on the program development. Sensors were
addressed using polling (i.e. they were kept under continuous scan).

5. PROJECT COST ESTIMATION

5.1 Project Cost Estimation

COMPONENTS QUANTITY PRICE

(NRS)

1.Resistor A Packet 100/-

2.PhotoDiode 5 piece 200/-

3.IR Led 5 piece 200/-

4.Transistor – 5 piece 50/-


BC547
2 piece 80/-
5.Comparator-
2 piece 150/-
LM393

34
- 10 piece 100/-
LM324
2 piece 270/-
6.LED
1 piece 100/-
7.Microcontroller-
1 piece 1000/-
AT80s52

2 piece 200/-
8.Relay driver-
ULN2803
5 piece 50/-

9.DC Motor
1 piece 450/-

10.Relay 6V
3 piece 7500/-

11.LDR
1 piece 1000/-

ATMEL
1 piece 1800/-
ATMEGA16

Power Supply
6000/-
Door System

Microwave Sensor
(LXMV360S2)

Table5.1: Cost estimate

35
6. CONCLUSION AND FURTHER WORK

6.1 Applications

 Home
 Garage
 Hospital
 Vehicle such as public Bus & Train
 Manufacturing Industries
 Airport
 Lift

6.2 Limitations

Any system with cent percent efficiency and zero error are almost impossible. An
electronic project using these many chips and sophisticated sensors cannot be
expected to perform with the accuracy we expect in ideal case. So the limitations
are obvious but finding them and presenting them for future enhancement is the
most important part. Working with various communication standards and
depending upon any other system for the output of the system makes the system
even more error prone. Some of the limitations are stated as below:

The senor may detect motion where detection is not desirable and not detect
motion where it is desirable.

As the sensor is extremely sensitive to motion, even object blowing in wind &
florescent lighting may cause triggering.

Sensor detects both the forward & lateral motion. But our objective to detect only
forward motion not backward or lateral motion.

It doesn’t provide security. It is useful for public sector rather than private sector.

It is operated by electrical energy. It cannot be functioned in absence of electrical


power. It also cannot be opened or closed manually.

Frictional effect is considerable in the movement of door operated by pulley drive.

36
6.3 Enhancement

A system in our level can only be designed with the limited components and
resources available. Being the students of our level there’s always problems for
budgeting if the components became unavailable in the place referred by the
college. And in the country like Nepal the availability of the components is
another serious matter of concern. So there is always the room for enhancement.
Further improvement of the system can be achieved using more sensors or in other
way the more advanced one. As discussed in the limitations above the
enhancements of our system can be done considering the limitations mentioned
above.

Passive sensor should be used for lower detection zone & can be used for human
being only avoiding other objects.

Microwave sensor should be set at lower range.

In absence of electrical power, Battery backup system could be implemented.

Chain drive is more reliable than pulley drive.

This automatic control system can be implemented in other field such as


automatic Dam opening& closing according to water flow by enhancing its
hardware & software.

6.4 Conclusion

37
Upon the completion of the project we have almost fulfilled the objective of our
project building an automatic door control system. Our door system is applicable
from simple home to large banquet, hospital, airports & so on. Our system can be
used worldwide and have many applications based flow of mass. We have made
the project with the best of our abilities but with further enhancements we can
definitely increase the potential of our system.

Although it may appear to be stating the obvious, the project really proved to be
very beneficial for us in all aspects. The project provided us with an opportunity
of working in different areas of engineering, namely, electronics and software.
Our Project also requires reliable mechanical system. Due to this we are able to
enhance our mechanical knowledge along with electronics & software portion. To
be more precise, the completion of the project has raised our confidence to a next
level, where we feel more confident about our abilities as an engineer. Hence, we
conclude this project perceives a lot of experience and knowledge in the field of
automation.

38
References

1. Rappaport, Theodore S. Wireless Communication. Second. s.l. : PHI Learning


Pvt.Ltd, 2. Mazidi, Muhammad Ali. The 8051 Microcontroller and Embeded
system. Secand. New Delhi : Prentice-Hall of India Pvt.Ltd, 2007. pp. 282-
283,02. pp. 1-21.

3. Fowler, Kim R. Electronic Instrument Design. 7th. New Delhi : Oxford


University Press, 2009. pp. 254-256.

4. www.8051projects.net/forum-t4941.html.com

5. www.en.wikipedia.org/wiki/weather sensor

39
40

You might also like