You are on page 1of 75

CHAPTER 1

INTRODUCTION

1.1 INTRODUCTION:

Street crossing point the executives is done through traffic lights. The wasteful traffic signal
administration causes different issues, deferral of explorers, misuse of vitality and declining air
quality. At times, it ought to conjointly add to transport mishaps. Proposed radio frequency as this
technology uses only radio waves for its operation of identification of different objects. In another
existing System ultrasonic sensor HCSR04 is used to calculate the distance for Smart Traffic system.
According to all these papers, a convenient wireless communication between emergency vehicles and
the traffic light is by using RF. The prototype of this project is using the radio frequency of 535 MHz
compared to the range of about 15 kHz to 350 GHz of frequency which have been reserved for the RF
theoretically Both existing System is not able to distinguish between normal vehicles and emergency
vehicles. This problem should be overcome, emergency vehicles such as ambulance fire brigade
vehicles can struck in traffic. One of the loop hole in the existing System is, if traffic is block for
longer time, the punching machine is place very starting and hence driver has to leave the vehicle take
the RFID and go there and at last punch, after this the drive has to come quickly because signal for
emergency vehicles will closed after 45 second, if it is not succeeded then the above step has to repeat
and it will take time which will create delay for them. So this way the existing system will not able to
resolve the problem related to traffic jam.

Today’s world is developing at a rapid speed. Everyday a new technology is discovered and
developed. At the same time many problems are being faced by people in smart cities. Some of these
problems are heavy traffic jams due to which loss of lives occur if the arrival of ambulance to the
hospital is delayed. Also many a times, even if the ambulance arrives at the hospital, the doctors may
delay in treating the patient due to several reasons such as the hospital may not have the required
facilities to treat the patient, it may not have the specialist required for that particular incident and
many other. Current traffic control techniques include strobe emitter, siren detectors, magnetic loop
detectors buried in the road, infrared and radar sensors on the sides of the road. All these techniques
provide limited traffic information to make way for the ambulance. Another technology named RFID
1
is a wireless technology that uses radio frequency electromagnetic energy to carry the information
between the RFID tag placed on the ambulance and the RFID reader placed on the traffic signal pole.
The disadvantage of this system is that it only works within certain ranges. Technologies like zigbee
and GSM can also be used in traffic control but in the zigbee technology, the usages of number of
channels vary depending on the radio frequency range. The GSM operates only over a subscription to
a mobile operator, just like mobile phone. To overcome these disadvantages an android application is
being developed. The main objective of this application is to control the traffic, allowing an
ambulance to arrive at a particular location without stopping anywhere until the destination is reached.
The proposed application consists of four modules: the user module, the traffic hub module, the
hospital module and the ambulance module. The user module provides the details of the patient. The
ambulance module finds the location of the user after receiving the details of the user. The traffic
module clears the traffic on receiving the user information. The hospital module makes prior
arrangements to treat the patient on receiving the details of the user. The details of the user, the
information given by traffic control room and the hospital are maintained by the server. The proposed
application will also use GPS system to track the location of the ambulance which will give a clear
picture to the traffic hub/policeman for clearing the traffic and to the user-selected hospital for making
preparations to treat the patient as per the user’s details. Time management as well as cost
management is ensured through this application as a lot of time is saved at signals and shortest
distances. are tracked with the help of GPS. This proposed application can be used by all types of
ambulances and hospitals.

Traffic congestion and tidal flow management were recognized as major problems. In India as
the population is being increasing day by day the traffic is also increasing with proportionality. So the
traffic signals need good coordination for the smooth flow of traffic during the peak hours .. Moreover
road accidents in the city have been incessant and to bar the loss of life due to the accidents is even
more crucial. In this fast moving world we are in a compulsion to rush our self which makes the
traffic congestion and accident an inevitable one. In foreign countries, they successfully save human
life, because whenever an ambulance comes they move aside to clear out the route till the ambulance
passes through. On the other hand in INDIA, whenever an ambulance comes it is controlled manually
at the traffic junction by a traffic officer. Nowadays all systems are working automatically. So, we
proposed system called “traffic clearance for emergency vehicles using blue mode”. Population is
largely increasing worldwide. Obviously the reason for mobility is high, traffic problem is also, and

2
unwanted changes in the environment are becoming major problems. Till relatively recently,
substructure improvements have been the first stage to fight with such problems. Every traffic
junction will have a senor detecting the ambulance before traffic signal and will display the blue light
with LCD which will help to clear the route for ambulance. As the IR sensor is detecting the
ambulance passing through it, it gives command to microcontroller due to which there is display
LCD's and blinking of LED's. If blue LED blinks simultaneously green will blink which will indicate
other people to make side for ambulance.[3] Thus we propose a EARCS ( Emergency Ambulance
Route Clearing System) design for controlling the traffic and achieving the above mentioned data so
that the ambulance would be able to cross all the traffic signals without waiting. The time loss and
resource loss due to this traffic problem can be solved to a great extent by a novel idea proposed here
i.e., by using ‘EARCS’ technology along with the applications of ‘IR SENSORS’ systems where
EARCS is used for object density detection, for the shortest path detection of ambulance to
communicate to other vehicles within a certain range so that route can be clear for ambulance to reach
the hospital in golden hours. The tendency of international logistics globalization has promoted the
development of port logistics. The rapid increase of the amount of vehicle that passes through ports is
putting high demands on the efficiency of port logistics. INDIA is one of the most populous Country
in the World and is a fast growing financial prudence. It is seen that terrible road congestion problems
in cities. Infrastructure growth is slow as compared to the growth in number of vehicles, due to space
and cost bounds. Also, Indian traffic is non-lane based. It needs a traffic control solutions, which are
Different from the other Countries. Smart management of traffic flows can reduce the negative effect
of congestion.

3
CHAPTER 2

LITERATURE SURVEY

Automatic Lane Clearance System for Emergency Vehicles, A new model proposed in this paper
which provides the functionality of one path clearance i.e. the ambulance going path will be cleared is
Developing a Smart Traffic Management System for Ambulance Rescue, Congestion Control, Control
Signal Violation an Stolen Vehicle Tracking. Thus we also provide facility for congestion control by
sensing the traffic density using IR Sensor. This will be reflected on the particular signal. The Stolen
Vehicle Tracking System will help us to keep a track of Stolen Vehicles and report them to the
authorities. Another application provided by our project is that if any vehicle violates the signal they
will receive a warning message on their phone from the control room and if they trespass the violation
limit then their licence will be terminated [1]. Intelligent Traffic Control Management System. The
first application and the most widespread problem is that traffic congestion. Here we introduce a
RFID technology to overcome this traffic congestion problem. The second application in traffic
management is detection of the stolen vehicle. The stolen vehicle will be detected by the RFID tag
which will be attached to the vehicle once the complaint will be registered in the control room. And
the owner will get the information about his vehicle which has been stolen through GSM technology.
The third application is clearance for the emergency vehicle in that heavy traffic congestion. That is,
the arrival of the ambulance is to be communicated to the nearest traffic signal, so that it can turn the
light to green and hence clear the traffic. [2]. Design of an Automated Traffic Control System for
Emergency Vehicle Clearance, This system aims at providing clearance to Emergency vehicles like
ambulance, fire engine that need to reach their destinations at the earliest. Our project not only
provides sufficient amount of time for ambulance to pass the signal without hindrance but even
allowsa smooth traffic movement in other roads joining the junction. The proposed “Automated
Traffic light controller” system provides clearance to Emergency vehicles using Radio Frequency
Identification (RFID) module that consists of RFID tag and an RFID reader and a GSM modem [3].
Dynamic Traffic Control System using RFID Technology: A Systematic Review, Traffic congestion
often causes loss of time, time delay, missed opportunities, etc. To overcome these problems proposed
system uses the RFID technology where RFID tag is attached to each vehicle and as and when vehicle
reach the traffic junction the RFID reader will read those RFID tags. Depending upon the count of
vehicles green passage will be set dynamically and the proposed system provides special privileges

4
for emergency vehicles like police vehicle, ambulance, VIP vehicles, etc. RFID also enforces law
against stolen vehicles [4]. Intelligent Traffic Management System It is quite obvious, going by the
current state of affairs, that our roads are not desirable places to be and a solution dedicated to ensure
smooth flow of traffic will go a long way in making road travel a lot more convenient. It has been
identified that the challenge mainly lies in channelizing traffic from heavy traffic zones into alternate
routes thereby making optimum use of road space, in turn ensuring smooth flow of traffic. In this
regard a simple mechanism which makes use of RFID technology has been described. The add on
applications of this system such as tracing of stolen cars, vehicles that evade traffic signals/tickets, toll
collection or vehicle taxes also make this system even more important because many other equally
relevant road traffic issues are addressed[5]. Automatic Lane Clearance System for Emergency
Vehicles As the entire system is automated, it requires very less human intervention. Emergency
vehicles need to reach their destinations at the earliest. If they spend a lot of time in traffic jams. With
emergency vehicle clearance, the traffic signal turns to green as long as the emergency vehicle is
waiting in the traffic junction. The signal turns to red, only after the emergency vehicle passes
through. Currently, it is implemented system by considering one road of the traffic junction [6].
Traffic Management for Emergency Vehicle Priority Based on Visual Sensing, This paper has
presented an approach to schedule emergency vehicles in traffic. The approach combines the
measurement of distance between the emergency vehicle and intersections using visual sensing
methods, vehicle counting and time sensitive alert transmission within the sensor network. The
distance between the emergency vehicle and the intersection is calculated from visual data using
Euclidean distance, Manhattan distance and Canberra distance techniques for comparison. The
experimental results have shown that the Euclidean distance outperforms other distance measurement
techniques and is suitable for real-time applications [7]. Traffic Clearance for Emergency Vehicles
Using Priority Mode, The main motto behind our project is to provide a smart way of controlling
traffic light timing during a peak hours and also to provide smooth flow for the ambulance to reach
the hospital in time .We are going to implement a new mode called “ambulance mode” which would
control the traffic lights in the path of the ambulance. This scheme is fully automated thus it controls
the traffic lights, helping to reach the hospital in time. This is not preferred only for ambulance. It is
preferable for other emergency vehicles such as fire engine [8]. Intelligent Traffic Control System for
Emergency Vehicle, The proposed design is based on a traffic controlling, which allow high priorities
vehicles like ambulance. Each ambulance is configured with Zigbee module (placed at a predefined
location). In this module PICAT89C52 system-on-chip module uses to read the ZIGBEE module
5
attached to the vehicle. It recognizes the time span of green light of respective path. As the ambulance
is heading toward the junction, the green signal will turn ON. The signal will turn ON by
communication with the traffic controller which is placed at junction. With the help of ZigBee
modules and PICAT89C2051, System on chip wireless communication takes place between
ambulance and traffic controller. The module is tested and the experimental results were found is
expected [9]. In early days, the traffic is controlled manually by police officer. They decide when the
vehicle has to cross the road and also provide importance to the emergency vehicle. Then in
Intelligent Traffic Management System, the traffic is controlled automatically by each lane 120
seconds of green light is set on. Before green light, yellow light flashes for 20 second, signifying to
start your vehicle and be ready to go. The disadvantages of this system is it does not provide timing
based on priority because of that people has to wait for long time even though there is no traffic and
also does not recognize and prioritize the emergency vehicle.[10] They consists of two parts :wireless
sensors network(traffic sensor nodes(TSN) groups) and a control box. In this they collected traffic
data with help of sensors and control the traffic. [12] Describes the concept of traffic clearance in
which the time delay (6s) between the switching of signals is based on the congestion of vehicle. In
our project we use 10s for green light to be left ON. If the congestion increases this duration will be
extended to 20s. [13]Describes about density based traffic clearance. Initially we started this project
only for ambulance mode but we thought of using this concept for normal mode also by using the
knowledge of this paper. [14] Portrays area occupied by the edges of vehicle will be considered to
estimate vehicles density using image processing. We make use of this concept in our project to clear
the traffic congestion in normal mode. Due to insufficient time we have used IR sensor instead.
Keeping this paper as reference we can extend our project by placing camera at junction in four ways.
[15]Traffic is cleared using green wave system. The green wave is the synchronization of the green
phase of traffic signals. The disadvantage of this system is that if green wave is disturbed the traffic
will collapse. [16]Way for ambulance in lane is provided through RFID technology. The system may
not work, if the ambulance needs to take another route for some reasons or if the starting point is not
known in advance. [17] Uses two RFID readers which will identify traffic density on two roads.
When emergency vehicle is on lane it turn traffic signal to green.[18]The images sequences from a
camera are analyzed using various edge detection and object counting methods to obtain the most
efficient technique to provide smooth flow for the vehicle using” Lab VIEW stimulation”.

6
CHAPTER 3

EXISTING SYSTEM

Existing system is control the traffic signals with three lighting systems. Traffic system which has
four directions east, west, north, south directions change the green traffic light automatically for every
programmed time. Due to manual controlling of traffic in emergency case people lose their life. The
biggest problem for every emerging smart city to deal with traffic jam. The RTO officer Manage
traffic system manually. We proposed new advanced traffic route clearance system with wireless
communication model. It’s very easy and effective system.

Fig.3.1 Time Based Traffic Control System

7
CHAPTER 4

PROPOSED SYSTEM

As we have mentioned to achieve the objectives of our work, there are two modules in this work. First
part consists of identification of the number of vehicles passed through the signal and detecting the
congestion of traffic. This data is analyzed and the green light of traffic signal is set. Second part
consists of a transmitter and a receiver which is used near the traffic junction Secondly, a transmitter
and receiver is being used near traffic signal for the ambulance. Traffic clearance whenever the
ambulance goes through the traffic signal, the particular signal that the ambulance moving switches
on to green automatically

Fig.4.1 Transmitter Block diagram

8
In the proposed system contains two sections. Transmitter section will be in Ambulance vehicle with
RF transmitter module activation. When the RF receiver signal receives the data then second section
receive the data through RF receiver and turn traffic signals to green.

Fig.4.2 Receiver Block diagram

9
CHAPTER 5

EMBEDDED SYSTEM

5.1 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

1
a few dedicated functions", and is thus appropriate to call "embedded". A modern example of
embedded system is shown in fig: 2.1.

Fig 5.1:A modern example of embedded system

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.

5.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.

1
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 1966, the D-17 was replaced with a
new computer that was the first high-volume use of integrated circuits.

5.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.

5.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.

1
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.

5.1.4 Real 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.

5.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.

5.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:
1
 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 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.

5.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:

1
 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
backups are selected by an operator. Examples include aircraft navigation, reactor control
systems, safety-critical chemical factory controls, train signals, engines on single-engine
aircraft.
 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

5.3 Explanation of Embedded Systems:

5.3.1 Software Architecture:

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

 Simple Control Loop:

1
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 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

1
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.

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:

5.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..

5.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:


1
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.

 Soft Real Time embedded systems:

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.

5.3.4 Network communication embedded systems:

A wide range network interfacing communication is provided by using embedded


systems.

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.

1
Fig 5.2: Network communication embedded systems

5.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.

 Digital signal processing is used mainly for the applications that particularly involved with
processing of signals

1

5.4 APPLICATIONS OF EMBEDDED SYSTEMS:

5.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….

Fig5.3: Automatic coffee makes equipment

5.4.2 Office automation:

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

Fig5.4: Fax machine Fig5.5: Printing machine

2
5.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.

Fig5.6: Robot

In critical industries where human presence is avoided there we can use robots which
are programmed to do a specific operation.

5.4.4 Computer networking:

Embedded systems are used as bridges routers etc..

2
Fig5.7: Computer networking

5.4.5 Tele communications:

Cell phones, web cameras etc.

Fig5.8: Cell Phone Fig5.9: Web camera

2
CHAPTER 6
HARDWARE DESCRIPTION
6.1 Micro controller:

Fig: 6.1 Microcontrollers

6.1.1 Introduction to Microcontrollers:

Circumstances that we find ourselves in today in the field of microcontrollers had their
beginnings in the development of technology of integrated circuits. This development has made it
possible to store hundreds of thousands of transistors into one chip. That was a prerequisite for
production of microprocessors, and the first computers were made by adding external peripherals such
as memory, input-output lines, timers and other. Further increasing of the volume of the package
resulted in creation of integrated circuits. These integrated circuits contained both processor and
peripherals. That is how the first chip containing a microcomputer, or what would later be known as a
microcontroller came about.

Microprocessors and microcontrollers are widely used in embedded systems products.


Microcontroller is a programmable device. A microcontroller has a CPU in addition to a fixed amount
of RAM, ROM, I/O ports and a timer embedded all on a single chip. The fixed amount of on-chip
ROM, RAM and number of I/O ports in microcontrollers makes them ideal for many applications in
which cost and space are critical.

The AVR is a modified Harvard architecture 8-bit RISC single

2
chip microcontroller which was developed by Atmel in 1996. The AVR was one of the first

2
microcontroller families to use on-chip flash memory for program storage, as opposed to One-Time
Programmable ROM, EPROM, or EEPROM used by other microcontrollers at the time.

Crystal Oscillator:

XTAL1 and XTAL2 are input and output, respectively, of an inverting amplifier which can be
configured for use as an On-chip Oscillator, Either a quartz

Crystal or a ceramic resonator may be used. The CKOPT Fuse selects between two different
Oscillator amplifier modes. When CKOPT is programmed, the Oscillator output will oscillate a full
rail-to-rail swing on the output. This mode is suitable when operating in a very noisy environment or
when the output from XTAL2 drives a second clock buffer. This mode has a wide frequency range.
When CKOPT is unprogrammed, the Oscillator has a smaller output swing. This reduces power
consumption considerably.

This mode has a limited frequency range and it cannot be used to drive other clock buffers.
For resonators, the maximum frequency is 8 MHz with CKOPT unprogrammed and 16 MHz with
CKOPT programmed. C1 and C2 should always be equal for both crystals and resonators. The
optimal value of the capacitors depends on the crystal or resonator in use, the amount of stray
capacitance, and the electromagnetic noise of the environment. For ceramic resonators, the capacitor
values given by the manufacturer should be used. The Oscillator can operate in three different modes,

2
each optimized for a specific frequency range. The operating mode is selected by the fuses
CKSEL3..1

AVR Architecture:

Memory: It has 8 Kb of Flash program memory (10,000 Write/Erase cycles durability), 512 Bytes of
EEPROM (100,000 Write/Erase Cycles). 1Kbyte Internal SRAM
I/O Ports: 23 I/ line can be obtained from three ports; namely Port B, Port C and Port D.
Interrupts: Two External Interrupt source, located at port D. 19 different interrupt vectors
supporting 19 events generated by internal peripherals.
Timer/Counter: Three Internal Timers are available, two 8 bit, one 16 bit, offering various
operating modes and supporting internal or external clocking.
SPI (Serial Peripheral interface): ATmega8 holds three communication devices integrated. One of
them is Serial Peripheral Interface. Four pins are assigned to Atmega8 to implement this scheme of
communication.
USART: One of the most powerful communication solutions is USART and ATmega8 supports
both synchronous and asynchronous data transfer schemes. It has three pins assigned for that. In many
projects, this module is extensively used for PC-Micro controller communication.
TWI (Two Wire Interface): Another communication device that is present in ATmega8 is Two
Wire Interface. It allows designers to set up a commutation between two devices using just two wires
along with a common ground connection, As the TWI output is made by means of open collector
outputs, thus external pull up resistors are required to make the circuit.
Analog Comparator: A comparator module is integrated in the IC that provides comparison facility
between two voltages connected to the two inputs of the Analog comparator via External pins
attached to the micro controller.
Analog to Digital Converter: Inbuilt analog to digital converter can convert an analog input signal
into digital data of 10bit resolution. For most of the low end application, this much resolution is
enough.

2
Microcontroller: Microcontroller can be termed as a single on chip computer which includes
number of peripherals like RAM, EEPROM, Timers etc., required to perform some predefined task.

The computer on one hand is designed to perform all the general purpose tasks on a single
machine like you can use a computer to run a software to perform calculations or you can use a
computer to store some multimedia file or to access internet through the browser, whereas the
microcontrollers are meant to perform only the specific tasks, for e.g., switching the AC off
automatically when room temperature drops to a certain defined limit and again turning it ON when
temperature rises above the defined limit.

There are number of popular families of microcontrollers which are used in different
applications as per their capability and feasibility to perform the desired task, most common of these
are 8051, AVR and PIC microcontrollers. In this article we will introduce you with AVR family of
microcontrollers.

AVR was developed in the year 1996 by Atmel Corporation. The architecture of AVR was
developed by Alf-Egil Bogen and Vegard Wollan. AVR derives its name from its developers and
stands for Alf-Egil Bogen Vegard Wollan RISC microcontroller, also known
as Advanced Virtual RISC. The AT90S8515 was the first microcontroller which was based on AVR
architecture however the first microcontroller to hit the commercial market was AT90S1200 in the
year 1997.
2
AVR microcontrollers are available in three categories:

1. TinyAVR – Less memory, small size, suitable only for simpler applications

2. MegaAVR – These are the most popular ones having good amount of memory (upto 256 KB),
higher number of inbuilt peripherals and suitable for moderate to complex applications.

3. XmegaAVR – Used commercially for complex applications, which require large program
memory and high speed.

6.1.2 DEVICE ARCHITECTURE

Device architecture

Flash, EEPROM, and SRAM are all integrated onto a single chip, removing the need for
external memory in most applications. Some devices have a parallel external bus option to allow
adding additional data memory or memory-mapped devices. Almost all devices (except the smallest

2
TinyAVR chips) have serial interfaces, which can be used to connect larger serial EEPROMs or flash
chips.

Program memory

Program instructions are stored in non-volatile flash memory. Although the MCUs are 8-bit,
each instruction takes one or two 16-bit words.

The size of the program memory is usually indicated in the naming of the device itself (e.g., the
ATmega64x line has 64 kB of flash while the ATmega32x line has 32 kB).

There is no provision for off-chip program memory; all code executed by the AVR core must reside in
the on-chip flash. However, this limitation does not apply to the AT94 FPSLIC AVR/FPGA chips.

Internal data memory

The data address space consists of the register file, I/O registers, and SRAM.

Internal registers

The AVRs have 32 single-byte registers and are classified as 8-bit RISC devices.

In most variants of the AVR architecture, the working registers are mapped in as the first 32
memory addresses (000016–001F16) followed by the 64 I/O registers (002016–005F16).

Actual SRAM starts after these register sections (address 006016). (Note that the I/O register
space may be larger on some more extensive devices, in which case the memory mapped I/O registers
will occupy a portion of the SRAM address space.)

Even though there are separate addressing schemes and optimized opcodes for register file and I/O
register access, all can still be addressed and manipulated as if they were in SRAM.

In the XMEGA variant, the working register file is not mapped into the data address space; as
such, it is not possible to treat any of the XMEGA's working registers as though they were SRAM.
Instead, the I/O registers are mapped into the data address space starting at the very beginning of the
address space. Additionally, the amount of data address space dedicated to I/O registers has grown
substantially to 4096 bytes (000016–0FFF16). As with previous generations, however, the fast I/O
manipulation instructions can only reach the first 64 I/O register locations (the first 32 locations for
bitwise instructions). Following the I/O registers, the XMEGA series sets aside a 4096 byte range of

2
the data address space which can be used optionally for mapping the internal EEPROM to the data
address space (100016–1FFF16). The actual SRAM is located after these ranges, starting at 200016.

EEPROM

Almost all AVR microcontrollers have internal EEPROM for semi-permanent data storage.
Like flash memory, EEPROM can maintain its contents when electrical power is removed.

In most variants of the AVR architecture, this internal EEPROM memory is not mapped into
the MCU's addressable memory space. It can only be accessed the same way an external peripheral
device is, using special pointer registers and read/write instructions which makes EEPROM access
much slower than other internal RAM.

However, some devices in the SecureAVR (AT90SC) family use a special EEPROM mapping
to the data or program memory depending on the configuration. The XMEGA family also allows the
EEPROM to be mapped into the data address space.

Since the number of writes to EEPROM is not unlimited — Atmel specifies 100,000 write cycles in
their datasheets — a well designed EEPROM write routine should compare the contents of an
EEPROM address with desired contents and only perform an actual write if the contents need to be
changed.

Note that erase and write can be performed separately in many cases, byte-by-byte, which may
also help prolong life when bits only need to be set to all 1s (erase) or selectively cleared to 0s (write).

Program execution

Atmel's AVRs have a two stage, single level pipeline design. This means the next machine
instruction is fetched as the current one is executing. Most instructions take just one or two clock
cycles, making AVRs relatively fast among eight-bit microcontrollers.

The AVR processors were designed with the efficient execution of compiled C code in mind and have
several built-in pointers for the task.

MCU speed

The AVR line can normally support clock speeds from 0 to 20 MHz, with some devices
reaching 32 MHz. Lower powered operation usually requires a reduced clock speed. All recent (Tiny,
Mega, and Xmega, but not 90S) AVRs feature an on-chip oscillator, removing the need for external

2
clocks or resonator circuitry. Some AVRs also have a system clock prescaler that can divide down the
system clock by up to 1024. This prescaler can be reconfigured by software during run-time, allowing
the clock speed to be optimized.

Since all operations (excluding literals) on registers R0 - R31 are single cycle, the AVR can
achieve up to 1 MIPS per MHz, i.e. an 8 MHz processor can achieve up to 8 MIPS. Loads and stores
to/from memory take two cycles, branching takes two cycles. Branches in the latest "3-byte PC" parts
such as ATmega2560 are one cycle slower than on previous devices

Features:

• High-performance, Low-power Atmel®AVR® 8-bit Microcontroller

• Advanced RISC Architecture

– 130 Powerful Instructions – Most Single-clock Cycle Execution

– 32 × 8 General Purpose Working Registers

– Fully Static Operation

– Up to 16MIPS Throughput at 16MHz

– On-chip 2-cycle Multiplier

• High Endurance Non-volatile Memory segments

– 8Kbytes of In-System Self-programmable Flash program memory

– 512Bytes EEPROM

– 1Kbyte Internal SRAM

– Write/Erase Cycles: 10,000 Flash/100,000 EEPROM

– Data retention: 20 years at 85°C/100 years at 25°C(1)

– Optional Boot Code Section with Independent Lock Bits

In-System Programming by On-chip Boot Program

3
True Read-While-Write Operation

– Programming Lock for Software Security

• Peripheral Features

– Two 8-bit Timer/Counters with Separate Prescaler, one Compare Mode

– One 16-bit Timer/Counter with Separate Prescaler, Compare Mode, and Capture

Mode

– Real Time Counter with Separate Oscillator

– Three PWM Channels

– 8-channel ADC in TQFP and QFN/MLF package

Eight Channels 10-bit Accuracy

– 6-channel ADC in PDIP

package Six Channels 10-bit

Accuracy

– Byte-oriented Two-wire Serial Interface

– Programmable Serial USART

– Master/Slave SPI Serial Interface

– Programmable Watchdog Timer with Separate On-chip Oscillator

– On-chip Analog Comparator

• Special Microcontroller Features

– Power-on Reset and Programmable Brown-out Detection

– Internal Calibrated RC Oscillator

– External and Internal Interrupt Sources


3
– Five Sleep Modes: Idle, ADC Noise Reduction, Power-save, Power-down, and

Standby

• I/O and Packages

– 23 Programmable I/O Lines

– 28-lead PDIP, 32-lead TQFP, and 32-pad QFN/MLF

• Operating Voltages

– 2.7V - 5.5V (ATmega8L)

– 4.5V - 5.5V (ATmega8)

• Speed Grades

– 0 - 8MHz (ATmega8L)

– 0 - 16MHz (ATmega8)

• Power Consumption at 4Mhz, 3V, 25oC

– Active: 3.6mA

– Idle Mode: 1.0mA

– Power-down Mode: 0.5µA

Brown-out Detector:

If the Brown-out Detector is not needed in the application, this module should be turned off. If
the Brown-out Detector is enabled by the BODEN Fuse, it will be enabled in all sleep modes, and
hence, always consume power. In the deeper sleep modes, this will contribute significantly to the total
current consumption. Refer to “Brown-out Detection” on page 38 for details on how to configure the
Brown-out Detector.

Internal Voltage Reference the Internal Voltage Reference will be enabled when needed by the
Brown-out Detector, the Analog Comparator or the ADC. If these modules are disabled as described
3
in the sections above, the internal voltage reference will be disabled and it will not be consuming
power. When turned on again, the user must allow the reference to start up before the output is used.
If the reference is kept on in sleep mode, the output can be used immediately. Refer to “Internal
Voltage Reference” on page 40 for details on the start-up time. Watchdog Timer If the Watchdog
Timer is not needed in the application, this module should be turned off.

If the Watchdog Timer is enabled, it will be enabled in all sleep modes, and hence, always
consume power. In the deeper sleep modes, this will contribute significantly to the total current
consumption. Refer to “Watchdog Timer” on page 41 for details on how to configure the Watchdog
Timer. Port Pins When entering a sleep mode, all port pins should be configured to use minimum
power.

The most important thing is then to ensure that no pins drive resistive loads. In sleep modes
where the both the I/O clock (clkI/O) and the ADC clock (clkADC) are stopped, the input buffers of
the device will be disabled. This ensures that no power is consumed by the input logic when not
needed. In some cases, the input logic is needed for detecting wake-up conditions, and it will then be
enabled. Refer to the section “Digital Input Enable and Sleep Modes” on page 53 for details on which
pins are enabled. If the input buffer is enabled and the input signal is left floating or have an analog
signal level close to VCC/2, the input buffer will use excessive power.

Power-on Reset:

A Power-on Reset (POR) pulse is generated by an On-chip detection circuit. The detection
level is defined in Table 15. The POR is activated whenever VCC is below the detection level. The
POR circuit can be used to trigger the Start-up Reset, as well as to detect a failure in supply voltage.

A Power-on Reset (POR) circuit ensures that the device is reset from Power-on. Reaching the
Power-on Reset threshold voltage invokes the delay counter, which determines how long the device is
kept in RESET after VCC rise. The RESET signal is activated again, without any delay, when VCC
decreases below the detection level.

External Reset:

3
An External Reset is generated by a low level on the RESET pin. Reset pulses longer than the
minimum pulse width (see Table 15) will generate a reset, even if the clock is not running. Shorter
pulses are not guaranteed to generate a reset. When the applied signal reaches the Reset Threshold
Voltage – VRST on its positive edge, the delay counter starts the MCU after the time-out period
tTOUT has expired.

6.1.3 Pin diagram:

3
Fig.6.5.1.PIN DIAGRAM OF ATMEGA328

VCC
Digital supply voltage magnitude of the voltage range between 4.5 to 5.5 V for the ATmega8 and 2.7
to 5.5 V for ATmega8L

GND
Ground Zero reference digital voltage supply.

PORTB (PB7.. PB0)

PORTB is a port I / O two-way (bidirectional) 8-bit with internal pull-up resistor can be selected. This
port output buffers have symmetrical characteristics when used as a source or sink. When used as an
input, the pull-pin low externally will emit a current if the pull-up resistor is activated it. PORTB pins
will be in the condition of the tri-state when RESET is active, although the clock is not running.
3
PORTC (PC5.. PC0)

PORTC is a port I / O two-way (bidirectional) 7-bit with internal pull-up resistor can be selected. This
port output buffers have symmetrical characteristics when used as a source or sink. When used as an
input, the pull-pin low externally will emit a current if the pull-up resistor is activated it. PORTC pins
will be in the condition of the tri-state when RESET is active, although the clock is not running.

PC6/RESET
If RSTDISBL Fuse programmed, PC6 then serves as a pin I / O but with different characteristics. PC0
to PC5 If Fuse RSTDISBL not programmed, then serves as input Reset PC6. LOW signal on this pin
with a minimum width of 1.5 microseconds will bring the microcontroller into reset condition,
although the clock is not running.

PORTD (PD7.. PD0)

PORTD is a port I / O two-way (bidirectional) 8-bit with internal pull-up resistor can be selected. This
port output buffers have symmetrical characteristics when used as a source or sink. When used as an
input, the pull-pin low externally will emit a current if the pull-up resistor is activated it. PORTD pins
will be in the condition of the tri-state when RESET is active, although the clock is not running.

RESET
Reset input pin. LOW signal on this pin with a minimum width of 1.5 microseconds will bring the
microcontroller into reset condition, although the clock is not running. Signal with a width of less than
1.5 microseconds does not guarantee a Reset condition.

AVCC
AVCC is the supply voltage pin for the ADC, PC3 .. PC0, and ADC7..ADC6. This pin should be
connected to VCC, even if the ADC is not used. If the ADC is used, AVCC should be connected to
VCC through a low-pass filter to reduce noise.

Aref
Analog Reference pin for the ADC.

ADC7 .. ADC6

ADC analog input there is only on ATmega8 with TQFP and QFP packages / MLF.

3
PORTS

Term "port" refers to a group of pins on a microcontroller which can be accessed simultaneously, or
on which we can set the desired combination of zeros and ones, or read from them an existing status.
Physically, port is a register inside a microcontroller which is connected by wires to the pins of a
microcontroller. Ports represent physical connection of Central Processing Unit with an outside world.
Microcontroller uses them

The Atmega8 has 23 I/O ports which are organized into 3 groups:

 Port B (PB0 to PB7)


 Port C (PC0 to PC6)
 Port D (PD0 to PD7)

We will use mainly 3 registers known as DDRX, PORTX & PINX. We have total four PORTs
on my ATmega16. They are PORTA, PORTB, PORTC and PORTD. They are multifunctional
pins. Each of the pins in each port (total 32) can be treated as input or output pin.

6.1.4 Applications

AVR microcontroller perfectly fits many uses, from automotive industries and controlling
home appliances to industrial instruments, remote sensors, electrical door locks and safety devices. It
is also ideal for smart cards as well as for battery supplied devices because of its low consumption.

EEPROM memory makes it easier to apply microcontrollers to devices where permanent


storage of various parameters is needed (codes for transmitters, motor speed, receiver frequencies,
etc.). Low cost, low consumption, easy handling and flexibility make ATmega8 applicable even in
areas where microcontrollers had not previously been considered (example: timer functions, interface
replacement in larger systems, coprocessor applications, etc.).

In System Programmability of this chip (along with using only two pins in data transfer)
makes possible the flexibility of a product, after assembling and testing have been completed. This
capability can be used to create assembly-line production, to store calibration data available only after
final testing, or it can be used to improve programs on finished products.

3
6.2 RF Transmitter and RF receiver:

6.2.1 RF TRANSMITTER:

General Description:The ST-TX01-ASK is an ASK Hybrid transmitter module. ST-TX01-ASK is


designed by the Saw Resonator, with an effective low cost, small size, and simple-to-use for
designing.

Frequency Range: 315 / 433.92 MHZ.

Supply Voltage: 3~12V.

Output Power: 4~16dBm

Fig.6.6 RF TRANSMITTER

PIN Description:

Fig.6.7 RF Transmitter STT-433

3
Pin Description

ANT: 50 ohm antenna output. The antenna port impedance affects output power and harmonic
emissions. An L-C low-pass filter may be needed to sufficiently filter harmonic emissions. Antenna
can be single core wire of approximately 17cm length or PCB trace antenna

VCC: Operating voltage for the transmitter. VCC should be bypassed with a .01uF ceramic capacitor
and filtered with a 4.7uF tantalum capacitor. Noise on the power supply will degrade transmitter noise
performance

DATA: Digital data input. This input is CMOS compatible and should be driven with CMOS level
inputs.

GND: Transmitter ground. Connect to ground plane.

The STT-433 is ideal for remote control applications where low cost and longer range is required. The
transmitter operates from a 1.5-12V supply, making it ideal for battery- powered applications. The
transmitter employs a SAW-stabilized oscillator, ensuring accurate frequency control for best range
performance. Output power and harmonic emissions are easy to control, making FCC and ETSI
compliance easy. The manufacturing-friendly SIP style package and low-cost make the STT-433
suitable for high volume applications.

Features of RF transmitter:

1. 433.92 MHz Frequency


2. Low Cost
3. 1.5-12V operation
4. 11mA current consumption at 3V
5. Small size
6. 4 dBm output power at 3V
Specifications of RF transmitter:

Operating Voltage Vcc: 1.5 to 12 Volts DC

Operating Current: Icc - 11mA @3V, 59mA @5V

Frequency Accuracy: -75 to 75 KHz


3
Center Frequency: 433 Mhz

RF Output Power: 4 dBM@3V (2 mW), 16 dBM@5V (39 mW)

Data Rate: 200 to 3K bps

Temperature:-20 to +60 Deg. C

Power up delay: 20 ms

Theory

OOK (On Off Keying) modulation is a binary form of amplitude modulation. When a logical 0 (data
line low) is being sent, the transmitter is off, fully suppressing the carrier. In this state, the transmitter
current is very low, less than 1mA. When a logical 1 is being sent, the carrier is fully on. In this state,
the module current consumption is at its highest, about 11mA with a 3V power supply.

OOK is the modulation method of choice for remote control applications where power consumption
and cost are the primary factors. Because OOK transmitters draw no power when they transmit a 0,
they exhibit significantly better power consumption than FSK transmitters.

OOK data rate is limited by the start-up time of the oscillator. High-Q oscillators which have very
stable center frequencies take longer to start-up than low-Q oscillators. The start-up time of the
oscillator determines the maximum data rate that the transmitter can send.

Data Rate: The oscillator start-up time is on the order of 40uSec, which limits the maximum data
rate to 4.8 kbit/sec.

SAW stabilized oscillator: The transmitter is basically a negative resistance LC oscillator whose
center frequency is tightly controlled by a SAW resonator. SAW (Surface Acoustic Wave) resonators
are fundamental frequency devices that resonate at frequencies much higher than crystals.

Applications

1. Remote Keyless Entry (RKE)


2. Remote Lighting Controls
3. On-Site Paging
4. Asset Tracking
4
5. Wireless Alarm and Security Systems
6. Long Range RFID
7. Automated Resource Management
8. Wireless security systems
9. Car Alarm systems
10. Remote controls.
11. Sensor reporting
12. Automation systems
6.2.2 RF Receiver:

General Description: The ST-RX02-ASK is an ASK Hybrid receiver module. A effective low cost
solution for using at 315/433.92 MHZ. The circuit shape of ST-RX02-ASK is L/C.

Receiver Frequency: 315 / 433.92 MHZ

Typical sensitivity: -105dBm

Supply Current: 3.5mA

IF Frequency: 1MHz

Features:

1. Low power consumption.


2. Easy for application.
3. Operation temperature range : ﹣20℃~+70℃
4. Operation voltage: 5 Volts.
5. Available frequency at: 315/434 MHz

Fig.6.8 RF RECEIVER

4
Overview

The STR-433 is ideal for short-range remote control applications where cost is a primary concern.
The receiver module requires no external RF components except for the antenna. It generates
virtually no emissions, making FCC and ETSI approvals easy. The super-regenerative design exhibits
exceptional sensitivity at a very low cost. The manufacturing-friendly SIP style package and low-cost
make the STR-433 suitable for high volume applications.

Features

1. Low Cost
2. 5V operation
3. 3.5mA current drain
4. No External Parts are required
5. Receiver Frequency: 433.92 MHZ
6. Typical sensitivity: -105dBm
7. IF Frequency: 1MHz
Pin Outs

4
Pin Description:

ANT: Antenna input.

GND: Receiver Ground. Connect to ground plane.

VCC: (5V) VCC pins are electrically connected and provide operating voltage for the receiver. VCC
can be applied to either or both. VCC should be bypassed with a .1μF ceramic capacitor. Noise on the
power supply will degrade receiver sensitivity.

DATA: Digital data output. This output is capable of driving one TTL or CMOS load. It is a CMOS
compatible output.

Operation

The STR-433 uses a super-regenerative AM detector to demodulate the incoming AM carrier. A super
regenerative detector is a gain stage with positive feedback greater than unity so that it oscillates. An
RC-time constant is included in the gain stage so that when the gain stage oscillates, the gain will be
lowered over time proportional to the RC time constant until the oscillation eventually dies. When the
oscillation dies, the current draw of the gain stage decreases, charging the RC circuit, increasing the
gain, and ultimately the oscillation starts again. In this way, the oscillation of the gain stage is turned
on and off at a rate set by the RC time constant. This rate is chosen to be super-audible but much
lower than the main oscillation rate. Detection is accomplished by measuring the emitter current of
the gain stage. Any RF input signal at the frequency of the main oscillation will aid the main
oscillation in restarting. If the amplitude of the RF input increases, the main oscillation will stay on
for a longer period of time, and the emitter current will be higher. Therefore, we can detect the
original base-band signal by simply low-pass filtering the emitter current. The average emitter current
is not very linear as a function of the RF input level. It exhibits a 1/ln response because of the
exponentially rising nature of oscillator start-up. The steep slope of a logarithm near zero results in
high sensitivity to small input signals.

. Data Slicer: The data slicer converts the base-band analog signal from the super-regenerative
detector to a CMOS/TTL compatible output. Because the data slicer is AC coupled to the audio
output, there is a minimum data rate. AC coupling also limits the minimum and maximum pulse
4
width. Typically, data is encoded on the transmit side using pulse-width modulation (PWM) or non-
return-to-zero (NRZ).

The most common source for NRZ data is from a UART embedded in a micro-controller.
Applications that use NRZ data encoding typically involve microcontrollers. The most common
source for PWM data is from a remote control IC such as the HC-12E from Holtek or ST14 CODEC
from Sunrom Technologies. Data is sent as a constant rate square-wave. The duty cycle of that square
wave will generally be either 33% (a zero) or 66% (a one). The data slicer on the STR-433 is
optimized for use with PWM encoded data, though it will work with NRZ data if certain encoding
rules are followed.

Power Supply: The STR-433 is designed to operate from a 5V power supply. It is crucial that this
power supply be very quiet. The power supply should be bypassed using a 0.1uF low-ESR ceramic
capacitor and a 4.7uF tantalum capacitor. These capacitors should be placed as close to the power pins
as possible. The STR- 433 is designed for continuous duty operation. From the time power is applied,
it can take up to 750mSec for the data output to become valid.

Antenna Input: It will support most antenna types, including printed antennas integrated directly onto
the PCB and simple single core wire of about 17cm. The performance of the different antennas varies.
Any time a trace is longer than 1/8th the wavelength of the frequency it is carrying, it should be a 50
ohm microstrip.

Applications

1. Car security system


2. Sensor reporting
3. Automation system
4. Remote Keyless Entry (RKE)
5. Remote Lighting Controls
6. On-Site Paging
7. Asset Tracking
8. Wireless Alarm and Security Systems
9. Long Range RFID
4
6.2.3 HT12A/HT12E 212 Series of Encoders

Features

1. Operating voltage
2. 2.4V~5V for the HT12A
3. 2.4V~12V for the HT12E
4. Low power and high noise immunity CMOS technology
5. Low standby current: 0.1_A (typ.) at VDD=5V
6. HT12A with a 38kHz carrier for infrared transmission medium
7. Minimum transmission word
8. Four words for the HT12E
9. One word for the HT12A
10. Built-in oscillator needs only 5% resistor
11. Data code has positive polarity
12. Minimal external components
13. HT12A/E: 18-pin DIP/20-pin SOP package

General Description

The 212 encoders are a series of CMOS LSIs for remote control system applications. They are
capable of encoding information which consists of N address bits and 12_N data bits. Each address/
data input can be set to one of the two logic states. The programmed addresses/data are transmitted
together with the header bits via an RF or an infrared transmission medium upon receipt of a trigger
signal. The capability to select a TE trigger on the HT12E or a DATA trigger on the HT12A further
enhances the application flexibility of the 212 series of encoders. The HT12A additionally provides a
38 kHz carrier for infrared systems.

4
Fig.6.10 Diagram of HT12A/HT12E encoders:

Pin Description:

1. A0~A7: Input pins for address A0~A7 setting. These pins can be externally set to VSS or left
open
1. D0~D3: Input pins for data D0~D3 setting and transmission enable, active low. These
pins should be externally set to VSS or left open
2. DOUT: Encoder data serial transmission output
3. OSC1 OSCILLATOR 1 Oscillator input pin
4. OSC2 OSCILLATOR 1 Oscillator output pin

4
5. VCC Positive power supply
6. TE is a transmission enable pin of the HT12E.

Specifications:

Supply Voltage (HT12A) 0.3V to 5.5V

Supply Voltage (HT12E) 0.3V to 13V

Input VoltageVSS-0.3 to VDD+0.3V

Storage Temperature -50_C to 125_C

Operating Temperature -20_C to 75_C

Operation

The 212 series of encoders begin a 4-word transmission cycle upon receipt of a transmission enable
(TE for the HT12E or D0~D3 for the HT12A, active low). This cycle will repeat itself as long as the
transmission enable (TE or D0~D3) is held low. Once the transmission enable returns high the
encoder output completes its final cycle and then stops

Transmission enable

For the HT12E encoders, transmission is enabled by applying a low signal to the TE pin. For the
HT12A encoders, transmission is enabled by applying a low signal to one of the data pins D0~D3

Applications

1. Burglar alarm system


2. Smoke and fire alarm system
3. Garage door controllers
4. Car door controllers
5. Car alarm system
6. Security system
7. Cordless telephones
8. Other remote control systems
4
6.2.4 HT12D/HT12F 212 Series of

Decoders Features

1. Operating voltage: 2.4V~12V


2. Low power and high noise immunity CMOS technology
3. Low standby current
4. Capable of decoding 12 bits of information
5. Binary address setting
6. Received codes are checked 3 times
7. Address/Data number combination
8. HT12D: 8 address bits and 4 data bits
9. HT12F: 12 address bits only
10. Built-in oscillator needs only 5% resistor
11. Valid transmission indicator
12. Easy interface with an RF or an infrared transmission medium
13. Minimal external components
14. Pair with Holtek_s 212 series of encoders
15. 18-pin DIP, 20-pin SOP package
General Description

The 212 decoders are a series of CMOS LSIs for remote control system applications. They are paired
with Holtek_s 212 series of encoders (refer to the encoder/decoder cross reference table). For proper
operation, a pair of encoder/decoder with the same number of addresses and data format should be
chosen. The decoders receive serial addresses and data from a programmed 212 series of encoders that
are transmitted by a carrier using an RF or an IR transmission medium. They compare the serial input
data three times continuously with their local addresses. If no error or unmatched codes are found, the
input data codes are decoded and then transferred to the output pins. The VT pin also goes high to
indicate a valid transmission.

The 212 series of decoders are capable of decoding information’s that consist of N bits of address and
12_N bits of data. Of this series, the HT12D is arranged to provide 8 address bits and 4 data bits, and
HT12F is used to decode 12 bits of address information.
4
Fig.6.11 Diagram of HT12D/HT12F decoders:

Pin Description

1. A0~A7 (HT12D): Input pins for address A0~A7 setting

These pins can be externally set to VSS or left open.

3. D0~D (HT12D): Output data pins, power-on state are low.

4. DIN: Serial data input pin

5. VT: Valid transmission, active high

6. OSC1: Oscillator input pin

7. OSC2: Oscillator output pin

8. VCC: Positive power supply

4
Description:

The 212 series of decoders provides various combinations of addresses and data pins in different
packages so as to pair with the 212 series of encoders. The decoders receive data that are transmitted
by an encoder and interpret the first N bits of code period as addresses and the last 12_N bits as data,
where N is the address code number. A signal on the DIN pin activates the oscillator which in turn
decodes the incoming address and data. The decoders will then check the received address three times
continuously. If the received address codes all match the contents of the decoder’s local address, the
12_N bits of data are decoded to activate the output pins and the VT pin is set high to indicate a valid
transmission. This will last unless the address code is incorrect or no signal is received.

The output of the VT pin is high only when the transmission is valid. Otherwise it is always low.
Output type of the 212 series of decoders, the HT12F has no data output pin but its VT pin can be
used as a momentary data output. The HT12D, on the other hand, provides 4 latch type data pins
whose data remain unchanged until new data are received.

Applications

1. Burglar alarm system


2. Smoke and fire alarm system
3. Garage door controllers
4. Car door controllers
5. Car alarm system
6. Security system

6.3 PUSH BUTTON/ CONTROL SWITCH:

A push-button (also spelled pushbutton) (press-button in the UK) or simply button is a simple
switch mechanism for controlling some aspect of a machine or a process. Buttons are typically made
out of hard material, usually plastic or metal. The surface is usually flat or shaped to accommodate the
human finger or hand, so as to be easily depressed or pushed. Buttons are most often biased switches,
though even many un-biased buttons (due to their physical nature) require a spring to return to their
un-pushed state. Different people use different terms for the "pushing" of the button, such as press,
depress, mash, and punch.

5
Uses:

The "push-button" has been utilized in calculators, push-button telephones, kitchen appliances,
and various other mechanical and electronic devices, home and commercial.

In industrial and commercial applications, push buttons can be linked together by a mechanical
linkage so that the act of pushing one button causes the other button to be released. In this way, a stop
button can "force" a start button to be released. This method of linkage is used in simple manual
operations in which the machine or process have no electrical circuits for control.

Pushbuttons are often color-coded to associate them with their function so that the operator
will not push the wrong button in error. Commonly used colors are red for stopping the machine or
process and green for starting the machine or process.

Red pushbuttons can also have large heads (called mushroom heads) for easy operation and to
facilitate the stopping of a machine. These pushbuttons are called emergency stop buttons and are
mandated by the electrical code in many jurisdictions for increased safety. This large mushroom shape
can also be found in buttons for use with operators who need to wear gloves for their work and could
not actuate a regular flush-mounted push button. As an aid for operators and users in industrial or
commercial applications, a pilot light is commonly added to draw the attention of the user and to
provide feedback if the button is pushed. Typically this light is included into the center of the
pushbutton and a lens replaces the pushbutton hard center disk. The source of the energy to illuminate
the light is not directly tied to the contacts on the back of the pushbutton but to the action the
pushbutton controls. In this way a start button when pushed will cause the process or machine
operation to be started and a secondary contact designed into the operation or process will close to
turn on the pilot light and signify the action of pushing the button caused the resultant process or
action to start.

In popular culture, the phrase "the button" (sometimes capitalized) refers to a (usually
fictional) button that a military or government leader could press to launch nuclear weapons.

5
Fig.6.12 Push button /Control

A Load control switch is a remotely controlled relay that is placed on home appliances which
consume large amounts of electricity, such as air conditioner units and electric water heaters.

Most load control switches consist of a communication module and the relay switch and can
be used as part of a demand response energy efficiency system such as a smart grid. Such a switch
operates similarly to a pager, receiving signals from the power company or electrical frequency shift
to turn off or reduce power to the appliance during times of peak electrical demand. Usually, the
device has a timer that will automatically reset the switch back on after a preset time. Some operation
intolerant appliances, such as dryers, use switches that can reduce or shut off power to their heating
coils yet still tumble until signaled to resume full power

5
CHAPTER 7

SIMULATION TOOLS
This project is implemented using following software’s:
 Express PCB – for designing circuit
 ARDUINO

7.1 Express PCB:

Breadboards are great for prototyping equipment as it allows great flexibility to modify
a design when needed; however the final product of a project, ideally should have a neat PCB, few
cables, and survive a shake test. Not only is a proper PCB neater but it is also more durable as there
are no cables which can yank loose.

Express PCB is a software tool to design PCBs specifically for manufacture by the
company Express PCB (no other PCB maker accepts Express PCB files). It is very easy to use, but it
does have several limitations.

It can be likened to more of a toy then a professional CAD program.

It has a poor part library (which we can work around)

It cannot import or export files in different formats

It cannot be used to make prepare boards for DIY production

Express PCB has been used to design many PCBs (some layered and with surface-mount
parts. Print out PCB patterns and use the toner transfer method with an Etch Resistant Pen to make
boards. However, Express PCB does not have a nice print layout. Here is the procedure to design in
Express PCB and clean up the patterns so they print nicely.

5
7.1.1 Preparing Express PCB for First Use:

Express PCB comes with a less then exciting list of parts. So before any project is
started head over to Audio logical and grab the additional parts by morsel, ppl, and tangent, and
extract them into your Express PCB directory. At this point start the program and get ready to setup
the workspace to suit your style.

Click View -> Options. In this menu, setup the units for “mm” or “in” depending on
how you think, and click “see through the top copper layer” at the bottom. The standard color scheme
of red and green is generally used but it is not as pleasing as red and blue.

7.1.2 The Interface:

When a project is first started you will be greeted with a yellow outline. This yellow
outline is the dimension of the PCB. Typically after positioning of parts and traces, move them to
their final position and then crop the PCB to the correct size. However, in designing a board with a
certain size constraint, crop the PCB to the correct size before starting.

Fig: 4.1 show the toolbar in which the each button has the following functions:

Fig 7.1: Tool bar necessary for the interface

 The select tool: It is fairly obvious what this does. It allows you to move and manipulate
parts. When this tool is selected the top toolbar will show buttons to move traces to the top /
bottom copper layer, and rotate buttons.
 The zoom to selection tool: does just that.
 The place pad: button allows you to place small soldier pads which are useful for board
connections or if a part is not in the part library but the part dimensions are available. When
this tool is selected the top toolbar will give you a large selection of round holes, square holes
and surface mount pads.

5
 The place component: tool allows you to select a component from the top toolbar and then by
clicking in the workspace places that component in the orientation chosen using the buttons
next to the component list. The components can always be rotated afterwards with the select
tool if the orientation is wrong.
 The place trace: tool allows you to place a solid trace on the board of varying thicknesses. The
top toolbar allows you to select the top or bottom layer to place the trace on.
 The Insert Corner in trace: button does exactly what it says. When this tool is selected,
clicking on a trace will insert a corner which can be moved to route around components and
other traces.
 The remove a trace button is not very important since the delete key will achieve the same
result.

7.1.3 Design Considerations:

Before starting a project there are several ways to design a PCB and one must be
chosen to suit the project’s needs.

Single sided, or double sided?

When making a PCB you have the option of making a single sided board, or a double
sided board. Single sided boards are cheaper to produce and easier to etch, but much harder to
design for large projects. If a lot of parts are being used in a small space it may be difficult to make
a single sided board without jumpering over traces with a cable. While there’s technically nothing
wrong with this, it should be avoided if the signal travelling over the traces is sensitive (e.g. audio
signals).

A double sided board is more expensive to produce professionally, more difficult to


etch on a DIY board, but makes the layout of components a lot smaller and easier. It should be
noted that if a trace is running on the top layer, check with the components to make sure you can get
to its pins with a soldering iron. Large capacitors, relays, and similar parts which don’t have axial
leads can NOT have traces on top unless boards are plated professionally.

Ground-plane or other special purposes for one side

5
When using a double sided board you must consider which traces should be on what
side of the board. Generally, put power traces on the top of the board, jumping only to the bottom if
a part cannot be soldiered onto the top plane (like a relay), and vice- versa.

Some projects like power supplies or amps can benefit from having a solid plane to use
for ground. In power supplies this can reduce noise, and in amps it minimizes the distance between
parts and their ground connections, and keeps the ground signal as simple as possible. However,
care must be taken with stubborn chips such as the TPA6120 amplifier from TI. The TPA6120
datasheet specifies not to run a ground plane under the pins or signal traces of this chip as the
capacitance generated could effect performance negatively.

arduino compiling

5
In next step download library

As Arduino doesn’t recognize the directory name, please rename it

5
Launch Arduino by double click “arduino” below

5
One example

5
Select the target board as “Arduino Uno”:

6
Click Sketch-> Verify/Compile:

6
CHAPTER 8
ADVANTAGES DISADVANTAGES

8.1 Advantages:

 Lot of time is saved at signals. Solve Traffic Issues.


 Vehicle Identification Is Easy.
 Instant Notification.
 Reliable.
 The critical levels of the traffic jam have been indicated through alerting unit.
 The system successfully detected the primary appearances of emergency vehicles.

8.2 DISADVANTAGES
• Keys required pressing for siren, left direction, and right direction.
Initial cost is high

8.3 APPLICATIONS
Useful for traffic monitoring.
 Useful for road safety control.
 Can be useful in all ambulances.
 Over the years this would also help in making travel more “eco-friendly”

6
CHAPTER 9
RESULTS
9.1 Results Obtained

Hardware setup module of traffic clearance system. This is implemented by ARDUINO Module with
having RF receiver antenna to control the traffic lights. This proposed hardware model is integrated
input wireless module RF Receiver which operated 433MHz frequency and output modules LED
Traffic signal board. All the input and output modules are integrated to ARDUINO processor
according to the predefined time the system will be function. We used 5v regulated power supply to
power this hardware setup.

Fig.9.1. Hardware Receiver output

Powered on implemented output of the traffic system. This is implemented by ARDUINO Module
with having RF receiver antenna to control the traffic lights. Normally we programmed that for every
10 sec the traffic signal change between RED to GREEN for to show the basic operation of the traffic

6
system. When the RF receiver receive the data then any case of traffic signal should change to green
indication to clear traffic for emergency vehicle called ambulance.

Fig.9.2. Hardware Transmitter output

Transmitting section of RF system with four switches indicate that information for the traffic control
signal by the ambulance. This RF transmitter is attached to emergency vehicle ambulance. As a
prototype we are demonstrating the four directions of NORTH, SOUTH, EAST and WEST we kept
four switches. One of the switches in RF transmitter section indicated one traffic direction. If we press
the first button data send to receiver then whichever the traffic signal is working don’t care
automatically traffic signals will indicate green signal corresponding direction.

6
CHAPTER 10
CONCLUSION

We designed and implemented RF Based Automatic Traffic Route Clearance System For Ambulance
Using ARDUINO done successfully. This system implemented with transmitting section and receiver
section with RF wireless communications. In the proposed system contains two sections. Transmitter
section will be in Ambulance vehicle with RF transmitter module activation. When the RF receiver
signal receives the data then second section receive the data through RF receiver and turn traffic
signals to green. It save the time and save life of the patients with this smart system.

6
CHAPTER 11
BIBLIOGRAPHY

11.1 REFERENCES

[1] Bankar Sanket Anil, Kale Aniket Vilas, Prof. S. R. Jagtap, Intelligent System for Vehicular
Accident Detection and Notification, International Conference on Communication and Signal
Processing, April 3-5,2014.

[2] Ayush Kr. Mittal and DeepikaBhandari, A Novel Approach to Implement Green Wave system and
Detection of Stolen Vehicles, IEEE - Institute of Electrical and Electronics Engineers. Inc, 1 February
2013, Pages 1,055 -1,059.

[3] Rajeshwari S., SanthoshsHebbar, VaraprasadGolla, Implementing Intelligent Traffic Control


System for Congestion Control, Ambulance Clearance and Stolen Vehicle Detection, IEEE sensors
journal, vol. 15, no. 2, february 2015, Pages1109-1113.

[4] Sarfraz Fayaz Khan,Health Care Monitoring System in Internet of Things (lOT) by Using
RFID,2017 the 6th International [5] M. Ferreira, R. Fernandes, H. Conceic, W.Viriyasitavat, and O.
K.Tonguz, Self-organized traffic control, in the ACM international workshop on Vehicular
Internetworking (VANET), pp. 85-90,2010.

[6] E-ViEWS Safety Systems, The Intersection of Communication and Transportation,


http://www.eviewsinc.com, January2012.

[7] Wang wei, Fan hanbo, traffic accident automatic detection and remote alarm device.

[8] GuojiangShen, " Urban Traffic Trunk Two-direction Green Wave Intelligent Control Strategy and
Its Application ", Intelligent Control and Automation,2006.

WCICA 2006. The Sixth World Congress . Volume:2 Publication Year: 2006 , Page(s): 8563 8567.

[9] Balaji Parasumann, Dipti Srinivasan, Distributed Geometric Fuzzy Multi agent Urban Traffic
Transaction. Intelligent Transportation Systems, Volume 11 Issue 3, September 2010, Pages714-727.

6
[10]. WantaneeViriyasitavat and Ozan K. Tonguz Priority Management of Emergency Vehicles at
Intersections Using Self-organized Traffic Control, Vehicular Technology Conference (VTC Fall),
2012IEEE.

[11]. Dr.D.K.Nayana, Shadab Hussain, K.Srinivas Pavan Reddy R “ Emergency Medical Services
And Traffic Clearance ”, International Journal of Advanced Science and Technology Vol. 29, No. 7,
(2020), pp. 14120-14124.

[12]. ER. Kaushik Babhure, MS. Mona Mulchandani, Dr. Pradnya Borkar “Smart Traffic
Management for Emergence Vehicles Using Sound Detection”, International Journal of Future
Generation Communication and Networking Vol. 13, No. 2s, (2020), pp. 1226–1229.

[13] KHALIL M. YOUSEF, JAMAL N. AL-KARAKI, “Intelligent Traffic Light Flow Control
System Using Wireless Sensors Networks”, JOURNAL OF INFORMATION SCIENCE AND
ENGINEERING 26, 753-768 (2010).

[14]Minal K. Avzekar1, Amruta Moon,” Adaptive Traffic Signal Control with VANET” International
Journal of Scientific Engineering and Research (IJSER) Volume 2 Issue 3, March 2014.

[15]A. K. Mittal and D. Bhandari, “A novel approach to implement green wave system and detection
of stolen vehicles,” in Proc. IEEE 3rd Int.Adv.Comput., Feb. 2013, pp. 1055–1059.

[16]R. Hegde, R. R. Sali, and M. S. Indira, “RFID and GPS based automatic lane clearance system for
ambulance,” Int. J. Adv. Elect. Electron.Eng., vol. 2, no. 3, pp. 102–107, 2013.

[17] Sarika B. Kale, and Gajanan P. Dhok” Design of Intelligent Ambulance and Traffic Control”,
International Journal of Innovative Technology and Exploring Engineering (IJITEE) ISSN: 2278-
3075, Volume-2, Issue-5, April 2013.

[18] Veeravenkatesh, Nazneensyed ,” smart traffic control system for emergency vehicle clearance”
International Journal of Innovative Research in Computer and Communication Engineering –Vol.3,
Issue 8, August 2015.

6
CHAPTER 12

APPENDIX -1

12.1 CODE

#include <LiquidCrystal.h>
#include <stdio.h>

LiquidCrystal lcd(6, 7, 5, 4, 3, 2);

int RF1 = 0;

int RF2 = 1;

int RF3 = 2;

int RF4 = 3;

int led1_green = 8;

int led1_yellow = 9;

int led1_red = 10;

int led2_green = 11;

int led2_yellow = 12;

int led2_red = 13;

int led3_green = A0;

6
int led3_yellow = A1;

int led3_red = A2;

int led4_green = A3;

int led4_yellow = A4;

int led4_red = A5;

if(digitalRead(RF1) == HIGH)

digitalWrite(led1_green, LOW);digitalWrite(led1_yellow, HIGH);digitalWrite(led1_red,


HIGH);

digitalWrite(led2_green, HIGH);digitalWrite(led2_yellow, HIGH);digitalWrite(led2_red,


LOW);

digitalWrite(led3_green, HIGH);digitalWrite(led3_yellow, HIGH);digitalWrite(led3_red,


LOW);

digitalWrite(led4_green, HIGH);digitalWrite(led4_yellow, HIGH);digitalWrite(led4_red,


LOW);

if(digitalRead(RF2) == HIGH)

digitalWrite(led1_green, HIGH);digitalWrite(led1_yellow, HIGH);digitalWrite(led1_red,


LOW);

6
digitalWrite(led2_green, LOW);digitalWrite(led2_yellow, HIGH);digitalWrite(led2_red,
HIGH);

digitalWrite(led3_green, HIGH);digitalWrite(led3_yellow, HIGH);digitalWrite(led3_red,


LOW);

digitalWrite(led4_green, HIGH);digitalWrite(led4_yellow, HIGH);digitalWrite(led4_red,


LOW);

if(digitalRead(RF3) == HIGH)

digitalWrite(led1_green, HIGH);digitalWrite(led1_yellow, HIGH);digitalWrite(led1_red,


LOW);

digitalWrite(led2_green, HIGH);digitalWrite(led2_yellow, HIGH);digitalWrite(led2_red,


LOW);

digitalWrite(led3_green, LOW);digitalWrite(led3_yellow, HIGH);digitalWrite(led3_red,


HIGH);

digitalWrite(led4_green, HIGH);digitalWrite(led4_yellow, HIGH);digitalWrite(led4_red,


LOW);

if(digitalRead(RF4) == HIGH)

digitalWrite(led1_green, HIGH);digitalWrite(led1_yellow, HIGH);digitalWrite(led1_red, LOW);

digitalWrite(led2_green, HIGH);digitalWrite(led2_yellow, HIGH);digitalWrite(led2_red, LOW);

digitalWrite(led3_green, HIGH);digitalWrite(led3_yellow, HIGH);digitalWrite(led3_red, LOW);

7
digitalWrite(led4_green, LOW);digitalWrite(led4_yellow, HIGH);digitalWrite(led4_red, HIGH);

Serial.write("AT+CIPSEND=0,11\r\n");delay(2000);

Serial.write("Rd-4 Dens\r\n");delay(3000);

void setup()

pinMode(RF1, INPUT);pinMode(RF2, INPUT);pinMode(RF3, INPUT);pinMode(RF4, INPUT);

pinMode(led1_green, OUTPUT);pinMode(led1_yellow, OUTPUT);pinMode(led1_red,


OUTPUT);

pinMode(led2_green, OUTPUT);pinMode(led2_yellow, OUTPUT);pinMode(led2_red,


OUTPUT);

pinMode(led3_green, OUTPUT);pinMode(led3_yellow, OUTPUT);pinMode(led3_red,


OUTPUT);

pinMode(led4_green, OUTPUT);pinMode(led4_yellow, OUTPUT);pinMode(led4_red,


OUTPUT);

digitalWrite(led1_green, HIGH);digitalWrite(led1_yellow, HIGH);digitalWrite(led1_red,


HIGH);

7
digitalWrite(led2_green, HIGH);digitalWrite(led2_yellow, HIGH);digitalWrite(led2_red,
HIGH);

digitalWrite(led3_green, HIGH);digitalWrite(led3_yellow, HIGH);digitalWrite(led3_red,


HIGH);

digitalWrite(led4_green, HIGH);digitalWrite(led4_yellow, HIGH);digitalWrite(led4_red,


HIGH);

// set up the LCD's number of columns and rows:

//lcd.begin(16, 2);

// Print a message to the LCD.

//lcd.print("Self Allignment-Smooth");

digitalWrite(led1_green, LOW);digitalWrite(led1_yellow, LOW);digitalWrite(led1_red, LOW);

digitalWrite(led2_green, LOW);digitalWrite(led2_yellow, LOW);digitalWrite(led2_red, LOW);

digitalWrite(led3_green, LOW);digitalWrite(led3_yellow, LOW);digitalWrite(led3_red, LOW);

digitalWrite(led4_green, LOW);digitalWrite(led4_yellow, LOW);digitalWrite(led4_red, LOW);

);

digitalWrite(led2_green, HIGH);digitalWrite(led2_yellow, HIGH);digitalWrite(led2_red,


HIGH);

digitalWrite(led3_green, HIGH);digitalWrite(led3_yellow, HIGH);digitalWrite(led3_red,


HIGH);

7
digitalWrite(led4_green, HIGH);digitalWrite(led4_yellow, HIGH);digitalWrite(led4_red,
HIGH);

void loop()

t_delay(10);

digitalWrite(led1_green, HIGH);digitalWrite(led1_yellow, LOW);digitalWrite(led1_red, HIGH);

t_delay(10);

digitalWrite(led1_green, LOW);digitalWrite(led1_yellow, HIGH);digitalWrite(led1_red, HIGH);

digitalWrite(led2_green, HIGH);digitalWrite(led2_yellow, HIGH);digitalWrite(led2_red, LOW);

digitalWrite(led3_green, HIGH);digitalWrite(led3_yellow, HIGH);digitalWrite(led3_red, LOW);

digitalWrite(led4_green, HIGH);digitalWrite(led4_yellow, HIGH);digitalWrite(led4_red, LOW);

t_delay(10);

digitalWrite(led2_green, HIGH);digitalWrite(led2_yellow, LOW);digitalWrite(led2_red, HIGH);

t_delay(10);

digitalWrite(led1_green, HIGH);digitalWrite(led1_yellow, HIGH);digitalWrite(led1_red, LOW);

digitalWrite(led2_green, LOW);digitalWrite(led2_yellow, HIGH);digitalWrite(led2_red, HIGH);

digitalWrite(led3_green, HIGH);digitalWrite(led3_yellow, HIGH);digitalWrite(led3_red, LOW);

digitalWrite(led4_green, HIGH);digitalWrite(led4_yellow, HIGH);digitalWrite(led4_red, LOW);

t_delay(10);

7
digitalWrite(led3_green, HIGH);digitalWrite(led3_yellow, LOW);digitalWrite(led3_red, HIGH);

t_delay(10);

digitalWrite(led1_green, HIGH);digitalWrite(led1_yellow, HIGH);digitalWrite(led1_red, LOW);

digitalWrite(led2_green, HIGH);digitalWrite(led2_yellow, HIGH);digitalWrite(led2_red, LOW);

digitalWrite(led3_green, LOW);digitalWrite(led3_yellow, HIGH);digitalWrite(led3_red, HIGH);

digitalWrite(led4_green, HIGH);digitalWrite(led4_yellow, HIGH);digitalWrite(led4_red, LOW);

t_delay(10);

digitalWrite(led4_green, HIGH);digitalWrite(led4_yellow, LOW);digitalWrite(led4_red, HIGH);

t_delay(10);

digitalWrite(led1_green, HIGH);digitalWrite(led1_yellow, HIGH);digitalWrite(led1_red, LOW);

digitalWrite(led2_green, HIGH);digitalWrite(led2_yellow, HIGH);digitalWrite(led2_red, LOW);

digitalWrite(led3_green, HIGH);digitalWrite(led3_yellow, HIGH);digitalWrite(led3_red, LOW);

digitalWrite(led4_green, LOW);digitalWrite(led4_yellow, HIGH);digitalWrite(led4_red, HIGH);

You might also like