Sei sulla pagina 1di 44

1

Mini Project Report

On

ELECTRONIC EYE CONTROLLED SECURITY SYSTEM


BACHELOR OF TECHNOLOGY

IN

Electronics & Communication Engineering

Submitted By

M.DIVYA 14R11A0493

E.NIKITHA 15R15A0408
R.VAMSHI 14R11A04A9

Under the Guidance of

A.JYOTHIRMAYE

Associate Professor

Department of Electronic & Communication Engineering

GEETHANJALI COLLEGE OF ENGINEERING AND TECHNOLOGY,

Cheeryal(V), Keesara(M) ,R.R.Dist,Hyderabad-501 301


(Affiliated to Jawaharlal Nehru Technology University ,Hyderabad &Accredited By NBA)

2014-2018
2

GEETHANJALI COLLEGE OF ENGINEERING & TECHNOLOGY

Department of Electronics & Communication Engineering

CERTIFICATE

This is to certify that the project report title “ ELECTRONIC EYE


CONTROLLED SECURITY SYSTEM ” is being submitted by
M.Divya,(14R11A0493),E.Nikitha(15R15A0408),R.Vamshi(14R11A04A9)in
partial fulfillment for the award of the Degree of Bachelor of Technology in
Electronics & Communication Engineering is a record of bonafied work
carried out under my guidance and supervision. The results embodied in this
report has not been submitted to any other University for the award of any
degree.

Internal Guide DR.VIJAYA GUNTURU


A.JYOTHIRMAYE Professor and HOD
Associate Professor ECE

Internal Examiner External Examiner


3

DECLARATION

Here by declare that this project on ELECTRONIC EYE CONTROLLED SECURITY


SYSTEM” submitted in Electronics and Communication Engineering (ECE). Geethanjali
College of Engineering and Technology in partially fulfilled of academics required for the
award of degree of BACHELOR OF TECHNOLOGY in Electronics and Communication
Engineering. This is record of bonafied of our own work carried under supervision Asst.
professo A.JYOTHIRMAYE in Electronics and Communication Engineering.
4

ACKNOWLEDGEMENT
We, the Students of ECE department of Geethanjali College of Engineering and
Technology, would like to convey heartfelt thanks to Dr. S. Udaya Kumar, Principal of the college
for the wonderful guidance and encouragement given to us to move ahead in the execution of this
project.

We are highly grateful to the great personality in the field of Electronics, none other than
DR.VIJAYA GUNTURU Professor and Head of the Department of Electronics and
Communication Engineering of GCET for guiding and taking care of our career in this field. We
are ever thankful to the Professor.

We are very happy for being guided by A.JYOTIRMAYEE for her/his able guidance given
to us to complete our technical work successfully.

Lastly,we like to thank our coordinator O.V.P.R SIVA KUMAR for giving us this opportunity
to present the technical project work.

Above all, we are very much thankful to the management of Geethanjali College of
Engineering and Technology which was established by the high profile intellectuals for the cause
of Technical Education in modern era. We wish that GCET sooner should become a deemed
university and produce uncountable young engineers and present them to the modern technical world.

With regards

M.DIVYA 14R11A0493

E.NIKITHA 15R15A0408

R.VAMSHI 14R11A04A9
5

CONTENTS PAGE NO.s

Abstract ……………….. i
List of Figures ……………….. ii
List of Tables ……………….. iii
Symbols & Abbreviations ……………….. iv

Chapter 1. Introduction
1.1 ……………… 1
1.2 (3 to 4 pages) 2
1.3 3
.

Chapter 2. Literature Survey


(Not more than 5 Pages)
2.1
2.2
2.3

Chapter 3. Hardware and Software Design (whatever is applicable)


(Not more than 30 Pages)
3.1 BLOCK DIAGRAM
3.2 CIRCUIT DIAGRAM
3.3 FLOW CHART
3.4 PROGRAMME CODE
3.5 APPLICATIONS
3.6 ADVANTAGES
3.7 DISADVANTAGES

Chapter 4. Operating Procedure or Design Verification / Simulation (whatever is


applicable) (Not more than 10 Pages)
Chapter 5. Results (Not more than 10 Pages)
Chapter 6. Conclusion (One page)
Chapter 7: Future Scope (One page)
6

ABSTRACT
7

List of Figures/ tables/ screens


8

SYMBOLS AND ABBREVIATIONS


9

CONTENTS PAGE N0.

1.INTRODUCTION TO EMBEDDED SYSTEMS 8

1.1 HISTORY 9
1.2 TOOLS 10
1.3 RESOURCES 10
1.4 REAL TIME ISSUES 11

2. NEED FOR EMBEDDED SYSTEMS 11

2.1 DEBUGGING 11
2.2 RELIABILITY 12

3. EXPLAINATION OF EMBEDDED SYSTEM 13

3.1 SOFTWARE ARCHITECTURE 13


3.2 STAND ALONE EMBEDDED SYSTEM 15
3.3 REAL TIME EMBEDDED SYSTEM 15
3.4 NETWORK COMMUNICATION EMBEDDED SYSTEM 15
3.5 DIFFERENT TYPES OF PROCESSING UNITS 16

4. APPLICATIONS OF EMBEDDED SYSTEMS 17

4.1 CONSUMER APPLICATION 17


4.2 OFFICE AUTOMATION 17
4.3 INDUSTRIAL AUTOMATION 17
4.4 COMPUTER NETWORKING 19
4.5 TELECOMMUNICATIONS

5. ARDUINO UNO 19

5.1INTRODUCTION TO ARDUINO UNO


5.2 ARDUINO PIN DIAGRAM AND DISCRIPTION 19

6 LCD 16*2 MODULE 34

6.1 LCD DESCRIPTION 34


6.2 LCD PIN DIAGRAM 35
6.3 INTERFACING 36

7. SENSORS 38

7.1 ULTRASONIC SENSOR


7.2 FEATURES

8.
10

9. APPLICATIONS 47

10. PROGAM 48

11. RESULTS 49

12. CONCLUSION 49
11

ABSTRACT

Electronic eye controlle security system is the magic eye.


12

1. INTRODUCTION
Embedded Systems

An embedded system is a computer system designed to perform one or a few dedicated


functions often with real-time computing constraints. It is embedded as part of a complete
device often including hardware and mechanical parts. By contrast, a general-purpose
computer, such as a personal computer (PC), is designed to be flexible and to meet a wide
range of end-user needs. Embedded systems control many devices in common use today.

Embedded systems are controlled by one or more main processing cores that are typically
either microcontrollers or digital signal processors (DSP). The key characteristic, however, is
being dedicated to handle a particular task, which may require very powerful processors. For
example, air traffic control systems may usefully be viewed as embedded, even though they
involve mainframe computers and dedicated regional and national networks between airports
and radar sites. (Each radar probably includes one or more embedded systems of its own.)

Since the embedded system is dedicated to specific tasks, design engineers can optimize it
to reduce the size and cost of the product and increase the reliability and performance. Some
embedded systems are mass-produced, benefiting from economies of scale.Physically
embedded systems range from portable devices such as digital watches and MP3 players, to
large stationary installations like traffic lights, factory controllers, or the systems controlling
nuclear power plants. Complexity varies from low, with a single microcontroller chip, to very
high with multiple units, peripherals and networks mounted inside a large chassis or
enclosure.In general, "embedded system" is not a strictly definable term, as most systems
have some element of extensibility or programmability. For example, handheld computers
share some elements with embedded systems such as the operating systems and
microprocessors which power them, but they allow different applications to be loaded and
peripherals to be connected. Moreover, even systems which don't expose programmability as
a primary feature generally need to support software updates. On a continuum from "general
purpose" to "embedded", large application systems will have subcomponents at most points
even if the system as a whole is "designed to perform one or a few dedicated functions", and
is thus appropriate to call "embedded". A modern example of embedded system is shown in
fig: 2.1.
13

Labeled parts include microprocessor (4), RAM (6), flash memory (7).Embedded
systems programming is not like normal PC programming. In many ways, programming for
an embedded system is like programming PC 15 years ago. The hardware for the system is
usually chosen to make the device as cheap as possible. Spending an extra dollar a unit in
order to make things easier to program can cost millions. Hiring a programmer for an extra
month is cheap in comparison. This means the programmer must make do with slow
processors and low memory, while at the same time battling a need for efficiency not seen in
most PC applications. Below is a list of issues specific to the embedded field.

1.1 History:

In the earliest years of computers in the 1930–40s, computers were sometimes dedicated to a
single task, but were far too large and expensive for most kinds of tasks performed by
embedded computers of today. Over time however, the concept of programmable controllers
evolved from traditional electromechanical sequencers, via solid state devices, to the use of
computer technology.

One of the first recognizably modern embedded systems was the Apollo Guidance computer,
developed by Charles Stark Draper at the MIT Instrumentation Laboratory. At the project's
inception, the Apollo guidance computer was considered the riskiest item in the Apollo
project as it employed the then newly developed monolithic integrated circuits to reduce the
size and weight. An early mass-produced embedded system was the Autonetics D-17
guidance computer for the minuteman missile, released in 1961. It was built from transistor
logic and had a hard disk for main memory. When the Minuteman II went into production in
14

1966, the D-17 was replaced with a new computer that was the first high-volume use of
integrated circuits.

1.2 Tools

Embedded development makes up a small fraction of total programming. There's also a large
number of embedded architectures, unlike the PC world where 1 instruction set rules, and the
Unix world where there's only 3 or 4 major ones. This means that the tools are more
expensive. It also means that they're lowering featured, and less developed. On a major
embedded project, at some point you will almost always find a compiler bug of some sort.

Debugging tools are another issue. Since you can't always run general programs on your
embedded processor, you can't always run a debugger on it. This makes fixing your program
difficult. Special hardware such as JTAG ports can overcome this issue in part. However, if
you stop on a breakpoint when your system is controlling real world hardware (such as a
motor), permanent equipment damage can occur. As a result, people doing embedded
programming quickly become masters at using serial IO channels and error message style
debugging.

1.3 Resources

To save costs, embedded systems frequently have the cheapest processors that can do the job.
This means your programs need to be written as efficiently as possible. When dealing with
large data sets, issues like memory cache misses that never matter in PC programming can
hurt you. Luckily, this won't happen too often- use reasonably efficient algorithms to start,
and optimize only when necessary. Of course, normal profilers won't work well, due to the
same reason debuggers don't work well. Memory is also an issue. For the same cost savings
reasons, embedded systems usually have the least memory they can get away with. That
means their algorithms must be memory efficient (unlike in PC programs, you will frequently
sacrifice processor time for memory, rather than the reverse). It also means you can't afford to
leak memory. Embedded applications generally use deterministic memory techniques and
avoid the default "new" and "malloc" functions, so that leaks can be found and eliminated
more easily. Other resources programmers expect may not even exist. For example, most
embedded processors do not have hardware FPUs (Floating-Point Processing Unit). These
resources either need to be emulated in software, or avoided altogether.
15

1.4Real Time Issues:

Embedded systems frequently control hardware, and must be able to respond to them in real
time. Failure to do so could cause inaccuracy in measurements, or even damage hardware
such as motors. This is made even more difficult by the lack of resources available. Almost
all embedded systems need to be able to prioritize some tasks over others, and to be able to
put off/skip low priority tasks such as UI in favor of high priority tasks like hardware control.

2.Need For Embedded Systems

The uses of embedded systems are virtually limitless, because every day new products are
introduced to the market that utilizes embedded computers in novel ways. In recent years,
hardware such as microprocessors, microcontrollers, and FPGA chips have become much
cheaper. So when implementing a new form of control, it's wiser to just buy the generic chip
and write your own custom software for it. Producing a custom-made chip to handle a
particular task or set of tasks costs far more time and money. Many embedded computers
even come with extensive libraries, so that "writing your own software" becomes a very
trivial task indeed. From an implementation viewpoint, there is a major difference between a
computer and an embedded system. Embedded systems are often required to provide Real-
Time response. The main elements that make embedded systems unique are its reliability and
ease in debugging.

2.1 Debugging

Embedded debugging may be performed at different levels, depending on the facilities


available. From simplest to most sophisticate they can be roughly grouped into the following
areas:
 Interactive resident debugging, using the simple shell provided by the embedded
operating system (e.g. Forth and Basic)
 External debugging using logging or serial port output to trace operation using either
a monitor in flash or using a debug server like the Remedy Debugger which even
works for heterogeneous multi core systems.
 An in-circuit debugger (ICD), a hardware device that connects to the microprocessor
via a JTAG or Nexus interface. This allows the operation of the microprocessor to be
16

controlled externally, but is typically restricted to specific debugging capabilities in


the processor.
 An in-circuit emulator replaces the microprocessor with a simulated equivalent,
providing full control over all aspects of the microprocessor.
 A complete emulator provides a simulation of all aspects of the hardware, allowing all
of it to be controlled and modified, and allowing debugging on a normal PC.
 Unless restricted to external debugging, the programmer can typically load and run
software through the tools, view the code running in the processor, and start or stop its
operation. The view of the code may be as assembly code or source-code.

Because an embedded system is often composed of a wide variety of elements, the debugging
strategy may vary. For instance, debugging a software(and microprocessor) centric embedded
system is different from debugging an embedded system where most of the processing is
performed by peripherals (DSP, FPGA, co-processor). An increasing number of embedded
systems today use more than one single processor core. A common problem with multi-core
development is the proper synchronization of software execution. In such a case, the
embedded system design may wish to check the data traffic on the busses between the
processor cores, which requires very low-level debugging, at signal/bus level, with a logic
analyzer, for instance.

2.2 Reliability

Embedded systems often reside in machines that are expected to run continuously for years
without errors and in some cases recover by them if an error occurs. Therefore the software is
usually developed and tested more carefully than that for personal computers, and unreliable
mechanical moving parts such as disk drives, switches or buttons are avoided.
Specific reliability issues may include:
 The system cannot safely be shut down for repair, or it is too inaccessible to repair.
Examples include space systems, undersea cables, navigational beacons, bore-hole
systems, and automobiles.
 The system must be kept running for safety reasons. "Limp modes" are less tolerable.
Often backup s is selected by an operator. Examples include aircraft navigation,
reactor control systems, safety-critical chemical factory controls, train signals, engines
on single-engine aircraft.
17

 The system will lose large amounts of money when shut down: Telephone switches,
factory controls, bridge and elevator controls, funds transfer and market making,
automated sales and service.
A variety of techniques are used, sometimes in combination, to recover from errors—both
software bugs such as memory leaks, and also soft errors in the hardware:
 Watchdog timer that resets the computer unless the software periodically notifies the
watchdog
 Subsystems with redundant spares that can be switched over to
 software "limp modes" that provide partial function
 Designing with a Trusted Computing Base (TCB) architecture[6] ensures a highly
secure & reliable system environment
 An Embedded Hypervisor is able to provide secure encapsulation for any subsystem
component, so that a compromised software component cannot interfere with other
subsystems, or privileged-level system software. This encapsulation keeps faults from
propagating from one subsystem to another, improving reliability. This may also
allow a subsystem to be automatically shut down and restarted on fault detection.
 Immunity Aware Programming

3. Explanation of Embedded Systems

Software Architecture

There are several different types of software architecture in common use.

 Simple Control Loop:

In this design, the software simply has a loop. The loop calls subroutines, each of
which manages a part of the hardware or software.

 Interrupt Controlled System:

Some embedded systems are predominantly interrupt controlled. This means that tasks
performed by the system are triggered by different kinds of events. An interrupt could be
generated for example by a timer in a predefined frequency, or by a serial port controller
receiving a byte. These kinds of systems are used if event handlers need low latency and the
event handlers are short and simple .Usually these kinds of systems run a simple task in a
18

main loop also, but this task is not very sensitive to unexpected delays. Sometimes the
interrupt handler will add longer tasks to a queue structure. Later, after the interrupt handler
has finished, these tasks are executed by the main loop. This method brings the system close
to a multitasking kernel with discrete processes.

 Cooperative Multitasking:

A non-preemptive multitasking system is very similar to the simple control loop scheme,
except that the loop is hidden in an API. The programmer defines a series of tasks, and each
task gets its own environment to “run” in. When a task is idle, it calls an idle routine, usually
called “pause”, “wait”, “yield”, “nop” (stands for no operation), etc.The advantages and
disadvantages are very similar to the control loop, except that adding new software is easier,
by simply writing a new task, or adding to the queue-interpreter.

 Primitive Multitasking:

In this type of system, a low-level piece of code switches between tasks or


threads based on a timer (connected to an interrupt). This is the level at which the system is
generally considered to have an "operating system" kernel. Depending on how much
functionality is required, it introduces more or less of the complexities of managing multiple
tasks running conceptually in parallel.

As any code can potentially damage the data of another task (except in larger
systems using an MMU) programs must be carefully designed and tested, and access to
shared data must be controlled by some synchronization strategy, such as message queues,
semaphores or a non-blocking synchronization scheme.Because of these complexities, it is
common for organizations to buy a real-time operating system, allowing the application
programmers to concentrate on device functionality rather than operating system services, at
least for large systems; smaller systems often cannot afford the overhead associated with a
generic real time system, due to limitations regarding memory size, performance, and/or
battery life.

 Microkernels And Exokernels:

A microkernel is a logical step up from a real-time OS. The usual arrangement


is that the operating system kernel allocates memory and switches the CPU to different
threads of execution. User mode processes implement major functions such as file systems,
network interfaces, etc.
19

In general, microkernels succeed when the task switching and intertask


communication is fast, and fail when they are slow. Exokernels communicate efficiently by
normal subroutine calls. The hardware and all the software in the system are available to, and
extensible by application programmers. Based on performance, functionality, requirement
the embedded systems are divided into three categories:

3.2 Stand Alone Embedded System

These systems takes the input in the form of electrical signals from transducers or commands
from human beings such as pressing of a button etc.., process them and produces desired
output. This entire process of taking input, processing it and giving output is done in
standalone mode. Such embedded systems comes under stand alone embedded systems.Eg:
microwave oven, air conditioner etc..

3.3 Real-time embedded systems

Embedded systems which are used to perform a specific task or operation in a specific time
period those systems are called as real-time embedded systems. There are two types of real-
time embedded systems.

 Hard Real-time embedded systems:

 These embedded systems follow an absolute dead line time period i.e.., if the
tasking is not done in a particular time period then there is a cause of damage to
the entire equipment.

Eg: consider a system in which we have to open a valve within 30 milliseconds. If this
valve is not opened in 30 ms this may cause damage to the entire equipment. So in such cases
we use embedded systems for doing automatic operations

Eg: Consider a TV remote control system, if the remote control takes a few
milliseconds delay it will not cause damage either to the TV or to the remote control. These
systems which will not cause damage when they are not operated at considerable time period
those systems comes under soft real-time embedded systems.

3.4 Network communication embedded systems

A wide range network interfacing communication is provided by using


embedded systems.
20

Eg:Consider a web camera that is connected to the computer with internet can be
used to spread communication like sending pictures, images, videos etc.., to another
computer with internet connection throughout anywhere in the world.

 Consider a web camera that is connected at the door lock.

Whenever a person comes near the door, it captures the image of a person and
sends to the desktop of your computer which is connected to internet. This gives an alerting
message with image on to the desktop of your computer, and then you can open the door lock
just by clicking the mouse. Fig: 2.2 show the network communications in embedded systems.

Fig 2.2: Network communication embedded systems

3.5 Different types of processing units

The central processing unit (c.p.u) can be any one of the following microprocessor,
microcontroller, digital signal processing.

 Among these Microcontroller is of low cost processor and one of the main advantage
of microcontrollers is, the components such as memory, serial communication
interfaces, analog to digital converters etc.., all these are built on a single chip. The
numbers of external components that are connected to it are very less according to the
application.

 Microprocessors are more powerful than microcontrollers. They are used in major
applications with a number of tasking requirements. But the microprocessor requires
many external components like memory, serial communication, hard disk, input
output ports etc.., so the power consumption is also very high when compared to
microcontrollers.
21

 Digital signal processing is used mainly for the


applications that particularly involved with processing
of signals

4.APPLICATIONS OF EMBEDDED SYSTEMS

4.1 Consumer applications


At home we use a number of embedded systems which include microwave
oven, remote control, vcd players, dvd players, camera etc….

Automatic coffee makes equipment

4.2 Office automation


We use systems like fax machine, modem, printer etc…

4.3 Industrial automation


Today a lot of industries are using embedded systems for process control. In
industries we design the embedded systems to perform a specific operation like monitoring
temperature, pressure, humidity ,voltage, current etc.., and basing on these monitored levels
we do control other devices, we can send information to a centralized monitoring station.
22

ROBOT
In critical industries where human presence is avoided there we can use robots which are

programmed to do a specific operation


23

4.4 Computer networking

Embedded systems are used as bridges routers etc..

Computer networking

4.5 Tele communications


Cell phones, web cameras etc.

Various features of 8051 microcontroller are given as follows.


 8-bit CPU.
 16-bit Program Counter.
 8-bit Processor Status Word (PSW)
 8-bit Stack Pointer.
 Internal RAM of 128bytes.
 Special Function Registers (SFRs) of 128 bytes.
 32 I/O pins arranged as four 8-bit ports (P0 - P3)
 Two 16-bit timer/counters : T0 and T1.
24

A microcontroller is a computer with most of the necessary support chips onboard. All computers
have several things in common, namely: . A central processing unit (CPU) that ‘executes’ programs. .
Some random-access memory (RAM) where it can store data that is variable. . Some read only
memory (ROM) where programs to be executed can be stored. . Input and output (I/O) devices that
enable communication to be established with the outside world i.e. connection to devices such as
keyboard, mouse, monitors and other peripherals. There are a number of other common
characteristics that define microcontrollers. If a computer matches a majority of these
characteristics, then it can be classified as a ‘microcontroller’. Microcontrollers may be: . ‘Embedded’
inside some other device (often a consumer product) so that they can control the features or actions
of the product. Another name for a microcontroller is therefore an ‘embedded controller’. .
25

Dedicated to one task and run one specific program. The program is stored in ROM and generally
does not change. . A low-power device. A A microcontroller may take an input from the device it is
controlling and controls the device by sending signals to different components in the device. A
microcontroller is often small and low cost. The components may be chosen to minimise size and to
be as inexpensive as possible. The actual processor used to implement a microcontroller can vary
widely. In many products, such as microwave ovens, the demand on the CPU is fairly low
//INTEGRAS/ELS/PAGINATION/ELSEVIER UK/MAB/3B2/FINALS_03-11-03/CH001.3D – 2 – [1–27/27]
28.11.2003 5:04PM and price is an important consideration. In these cases, manufacturers turn to
dedicated microcontroller chips – devices that were originally designed to be low-cost, small, low-
power, embedded CPUs. The Motorola 6811 and Intel 8051 are both good examples of such chips. A
typical low-end microcontroller chip might have 1000 bytes of ROM and 20 bytes of RAM on the chip,
along with eight I/O pins. In large quantities, the cost of these chips can sometimes be just a few
pence. In this book the authors will introduce the reader to some of the Philips’ 8051 family of
microcontrollers, and show their working, with applications, throughout the book. The programming
of these devices is the same and, depending on type of device chosen, functionality of each device is
determined by the hardware devices onboard the chosen device.
26

A microcontroller may take an input from the device it is controlling and controls the device by
sending signals to different components in the device. A microcontroller is often small and low cost.
The components may be chosen to minimise size and to be as inexpensive as possible. The actual
processor used to implement a microcontroller can vary widely. In many products, such as
microwave ovens, the demand on the CPU is fairly low //INTEGRAS/ELS/PAGINATION/ELSEVIER
UK/MAB/3B2/FINALS_03-11-03/CH001.3D – 2 – [1–27/27] 28.11.2003 5:04PM and price is an
important consideration. In these cases, manufacturers turn to dedicated microcontroller chips –
devices that were originally designed to be low-cost, small, low-power, embedded CPUs. The
Motorola 6811 and Intel 8051 are both good examples of such chips. A typical low-end
microcontroller chip might have 1000 bytes of ROM and 20 bytes of RAM on the chip, along with
eight I/O pins. In large quantities, the cost of these chips can sometimes be just a few pence. In this
book the authors will introduce the reader to some of the Philips’ 8051 family of microcontrollers,
and show their working, with applications, throughout the book. The programming of these devices
is the same and, depending on type of device chosen, functionality of each device is determined by
the hardware devices onboard the chosen device.

The 80C51 microcontroller is available in a 40-pin dual-in-line (DIL) package; the arrangement is
shown in Figure C.2. Other packages are available and although the device pin functions are the
same regardless of package configuration, pinout numbers vary. The pinout numbers referred to in
the description that follows are valid only for the DIL package. A brief description of the function of
each of the pins is as follows: Supply voltage (Vcc and VSS). The device operates from a single þ5 V
supply connected to pin 40 (Vcc) while pin 20 (VSS) is grounded. Input/output (I/O) ports. 32 of the
pins are arranged as four 8-bit I/O ports P0–P3. Twenty-four of these pins are dual purpose (26 on
the 80C52/80C58) with each capable of operating as a control line or part of the data/address bus in
addition to the I/O functions. Details are as follows: . Port 0. This is a dual-purpose port occupying
pins 32 to 39 of the device. The port is an open-drain bidirectional I/O port with Schmitt trigger
inputs. Pins 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
34 35 36 37 38 39 T2/P1.0 40 T2EX/P1.1 P1.2 P1.3 P1.4 P1.5 P1.6 P1.7 RST T×D/P3.1 R×D/P3.0
INT1/P3.3 INT0/P3.2 T0/P3.4 T1/P3.5 WR/P3.6 RD/P3.7 XTAL2 XTAL1 VSS VCC P0.0/AD0 P0.1/AD1
P0.2/AD2 P0.3/AD3 P0.4/AD4 P0.5/AD5 P0.6/AD6 P0.7/AD7 EA/VPP ALE PSEN P2.7/A15 P2.6/A14
P2.5/A13 P2.4/A12 P2.3/A11 P2.2/A10 P2.1/A9 P2.0/A8 Dual in-line package Figure C.2 80C51 pin-
out layout (courtesy Philips Semiconducto
27

that have 1s written to them float and can be used as high-impedance inputs. The port may be used
with external memory to provide a multiplexed address and data bus. In this application internal
pull-ups are used when emitting 1s. The port also outputs the code bytes during EPROM
programming. External pull-ups are necessary during program verification. . Port 1. This is a
dedicated I/O port occupying pins 1 to 8 of the device. The pins are connected via internal pull-ups
and Schmitt trigger input. Pins that have 1s written to them are pulled high by the internal pull-ups
and can be used as inputs; as inputs, pins that are externally pulled low will source current via the
internal pull-ups. The port also receives the low-order address byte during program memory
verification. Pins P1.0 and P1.1 could also function as external inputs for the third timer/counter i.e.:
(P1.0) T2 Timer/counter 2 external count input/clockout (P1.1) T2EX Timer/counter 2
reload/capture/direction control . Port 2. This is a dual-purpose port occupying pins 21 to 28 of the
device. The specification is similar to that of port 1. The port may be used to provide the high-order
byte of the address bus for external program memory or external data memory that uses 16-bit
addresses. When accessing external data memory that uses 8-bit addresses, the port emits the
contents of the P2 register. Some port 2 pins receive the high-order address bits during EPROM
programming and verification. . Port 3. This is a dual-purpose port occupying pins 10 to 17 of the
device. The specification is similar to that of port 1. These pins, in addition to the I/O role, serve the
special features of the 80C51 family; the alternate func
28

PSEN (program store enable) (pin 29). This pin provides an output read strobe to external program
memory. The output is active low during the fetch stage of an instruction. The signal is not activated
during a fetch from internal memory. ALE/PROG (address latch enable/program pulse) (pin 30). The
ALE signal is an output pulse used to latch the low byte of an address during access to external
memory. The signal rate is 1/6 the oscillator frequency and can be used as a general-purpose
clock/timing pulse for the external circuitry. The pin also provides the program pulse input (PROG)
during EPROM programming. ALE can be disabled by setting SFR auxiliary.0. With this bit set ALE will
be active only during a MOV X instruction. EA/Vpp (external access/programming voltage) (pin 31).
This pin is either tied high or low according to circuit requirements. If tied high the device will
execute programs from internal memory provided the address is not higher than the last address in
the internal ROM/OTP. When the EA pin is tied low, thus disabling the internal ROM, program code
is accessed from external ROM. For a ROMless device the EA pin must be tied low permanently and
the program code accessed from external ROM could be as much as 64 KB. EPROM versions of the
device also use this pin for the supply voltage (Vpp) necessary for programming the internal EPROM.
If security bit 1 is programmed, EA will be internally latched on reset
29

6-LCD 16*2 MODULE

LCD (Liquid Crystal Display) screen is an electronic display module and find a wide range of
applications. A 16x2 LCD display is very basic module and is very commonly used in various
devices and circuits. These modules are preferred over seven segments and other multi
segment LEDs. The reasons being: LCDs are economical; easily programmable; have no
limitation of displaying special & even custom characters (unlike in seven
segments), animations and so on.
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. Click to
learn more about internal structure of a LCD.

6.1 Pin Diagram and description:


30

6.2 Description:

Pin No Function Name


Groun
1 Ground (0V)
d
2 Supply voltage; 5V (4.7V – 5.3V) Vcc
3 Contrast adjustment; through a variable resistor VEE
31

Regist
Selects command register when low; and data register when
4 er
high
Select
Read/
5 Low to write to the register; High to read from the register
write
6 Sends data to data pins when a high to low pulse is given Enable
7 DB0
8 DB1
9 DB2
10 DB3
8-bit data pins
11 DB4
12 DB5
13 DB6
14 DB7
15 Backlight VCC (5V) Led+
16 Backlight Ground (0V) Led-

SENSOR : The HC-SR04 ultrasonic sensor uses sonar to determine distance to an


object like bats do. It offers excellent non-contact range detection with high accuracy
and stable readings in an easy-to-use package. From 2cm to 400 cm or 1” to 13 feet. It
operation is not affected by sunlight or black material like Sharp rangefinders are
(although acoustically soft materials like cloth can be difficult to detect). It comes
complete with ultrasonic transmitter and receiver module.
32

Features
 Power Supply :+5V DC

 Quiescent Current : <2mA

 Working Current: 15mA

 Effectual Angle: <15°

 Ranging Distance : 2cm – 400 cm/1″ – 13ft

 Resolution : 0.3 cm

 Measuring Angle: 30 degree

 Trigger Input Pulse width: 10uS

 Dimension: 45mm x 20mm x 15mm

 Trig : Trigger (INPUT)

 Echo: Echo (OUTPUT)


33

 GND: GND

Chapter 3. Hardware and Software Design


Arduino is a prototyping platform for controlling many devices. Through Arduino, we can
built many prototypes that we imagine. A basic Arduino kit which forms the connection
between the LCD and Ultrasonic sensor. Here the LCD is the source to display the output.
Through this LCD display we can be able to see the distance of the vehicles that comes.
Ultrasonic sensor is to sense the vehicles that nears about to 20 cm Bread boards which
allows to implement all the connections accompained by the two LEDs.
34

Chapter 3.1:BLOCK DIAGRAM

3.2 CIRCUIT DIAGRAM


35
36

3.3 FLOW CHART

PROGRAM
////Collision Warning System////

#include <LiquidCrystal.h> // includes the LiquidCrystal Library


37

LiquidCrystal lcd(6,7,8,9,10,11); // Creates an LCD object. Parameters: (rs, enable, d4, d5,
d6, d7)

const int trigPin = 12;

const int echoPin = 13;

int buzz = 2;

long duration;

int distance;

// the setup function runs once when you press reset or power the board

void setup() {

// initialize digital pin 13 as an outp

lcd.begin(16,2);

pinMode(trigPin, OUTPUT);

pinMode(echoPin, INPUT);

pinMode(3, OUTPUT);

pinMode(4, OUTPUT);

Serial.begin(9600);

// the loop function runs over and over again forever

void loop()

// Clears the trigPin

digitalWrite(trigPin, LOW);

delayMicroseconds(2);
38

// Sets the trigPin on HIGH state for 10 micro seconds

digitalWrite(trigPin, HIGH);

delayMicroseconds(10);

digitalWrite(trigPin, LOW);

// Reads the echoPin, returns the sound wave travel time in microseconds

duration = pulseIn(echoPin, HIGH);

// Calculating the distance

distance= duration*0.034/2;

// Prints the distance on the Serial Monitor

if(distance <= 40 && distance >= 20)

digitalWrite(3, HIGH);

delay(100);

lcd.clear();

lcd.setCursor(0,0); // Sets the location at which subsequent text written to the LCD will
be displayed

lcd.print("Distance: "); // Prints string "Distance" on the LCD

lcd.print(distance); // Prints the distance value from the sensor

lcd.print(" cm");

delay(10);

//lcd.clear();

// digitalWrite(3, LOW);

// turn the LED on (HIGH is the voltage level)

}
39

else

digitalWrite(3, LOW); // turn the LED off by making the voltage LOW

delay(100);

if(distance <= 20)

digitalWrite(4, HIGH);

delay(100);

digitalWrite(buzz,HIGH);

delay(100);

lcd.clear();

lcd.setCursor(0,0); // Sets the location at which subsequent text written to the LCD will
be displayed

lcd.print("Distance: "); // Prints string "Distance" on the LCD

lcd.print(distance); // Prints the distance value from the sensor

lcd.print(" cm");

delay(10);

/*tone(buzz, 2000);

delay(100);

noTone(buzz);

delay(100);

tone(buzz, 2000);
40

delay(100);

noTone(buzz);

delay(100);

tone(buzz, 2000);

delay(100);

noTone(buzz);

tone(buzz, 2000);

delay(100);

noTone(buzz);

delay(100);*/

else

digitalWrite(4, LOW); // turn the LED off by making the voltage LOW

delay(100);

digitalWrite(buzz,LOW);

delay(100);

// wait for a second

ADVANTAGES:
 *Enabling drivers to be aware of their environment, even if line of sight is
not present
 * Implementing a low cost device that can be adapted to any intersection
 *Developing a collision warning system that captures driver attention
41

 * Providing a system that is easily installed and maintained.


42

11.RESULT
The project “Arduino based collision prevention warning system” was designed
and is found that the designed hardware has shown consistently faithful readings and also
proved to be accurate.
43

12.CONCLUSION
In this paper we proposed and implement the collision prevention system. The basic idea
behind this project is to avoid acciendents. It is a precautionary measure that alerts the
driver .the initial stage begins from the ultrasonic sensor that identifies the vehicle in the
front and back side. If the car reaches 10 meter, green color light will glow that will show
the notification. At 8 meter distance yellow color light will alerts us. When it reaches 5
meter distance red color light will alerts us we are in danger zone.At the same time the
distance between one vehicle and another vehicle was displayed in LCD. Wire connections
are made from the bread board to the LCD.aurdino kit to the ultrasonic sensors and finally
bread board to the aurdino kit. This project will make easy calculation of an distance
between one vehicle and another vehicle for the driver. Conclusion

.Using this system we may avoid many accidents happened due to the following system .The
system comprises,very low cost components such as ultrasonic sensor,LCD and LEDs. This
system might have many advantage such as,

 Use the knows the distance about following vehicle

 In future, we are going to reduce the speed of one vehicle according to the following
distance of other vehicle. By this system, we may prevent many accidents and INDIA will
become a accident less country

Chapter -: Future Scope


44

Potrebbero piacerti anche