TC

67
Intelligent Ambulance for City Traffic Police 1. INTRODUCTION In recent years due to globalization there has been a sudden rise in the demand for automated traffic control systems especially in urban areas. This requires an adaptive method actuated by vehicles that adopts logic programming to model and solve the decision problems associated with traffic control. Such a method can be applied with success to urban intersections with high levels of traffic where many different and unpredictable events contribute to large fluctuations in the number of vehicles that use the intersection. The term Intelligent Traffic Control has been adopted to address the latest generation of traffic control methods, that deploy sophisticated modelling and optimisation tools to try and meet the demand for a more efficient and effective way to manage the movements of a large number of vehicles and easy movement of special vehicles viz. VIP vehicles, Ambulances etc. In practice, there are various types of traffic control systems that are used to regulate traffic. For example, use of counters and timers to control the traffic lights. This system however does not control the traffic efficiently due to the ever increasing congestion of traffic. Here the signal phases and cycle length are predetermined using historical data; the time period of green light is predetermined and it continues to be the same throughout the day, if no sensory input is received. In our Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga 1

Transcript of TC

Page 1: TC

Intelligent Ambulance for City Traffic Police

1. INTRODUCTION

In recent years due to globalization there has been a sudden rise

in the demand for automated traffic control systems especially in urban

areas. This requires an adaptive method actuated by vehicles that

adopts logic programming to model and solve the decision problems

associated with traffic control. Such a method can be applied with

success to urban intersections with high levels of traffic where many

different and unpredictable events contribute to large fluctuations in

the number of vehicles that use the intersection.

The term Intelligent Traffic Control has been adopted to address

the latest generation of traffic control methods, that deploy

sophisticated modelling and optimisation tools to try and meet the

demand for a more efficient and effective way to manage the

movements of a large number of vehicles and easy movement of

special vehicles viz. VIP vehicles, Ambulances etc.

In practice, there are various types of traffic control systems that

are used to regulate traffic. For example, use of counters and timers to

control the traffic lights. This system however does not control the

traffic efficiently due to the ever increasing congestion of traffic.

Here the signal phases and cycle length are predetermined using

historical data; the time period of green light is predetermined and it

continues to be the same throughout the day, if no sensory input is

received. In our case the predetermined time for green light is 5

seconds. The system deals with the signal phase lengths that are

adjusted in response to traffic flow, as registered by the actuation of

vehicle and/or pedestrian detectors; if a sensory output is received by

the controller, it adjusts the time period of green light for the next road.

Suppose we are using only the output from the sensors then the

drawback is that suppose in a low congested road an ambulance or a

high priority vehicle comes it will not be signalled unless and until the

congestion is avoided so to deal with this situation we are planning to in

incorporate RFID modules which will prioritize the signals based on the

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

1

Page 2: TC

Intelligent Ambulance for City Traffic Police

traffic for only important vehicles Our proposed traffic control system

has been designed for a congested, single intersection of an urban

area. Traffic detection is carried out by various obstacle sensors that

continuously provide information on the volume of traffic on each lane

and the RFID's that are mounted on the special vehicles.

1.1 Specification:

Microcontroller P89V51RD2 [8051]

Sensors IR Modulation sensors

Access Mechanism RFID + 2 Tags

Communication Protocol RS232

Display System LEDs

OS Platform Linux, Windows

Table 1.1 – Specifications of Intelligent Traffic Controller

1.2 Block diagram

Figure 1.1 – Block Diagram of Intelligent Traffic control

2. THE MICROCONTROLLER

The P89V51RB2/RC2/RD2 are 80C51 microcontrollers with

16/32/64 kB Flash and 1024 bytes of data RAM. A key feature of the

P89V51RB2/RC2/RD2 is its X2 mode option. The design engineer can

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

2

OBSTACLE SENSOR

LED

MICRO CONTROLLER

RFID

Page 3: TC

Intelligent Ambulance for City Traffic Police

choose to run the application with the conventional 80C51 clock rate

(12 clocks per machine cycle) or select the X2 mode (6 clocks per

machine cycle) to achieve twice the throughput at the same clock

frequency. Another way to benefit from this feature is to keep the same

performance by reducing the clock frequency by half, thus dramatically

reducing the EMI.The Flash program memory supports both parallel

programming and in serial In-System Programming (ISP). Parallel

programming mode offers gang-programming at high speed, reducing

programming costs and time to market. ISP allows a device to be

reprogrammed in the end product under software control. The

capability to field/update the application firmware makes a wide range

of applications possible. The P89V51RB2/RC2/RD2 is also In-Application

Programmable (IAP), allowing the Flash program memory to be

reconfigured even while the application is running.

2.1 Features

80C51 Central Processing Unit 5 V Operating voltage from 0 MHz to 40 MHz

16/32/64 kB of on-chip Flash user code memory with ISP (In-

System Programming) and IAP (In-Application Programming)

Supports 12-clock (default) or 6-clock mode selection via software

or ISP

SPI (Serial Peripheral Interface) and enhanced UART PCA (Programmable Counter Array) with PWM and

Capture/Compare functions Four 8-bit I/O ports with three high-current Port 1 pins (16 mA

each)

Three 16-bit timers/counters Programmable watchdog timer

Eight interrupt sources with four priority levels Second DPTR register Low EMI mode (ALE inhibit)

TTL- and CMOS-compatible logic levels Brown-out detection Low power modes

a. Power-down mode with external interrupt wake-upb. Idle mode

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

3

Page 4: TC

Intelligent Ambulance for City Traffic Police

DIP40, PLCC44 and TQFP44 packages

2.2 Block Diagram

Figure 2.1 – Block Diagram of Microcontroller

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

4

Page 5: TC

Intelligent Ambulance for City Traffic Police

2.3 Pinning Information

Figure 2.2 – Pin configuration

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

5

Page 6: TC

Intelligent Ambulance for City Traffic Police

Figure 2.3 – Another look of Pin Configuration

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

6

Page 7: TC

Intelligent Ambulance for City Traffic Police

2.4. Pin Multiplexing

As you will see in the following table, a no. of I/O pins have more

than one functions. i.e. a pin may be used as a simple input pin or a

serial communication receiver. This is called pin multiplexing. Using pin

multiplexing, a pin can be used for more than one function.

How is this possible? How can a pin be used for both purposes at

the same time? Well, it’s not. The pin is used for only one purpose at a

time. Pin multiplexing simply allows the pin to be used for different

applications at different times.

Thus, to use a pin as an input or a serial receiver, we just have to

initialize the pin by configuring the specific register.

But why to make it so complex? Why not just have a single pin for

input port and another as a serial receiver? As you go through the table

below, you will find that some of the pins satisfy as many as 3

functions. To replace 3 pins for every such pin will increase the pin

count dramatically. To accommodate all the pins, the size of the IC will

increase. Ultimately, you will end up with an IC as big as your palm, if

not more!

Hence, pin multiplexing helps to reduce the size of the IC without

compromising in the features of the microcontroller.

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

7

Page 8: TC

Intelligent Ambulance for City Traffic Police

2.5 Pin Description:

SYMBOL

DESCRIPTION

P0.0

to

P0.7

Port 0: Port 0 is an 8-bit open drain bi-directional I/O port. i.e. we can program the Port P0 to use its pins either as Inputs or as Outputs. To use these port pins as inputs, external pull up resistors should be connected. The need of pull up resistors is explained later. Pull up resistors are not essential for operating P0 as an output port.

P1.0

to

P1.7

Port 1: Port 1 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 1 pins are pulled high by the internal pull-ups when ‘1’s are written to them and can be used as inputs in this state. Apart from general purpose I/O Ports, P1 also has the following alternative functions.

P1.0T2: Counter input to Timer/Counter 2 or Clock-output from

Timer/Counter 2

P1.1 T2EX: Timer/Counter 2 capture/reload trigger and direction control

P1.2ECI: External clock input. This signal is the external clock input for the

PCA

P1.3CEX0: Capture/compare external I/O for PCA Module 0. Each capture/compare module connects to a Port 1 pin for external I/O. When not used by the PCA, this pin can handle standard I/O.

P1.4SS: Slave port select input for SPI

CEX1: Capture/compare external I/O for PCA Module 1

P1.5MOSI: Master Output Slave Input for SPI

CEX2: Capture/compare external I/O for PCA Module 2

P1.6MISO: Master Input Slave Output for SPI

CEX3: Capture/compare external I/O for PCA Module 3

P1.7SCK: Master Output Slave Input for SPI

CEX4: Capture/compare external I/O for PCA Module 4

P2.0

to

P2.7

Port 2: Port 2 is an 8-bit bi-directional I/O port with internal pull-ups. Port 2 pins are pulled HIGH by the internal pull-ups when ‘1’s are written to them and can be used as inputs in this state. . Apart from general purpose I/O Ports, P2 also has the following alternative functions.

P3.0

to

P3.7

Port 3: Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. Port 3 pins are pulled HIGH by the internal pull-ups when ‘1’s are written to them and can be used as inputs in this state. . Apart from general purpose I/O Ports, P3 also has the following alternative

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

8

Page 9: TC

Intelligent Ambulance for City Traffic Police

functions.P3.0 RXD: serial input port

P3.1 TXD: serial output port

P3.2 INT0: external interrupt 0 input

P3.3 INT1: external interrupt 1 input

P3.4 T0: external count input to Timer/Counter 0

P3.5 T1: external count input to Timer/Counter 1

P3.6 WR: external data memory write strobe

P3.7 RD: external data memory read strobe

Program Store Enable: PSEN is the read strobe for external program memory. When the device is executing from internal program memory, PSEN is inactive (HIGH). When the device is executing code from external program memory, PSEN is activated twice each machine cycle.

RST

Reset: While the oscillator is running, a HIGH logic state on this pin for two machine cycles will reset the device. If the PSEN pin is driven by a HIGH-to-LOW input transition while the RST input pin is held HIGH, the device will enter the external host mode, otherwise the device will enter the normal operation mode.External Access Enable: EA must be connected to VSS in order to

enable the device to fetch code from the external program memory.

EA must be strapped to VDD for internal program execution.

Address Latch Enable: ALE is used during accessing an external memory. This pin is also the programming pulse input (PROG) for flash programming.

XTAL

1

Crystal 1: Input to the inverting oscillator amplifier and input to the internal clock generator circuits.

XTAL

2

Crystal 2: Output from the inverting oscillator amplifier.

VDD Power supply

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

9

Page 10: TC

Intelligent Ambulance for City Traffic Police

VSS Ground

Table 2.1 – Pin Details

2.6 Pull Up Resistors

Pull up resistors are used on the input side so that the input pins

are at an expected logic level even if they are disconnected from the

input switches. If Pull Up resistors are not used, the voltage level at the

input pin will be floating in such a case and hence the outcome of the

circuit is unpredictable.

Consider the following circuit:

/ ------- _____/ -------| |--- | ---| |--- | ---| |--- \ / ------- GND

Here, a switch is connected at the input pin of a microcontroller.

Note the absence of a pull up resistor.

When the switch is closed, the pin is directly grounded and the

input pin reads a logic level 0. Thus logic level 0 should indicate that

the switch is closed. Now consider when the switch is open. The input

pin is not connected to anything else, hence the pin in open. Thus the

input pin is said to be kept floating. i.e. the voltage at the pin may vary

from 0 V to 5V randomly. Thus we cannot be sure every time that when

the logic at pin is 0, it is because of the closed switch or the floating

voltage.

Hence this circuit is not appropriate.

Now consider the circuit below:

VCC

/ \ | | / | ------- _____/ -------| |--- | ---| |---

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

10

Page 11: TC

Intelligent Ambulance for City Traffic Police

| ---| |--- \ / ------- GND

This circuit will eliminate our problem of floating pin. It is obvious

that when the pin is open, the voltage at the input pin is Vcc. But now

imagine what will happen if the switch is closed. What do you think will

the voltage be at the input pin? You don’t have the time to calculate

that! You have shorted Vcc and ground of your Power Supply! This is a

very wrong method to eliminate our original problem of floating

voltage.

Now see what’s happening here:

VCC

/ \ | | \ / Pull-up resistor \ | | / | ------- _____/ -------| |--- | ---| |--- | ---| |--- \ / ------- GND

When the switch is closed, the pin is directly connected to ground

and reads logic level 0. When the switch is opened, the pin is connected

to Vcc through a high value resistor; hence it reads a logic value 1.

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

11

Page 12: TC

Intelligent Ambulance for City Traffic Police

Thus, the use of pull up resistor has solved our problem. Note that

a high value pull up resistor must be used to limit the current flow to

ground when the switch is closed.

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

12

Page 13: TC

Intelligent Ambulance for City Traffic Police

3. 8051 TIMER/COUNTER PROGRAMMING

P89V51RD2 has 3 timers: T0, T1 and T2.They can be used as

timers or event counters. Here we’ll discuss the timers’ registers and

then show how to program the timers.

3.1 Timers

3.1.1 TIMER 0:

The 16-bit register of timer 0 is accessed as a low byte and high

byte. The low byte register is called TL0 and the high byte register is

referred to as TH0. These register can be addressed like any other

registers, such as A, B, R0, R1 etc. The mode of Timer 0 is set in the

TMOD register and it is controlled by the TCON register

.

3.1.2 TIMER 1:

Timer 1 is also 16 bits, and its 16-bit register is split into 2 bytes,

referred to as TL1 and TH1. These registers are accessible in the same

way as registers of Timer 0. The mode of Timer 1 is set in the TMOD

register and it is controlled by the TCON register

.

3.1.3 TIMER 2:

Timer 2 is a 16-bit Timer/Counter, which can operate as either an

event timer or an event counter, as selected by C/T2 in the special

function register T2CON. Timer 2 has four operating modes: Capture,

Auto-reload (up or down counting), Clock-out, and Baud Rate Generator,

which are selected using T2CON and T2MOD

3.2 TMOD (timer mode) RegisterBoth Timers 0 and 1 use the same register, called TMOD, to set

various timer operation modes. TMOD is an 8-bit register in which the

lower 4 bits are set aside for Timer 0 and upper 4 bits for Timer1. In

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

13

Page 14: TC

Intelligent Ambulance for City Traffic Police

each case, the lower 2 bits are used to set the timer mode and upper 2

bits are used to set the operation. These options are discussed next.

Table 3.1 - TMOD Register

3.2.1 M1, M0

M0 and M1 select the timer mode. There are 4 modes: 0, 1, 2 and

3.

Mode 0 is a 13 bit timer, mode 1 is a 16 bit timer, mode 2 is an 8 bit timer and mode 3 is used as a split timing mode. We will concentrate on modes 1 and 2 since they are the ones used more widely.

3.2.2 C/T (counter /timer)

This bit is used to decide whether the timer is used as a delay

generator or an event counter. If C/T =0, it is used as a timer for time

delay generation. The clock source for time delay is the crystal

frequency of the 8051.

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

14

Page 15: TC

Intelligent Ambulance for City Traffic Police

3.2.3 Clock source for timer

As you know, every timer needs a clock pulse to tick. What is the

source of the clock pulse for the 8051 timers? If C/T= 0, the crystal

frequency attached to the 8051 is the source of the clock of the timer.

The frequency for the timer is always 1/12th of the frequency of the

crystal attached to the 8051.

3.2.4 GATE

Every timer has a means of starting and stopping. The timers in

the 8051 can be started by both, hardware and software means. The

start and stop of the timer are controlled by means of software by the

TR (timer start) bits TR0 and TR1. This is achieved by setting and

clearing the TR bit. This starts and stops the timers as long as GATE=0.

The hardware way of starting and stopping the timer by an external

source is achieved by making GATE=1 in the TMOD register. For the

time being, we will consider only the software control of timers.

3.2.5 16-bit Time Mode (mode 1)

Timer mode "1" is a 16-bit timer. This is a very commonly used

mode.

TLx is incremented from 0 to 255. When TLx is incremented from 255, it

resets to 0 and causes THx to be incremented by 1. Since this is a full

16-bit timer, the timer may contain up to 65536 distinct values. If you

set a 16-bit timer to 0, it will overflow back to 0 after 65,536 machine

cycles.

3.2.6 8-bit Time Mode (mode 2)

Timer mode "2" is an 8-bit auto-reload mode. When a timer is in

mode 2, THx holds the "reload value" and TLx is the timer itself. Thus,

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

15

Page 16: TC

Intelligent Ambulance for City Traffic Police

TLx starts counting up. When TLx reaches 255 and is subsequently

incremented, instead of resetting to 0 (as in the case of modes 0 and

1), it will be reset to the value stored in THx.

3.2.7 Initialization of Timers:Following steps are to be followed to initialize and operate a timer in any mode:

1. Load TMOD value appropriately to specify the timer used, mode of timer, hardware/software control and operation (counter or timer)

2. Load TLx and THx according to the mode selected and the time delay desired.

3. Start the timer. ( Set TRx bit)

4. Keep monitoring the timer overflow flag (TFx) in the TCON register to see if it is raised. Get out of the loop when TFx becomes high.

5. Stop the timer. (Clear TRx bit)

Example:

Write a program to generate a square wave of frequency 1Khz at

the pin P1.1. Assume a crystal of 11.0592 Mhz Frequency. In8051 one

instruction cycle has 12 states. Therefore, the frequency of timer is

11.0592 Mhz /12 = 921.6 KHz. Therefore the time period of each count

will be 1/921.6 = 0.001085 mS = 1.085 microseconds.

For a square wave of 1 Khz, High time=Low time.

Also, High Time + Low Time = (1/1Khz) = 1000 microseconds

Therefore High time = Low time = 500 microseconds.

Now, our problem is simplified. All we have to do is wait for a time

period of 500 microseconds, and then toggle the pin P1_1.

To wait for 500 microseconds, we have to count up to 500/1.085

= 461 (approx).

Now looking at all the available modes, we see that the 16 Bit timer

mode is best suited for this application.

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

16

Page 17: TC

Intelligent Ambulance for City Traffic Police

(461)D = (01CD)H thus to initialize the timers, we have to load 01 in TH0 and CD in TL0. Given below is the solution program:

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

17

Page 18: TC

Intelligent Ambulance for City Traffic Police

#include<p89v51rd2.h> //include device file

void delay(); //declare functionvoid main()

{

delay(); //call delay

while(1) //do continuously

{

P1_1=~P1_1; //toggle P1_1delay(); //wait for 500 microseconds

}

}

void delay()

{

TMOD= 0x01; // select timer 0 in mode 1 (16 Bit)

TH0=0x01; // enter count for 500 microsecondsTL0= 0xCD; // “

TR0=1; //start timer 0

while(TF0==0) ; // wait for timer 0 overflow flag to be setTR0=0; //stop timer 0}

3.2.8 Counter Programming

Recall from last section that C/T bit in the TMOD register decides

the source of the clock for the timer. If C/T=0, the timer gets pulses

from the crystal. In contrast, when C/T=1, the counter counts up as

pulses are fed from pins 14 and 15. These pins are called T0 (timer 0

input) and T1 (timer 1 input).

Thus pulses coming from these pins are counted in the TLx and

THx registers according to the mode selected.

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

18

Page 19: TC

Intelligent Ambulance for City Traffic Police

3.2.9 Counter Operation

The counters have been included on the chip to relieve the

processor of timing and counting chores. When the program wishes to

count a certain number of internal pulses or external events, a number

is placed in one of the counters. The counter increments from the initial

number to the maximum and then rolls over to zero on the final pulse

and also set a timer flag. The flag condition may be tested by an

instruction to tell the program that the count has been accomplished.

Observe the following chart:

Figure 3.1 –Flow chart of Counter

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

19

Page 20: TC

Intelligent Ambulance for City Traffic Police

3.3 TCON (timer control) Register

Timers 1 and 0 are controlled using the upper 4 bits of the TCON

register. The lower 4 bits are used for setting interrupt function and will

be discussed later. The TRx bits (TR0 and TR1) are used to start and

stop the timers by software. The TFx bits (TF0 and TF1) are used to

monitor the status of the timers.

BIT 7 6 5 4 3 2 1 0

NAME TF1 TR1 TF0 TR0 IE1 IT1 IE0 IT0

Figure 3.2 – Block of TCON Register

3.4 8051 INTERRUPTS PROGRAMMINGThere are two ways to monitor the status of an ongoing process

or an external event: interrupts or polling:

3.4.1 Interrupts If process in question (or external event) interrupts the

microcontroller, asking it to execute a different program before carrying

out the original program, we say an interrupt has occurred.

The process can be timer operation or serial data transfer.

The external event can be recognized by 2 pins on the 8051.

And the “different program” id called the Interrupt Service Routine (ISR)

3.4.2 Polling

If a microcontroller keeps monitoring the status flags or inputs

pins continuously until a state change occurs and then branches off to

perform the rest of the program, the microcontroller is said to be polling

for the flags (or inputs)

Needless to say, using interrupts can result in faster and

simultaneous operation of functions.

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

20

Page 21: TC

Intelligent Ambulance for City Traffic Police

The P89V51RD2 has the following 8 different interrupts:

Brown Out External Interrupts 0 and 1 Timer Interrupts 0, 1 and 2 Serial/SPI interrupt PCA

<

3.4.3 The IEN0 and IEN1 (Interrupt Enable) Registers

By default at power up, all interrupts are disabled. This means

that even if, for example, the TF0 bit is set, the 8051 will not execute

the interrupt. Your program must specifically tell the 8051 that it wishes

to enable interrupts and specifically which interrupts it wishes to

enable.

Your program may enable and disable interrupts by modifying the

IEN0 and IEN1 SFR. Note that the EA bit in IEN0 should be enabled for

any interrupt to operate. If EA is cleared, none of the interrupts will be

activated irrespective of the status of other bits in IEN0 and IEN1.

IEN0:

IEN1:

Table 3.2 – Function of IEN0 and IEN1

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

21

Page 22: TC

Intelligent Ambulance for City Traffic Police

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

22

Page 23: TC

Intelligent Ambulance for City Traffic Police

3.4.4 What Happens When an Interrupt Occurs?

When an interrupt is triggered, the following actions are taken

automatically by the microcontroller:

The current Program Address is saved.

In the case of Timer and External interrupts, the corresponding

interrupt flag is cleared.

Program execution transfers to the corresponding Interrupt

Service Routine address.

The Interrupt Service Routine executes.

Take special note of the 2nd step: If the interrupt being handled is a

Timer or External interrupt, the microcontroller automatically clears the

interrupt flag before passing control to your interrupt handler routine.

This means it is not necessary that you clear the bit in your code.

3.4.5 What Happens When an Interrupt Ends?

An interrupt ends when your program executes the “Return from

Interrupt” instruction. When the RETI instruction is executed the

following actions are taken by the microcontroller:

The saved Program Address is restored.

Normal program execution is resumed.

3.5. PROGRAMMING TIMER INTERRUPTS

Before, we considered the operation of timers using the polling

method. Now we will do the same using Interrupts.

To initialize a timer interrupt, the corresponding bits in the IEN0

register should be set.

Then we go about initializing the timer as described in the section

above.

Start the timer. When the timer rolls over from FFFF to 0000 (or FF to 00

in the 8 bit mode), the TFx flag is set. As soon as the TFx flag is set,

interrupt occurs and the program control is shifted to ISR.

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

23

Page 24: TC

Intelligent Ambulance for City Traffic Police

After the ISR is executed, the TFx flag is cleared and program flow

is returned to the original program.

Example: Write a program to create a square wave of frequency 1Khz

on pin P0.1. Simultaneously receive the data at P1 and send it to P2.

Program:#include<p89v51rd2.h>

void timer 0() interrupt 2 //interrupt service routine

{P0_1=~P0_1; //toggle P0_1

TR0=0; //stop timer 0}

void main()

{

IEN0=0x82; //enable interrupt for timer 0

delay(); //initialize timers and wait for 500

microseconds

while(1) //do continuously{

P2=P1; // receive data from P1 and send it to P2

}

}

void delay()

{TMOD=0x01; //select timer 0 in 16 bit mode

TH0=0x01; //load count

TL0=0xCD; // “

TR0=1; //start timer 0

}

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

24

Page 25: TC

Intelligent Ambulance for City Traffic Police

3.6 PROGRAMMING EXTERNAL INTERRUPTS

To initialize an external interrupt, the corresponding bits in the

IEN0 register should be set. The type of interrupt (low level/ High to

Low edge) is determined by setting to IEx bits in the TCON register.

(IEx=0: Low Level Interrupt, IEx=1: H-L Transition Interrupt)

Whenever the appropriate signal is received on the input pins,

(P3.2=Ext Int. 0, P3.3= Ext Int. 1), interrupt occurs and the program

control is shifted to ISR.

After the ISR is executed, the program flow is returned to the original

program.

The only thing that differentiates an ISR (Interrupt Service

Routine) from a normal function is the syntax in which an ISR is defined.

The syntax for defining an interrupt is as shown void ISR Name(void)

interrupt x Eg: void TIMER0_OVF(void) interrupt 1

x Interrupt0 Ext. Interrupt 0 (INT0)1 Timer 0 Overflow2 Ext. Interrupt 1 (INT1)3 Timer 1 Overflow4 UART5 T2

Example on using timer interrupts

This code is for an LED blinking program using timers. The LEDs connected on P3_0, P3_6 and P3_7 will blink.

#include

unsigned char i=0,j=0,k=0;

void timer2_ovf() interrupt 5 //Timer 2 ISR{k++;if(k==50){

k=0;RXD=!RXD;}TF2=0; //Reset overflow flag

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

25

Page 26: TC

Intelligent Ambulance for City Traffic Police

}

void timer0_ovf(void) interrupt 1 //Timer 0 ISR{i++;if(i==50){i=0;RD=!RD;}

}

void timer1_ovf(void) interrupt 3 //Timer 1 ISR{j++;if(j==50){j=0;WR=!WR;}

}

void main(void){TMOD=0×11; //Set timer 0 and 1 in mode 1T2CON=0×04; //Start timer 2 in 16 bit modeET1=1; //Enable Timer 1 overflow interruptET0=1; //Enable Timer 0 overflow interruptET2=1; //Enable Timer 2 overflow interruptTR0=1; //Timer 0 runTR1=1; //Timer 1 runEA=1; //Global Interrupt enablewhile(1){}

}

Example on using external interruptsIn this you can see that the LEDs connected on the RD and WR (i.e. P3_6 and P3_7) pins glow when there is an external interrupt(i.e. switch is pressed)

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

26

Page 27: TC

Intelligent Ambulance for City Traffic Police

#include

void ext_int0(void) interrupt 0 //INT0 ISR{RD=0;}void ext_int1(void) interrupt 2 //INT1 ISR{WR=0;}void main(void){TCON=0×05; //Set interrupt type. Edge triggered in this caseEX1=1; //Enable external interrupt 1EX0=1; //Enable external interrupt 0EA=1; //Global interrupt enablewhile(1){}

}

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

27

Page 28: TC

Intelligent Ambulance for City Traffic Police

4. OBSTACLE SENSOR

4.1 Sensor

Sensors are the device that responds to a physical stimulus (heat,

light, sound, pressure, motion, flow, and so on), and produces a

measurable corresponding electrical signal

4.2 Sensor Technology

So far, we have considered mainly the nature and characteristics

of EM radiation in terms of sources and behavior when interacting with

materials and objects. It was stated that the bulk of the radiation

sensed is either reflected or emitted from the target, generally through

air until it is monitored by a sensor. The subject of what sensors consist

of and how they perform (operate) is important and wide ranging

Most remote sensing instruments (sensors) are designed to

measure photons. The fundamental principle underlying sensor

operation centers on what happens in a critical component - the

detector. This is the concept of the photoelectric effect (for which Albert

Einstein, who first explained it in detail, won his Nobel Prize [not for

Relativity which was a much greater achievement]; his discovery was,

however, a key step in the development of quantum physics). This,

simply stated, says that there will be an emission of negative particles

(electrons) when a negatively charged plate of some appropriate light-

sensitive material is subjected to a beam of photons. The electrons can

then be made to flow from the plate, collected, and counted as a signal.

A key point: The magnitude of the electric current produced (number of

photoelectrons per unit time) is directly proportional to the light

intensity. Thus, changes in the electric current can be used to measure

changes in the photons (numbers; intensity) that strike the plate

(detector) during a given time interval. The kinetic energy of the

released photoelectrons varies with frequency (or wavelength) of the

impinging radiation.

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

28

Page 29: TC

Intelligent Ambulance for City Traffic Police

But, different materials undergo photoelectric effect release of

electrons over different wavelength intervals; each has a threshold

wavelength at which the phenomenon begins and a longer wavelength

at which it ceases.

4.3 Obstacle sensor

Obstacle sensor is a effective IR proximity sensor built with the

TSOP 1738 module. The TSOP module is commonly found at the

receiving end of an IR remote control system; e.g., in TVs, CD players

etc. These modules require the incoming data to be modulated at a

particular frequency and would ignore any other IR signals. There are

various sources of IR sensors and our receiver must receive IR rays only

from our source and ignore other IR Rays. It is also immune to ambient

IR light, so one can easily use these sensors outdoors or under heavily

lit conditions.

Such modules are available for different carrier frequencies from 30 kHz

to 56 kHz.

In this particular proximity sensor, we will be generating a constant

stream of square wave signal using IC555 centered at 38 kHz and would

use it to drive an IR led. So whenever this signal bounces off the

obstacles, the receiver would detect it and change its output. Since the

TSOP 1738 module works in the active-low configuration, its output

would normally remain high and would go low when it detects the signal

(the obstacle)

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

29

Page 30: TC

Intelligent Ambulance for City Traffic Police

4.3.1 Schematic of TSOP sensor

Figure 4.1 – Schematic of TSOP

4.3.2 LM555 Timer

The LM555 is a highly stable device for generating accurate time

delays or oscillation. Additional terminals are provided for triggering or

resetting if desired. In the time delay mode of operation, the time is

precisely controlled by one external resistor and capacitor. For astable

operation as an oscillator, the free running frequency and duty cycle

are accurately controlled with two external resistors and one capacitor.

The circuit may be triggered and reset on falling waveforms, and the

output circuit can source or sink up to 200mA or drive

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

30

Page 31: TC

Intelligent Ambulance for City Traffic Police

Figure 4.2 – LM 555 timer

4.3.3 Calculation for 555 Timer

This calculation is designed to give timing values for the 555

timer, based on the control capacitance and resistance. This particular

configuration is for an astable square wave calculation. The positive

output is high for T(h) seconds based on this formula:

Time High (secs) = 0.693 * (R1 + R2) * C.

The negative output is low for T(l) seconds based on this formula:

Time Low (secs) =0.693 * R2 * C

The frequency is derived by the formula:

Frequency = 1.44 / ((R1 + R2 + R2) * C)

The duty cycle percentage is the relationship of the high time to the

overall cycle time and is derived by the formula:

DCP = (T(h) / (T(h) + T(l))) * 100

Where resistance is in ohms and capacitance is in farads. Enter

the capacitance in farads (not microfarads) and the resistance in ohms

for each resistor. Click on Calculate to return the time high in seconds,

the time low in seconds, the duty cycle percentage and the frequency

in hertz.

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

31

Page 32: TC

Intelligent Ambulance for City Traffic Police

5. RFID

5.1 LF RFID MODULE

The DT125R series RFID Proximity OEM Reader Module has a

built-inantenna in minimized form factor. It is designed to work on the

industry standard carrier frequency of 125 kHz.

This LF reader module with an internal or an external antenna

facilitates communication with Read-Only transponders—type UNIQUE

or TK5530 via the air interface. The tag data is sent to the host systems

via the wired communication interface with a protocol selected from the

module pinout.

The LF DT125R module is best suited for applications in Access

Control,Time and Attendance, Asset Management, Handheld Readers,

Immobilizers, and other RFID enabled applications.

5.2 Features

Selectable UART or Wigand26

Plug-and-Play, needs +5V to become a reader

No repeat reads

LED/Beeper indicates tag reading operation

Excellent read performance without an external circuit

Compact size and cost-effective

A very efficient module for portable readers.

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

32

Page 33: TC

Intelligent Ambulance for City Traffic Police

5.3. Block Diagram

Figure 5.1 – Block diagram of RFID Module

The LF DT125R reader consists a RF front end interfaced with the

baseband processor that operates with +5V power supply. An antenna

is interfaced with the RF front end, and tuned at 125 kHz to detect a tag

(transponder) that comes in the vicinity of the reader field.

The data read from the tag by the front end is detected and

decoded by the base band processor and is then sent to the UART

interface.

The DT125R is designed for a reading range of 50 mm to 100 mm.

A LED and a beeper can be interfaced to the pin out to indicate the tag

read status.

DT125R has a built-in circuitry for noise reduction.

5.3.1 Data Transmission in ASCII Standard

Data read from the tag is Manchester encoded. The Manchester

encoded data is decoded to ASCII standard. Decoded data is sent to the

UART serial interface for wired communication with the host systems.

ASCII data format is shown below:

The 1byte (2 ASCII characters) Check sum is the “Exclusive OR” of

the 5 hex bytes (10 ASCII) Data characters.

It takes the full memory of the card from D00 to D93 and divides

this memory into 10 groups of 4 bits.

Group1= D00 to D03; Group2= D10 to D13 ……Group10= D90 to D93.

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

33

Page 34: TC

Intelligent Ambulance for City Traffic Police

The reader then takes the corresponding HEX value for each

group of 4 bits 0…FHEX. This HEX value is now taken as ASCII

characters and the reader transmits the

ASCII value.

STX (02h) DATA (10 ASCII) CHECK SUM (2 ASCII) CR LF ETX (03h)

5.3.2 Specifications:

Dimensions (LXBXH) mm 30x30x10

Frequency 125 kHz

Reading Distance >= 50 mm

Interface UART, Wiegand26

Antenna Built-in and External

Supply Voltage +5 V

Operating temperature 10°C to +50°C (-14°F to +122°F)

Tag Types Unique, TK5530

Output Format ASCII

Color Black

Table 5.1 – Specifications of RFID Module.

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

34

Page 35: TC

Intelligent Ambulance for City Traffic Police

Figure 5.2 – Dimension of RFID Module

5.3.3 Pin Number Description

PIN 1 1 LED/BEEPER

PIN 2 Data1

PIN 3 Data0

PIN 4 GND

PIN 5 TTL1 (TXD)

PIN 6 TTL0 (RXD)

PIN 7 NC

PIN 8 VCC

PIN 9 ANTENNA 1

PIN 10 ANTENNA 2

Table 5.2 – Pin Details

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

35

Page 36: TC

Intelligent Ambulance for City Traffic Police

Figure 5.3 – Bottom view of RFID Module

5.3.4 Schematic Diagram

Figure 5.4 – Schematic Diagram of RFID Module

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

36

Page 37: TC

Intelligent Ambulance for City Traffic Police

5.4 Applications

Applications of the RFID OEM LF DT125R Reader Module are

limited by the imagination of the designer because of the compact form

factor and low power consumption. Some of the common applications

for this module are:

Access control

Handheld readers

Asset management

Time and Attendance

Immobilizers

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

37

Page 38: TC

Intelligent Ambulance for City Traffic Police

6. LIGHT EMITTING DIODES

Traffic lights, also known as traffic signals, stop lights, traffic

lamps, stop-and-go lights, robots or semaphore, are signaling devices

positioned at road intersections, pedestrian crossings, and other

locations to control competing flows of traffic.

Traffic lights have been installed in most cities around the world

to control the flow of traffic. They assign the right of way to road users

by the use of lights in standard colors (Red - Amber - Green), using a

universal color code (and a precise sequence, for those who are color

blind). They are used at busy intersections to more evenly apportion

delay to the various users.

The most common traffic lights consist of a set of three lights:

red, yellow (officially amber), and green. When illuminated, the red light

indicates for vehicles facing the light to stop; the amber indicates

caution, either because lights are about to turn green or because lights

are about to turn red; and the green light to proceed, if it is safe to do

so.

There are many variations in the use and legislation of traffic lights,

depending on the customs of a country and the special needs of a

particular intersection. There may, for example, be special lights for

pedestrians, bicycles, buses, trams, etc; light sequences may differ; and

there may be special rules, or sets of lights, for traffic turning in a

particular direction. Complex intersections may use any combination of

these.

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

38

Page 39: TC

Intelligent Ambulance for City Traffic Police

6.1 Traffic Lights

Traffic lights can have several additional lights for filter turns or

bus lanes. This one in Warrington, also shows the distinctive red +

amber combination seen in the UK. It also shows the backing board and

white border used to increase the target value of the signal head.

Improved visibility of the signal head is achieved during the night by

using the retro-reflective white border

In many regions, traffic lights function differently or have different

displays depending on available technology, traffic patterns, or other

vehicles such as trolleys that also use the intersection. For example,

some fixtures feature a flashing green light or more than one arrow lit

at one time. An example of a flashing green light found in Canada, to

notify left turning drivers that they have the right of way and that the

opposing lanes will not be moving.

6.1.1 Three Set Lights

Figure 6.1 – Three set Lights

The universal standard is for the red to be above the green, and if

there is also amber it is placed in the middle. If the three-set lights are

mounted horizontally, the red will typically be to the left of the green.

The standards apply whether the country drives on the left or the right,

but the placement of the mountings on the road would be mirror

images of the other.

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

39

Red

Yellow

Green

Page 40: TC

Intelligent Ambulance for City Traffic Police

Each country has differing road rules, including how traffic lights

are to be interpreted. For example, in some countries, a flashing yellow

light means that a motorist may proceed with care if the road is clear,

giving way to pedestrians and to other road vehicles that may have

priority (essentially the same as arriving at a non-signalized intersection

and not facing a stop sign). A flashing red may be treated as a regular

stop sign.

6.2 Turning signals and rules

Figure 6.2 – Working of Traffic Lights

In some instances, traffic may turn left (in left-driving

jurisdictions) or right (in right-driving jurisdictions) after stopping at a

red light, providing they give way to the pedestrians and other vehicles.

In some cases which generally disallow this, a sign next to the traffic

light indicates that it is allowed at a particular intersection.

Conversely, jurisdictions which generally allow this might forbid it

at a particular intersection with a "no turn on red" sign, or might put a

green arrow to indicate specifically when a turn is allowed without

having to yield to pedestrians (this is usually when traffic from the

perpendicular street is making a turn onto one's street and thus no

pedestrians are allowed in the intersection anyway).

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

40

Page 41: TC

Intelligent Ambulance for City Traffic Police

Some jurisdictions allow turning on red in the opposite direction

(left in right-driving countries; right in left-driving countries) from a one-

way road onto another one-way road; some of these even allow these

turns from a two-way road onto a one-way road. Also differing is

whether a red arrow prohibits turns; some jurisdictions require a "no

turn on red" sign in these cases. A study in the State of Illinois (a right-

driving jurisdiction) concluded that allowing drivers to proceed straight

on red after stopping, at specially posted T-intersections where the

intersecting road went only left, was dangerous. Proceeding straight on

red at T-intersections where the intersecting road went only left was

once legal in Mainland China with right-hand traffic provided that such

movement would not interfere with other traffic, but when the Road

Traffic Safety Law of the People's Republic of China took effect on 1 May

2004, such movement was outlawed.[13]. In some other countries the

permission is indicated by a flashing amber arrow (cars do not have to

stop but must give way to other cars and pedestrians).

Another distinction is between intersections that have dedicated

signals for turning across the flow of opposing traffic and those that do

not. Such signals are called dedicated left-turn lights in the United

States and Canada (since opposing traffic is on the left). With dedicated

left turn signals, a left-pointing arrow turns green when traffic may turn

left without conflict, and turns red or disappears otherwise. Such a

signal is referred to as a "protected" signal if it has its own red phase; a

"permissive" signal does not have such a feature. Three standard

versions of the permissive signal exist: One version is a horizontal bar

with five lights - the green and yellow arrows are located between the

standard green and yellow lights. A vertical 5-light bar holds the arrows

underneath the standard green light (in this arrangement, the yellow

arrow is sometimes omitted, leaving only the green arrow below the

solid green light, or possibly an LED based device capable of showing

both green and yellow arrows within a single lamp housing).

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

41

Page 42: TC

Intelligent Ambulance for City Traffic Police

A third type is known as a "doghouse" or "cluster head" - a

vertical column with the two normal lights is on the right side of the

signal, a vertical column with the two arrows is located on the left, and

the normal red signal is in the middle above the two columns. Cluster

signals in Australia and New Zealand use six signals, the sixth being a

red arrow which can operate separately from the standard red light. In

a fourth type, sometimes seen at intersections in Ontario and Quebec,

Canada, there is no dedicated left-turn lamp per se. Instead, the normal

green lamp flashes rapidly, indicating permission to go straight as well

as make a left turn in front of opposing traffic, which is being held by a

steady red lamp. (This "advance green," or flashing green can be

somewhat startling and confusing to drivers not familiar with this

system. This also can cause confusion amongst visitors to British

Columbia, where a flashing green signal denotes a pedestrian

controlled intersection.[14]) Another interesting practice seen at least

in Ontario is that cars wishing to turn left that arrived after the left turn

signal ended can do so during the amber phase, as long as there is

enough time to make a safe turn.

A flashing amber arrow, which allows drivers to make left turns

after giving way to oncoming traffic, is becoming more widespread in

the United States, particularly in Oregon. In the normal sequence, a

protected green left-turn arrow will first change to a solid amber arrow

to indicate the end of the protected phase, then to a flashing amber

arrow, which remains flashing until the standard green light changes to

amber and red. In Oregon, the amber-flashing arrow is usually housed

in a separate light head from the steady amber arrow, in order to

provide a visible position change. These generally take the form of four

signal heads (green, amber, amber, red). On some newer signals,

notably in the city of Bend, the green and flashing amber arrows

emanate from the same light head through the use of a dual-color LED

array, while the solid amber arrow is mounted above it.

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

42

Page 43: TC

Intelligent Ambulance for City Traffic Police

Generally, a dedicated left-turn signal is illuminated at the

beginning of the green phase of the green-yellow-red-green cycle. This

allows left-turn traffic, which often consists of just a few cars, to vacate

the intersection quickly before giving priority to vehicles traveling

straight. This increases the throughput of left-turn traffic while reducing

the number of drivers, perhaps frustrated by long waits in heavy traffic

for opposing traffic to clear, attempting to make an illegal left turn on

red. If there is no left-turn signal, the law requires one to yield to

oncoming traffic and turn when the intersection is clear and it is safe to

do so. Nevertheless, it is increasingly and disturbingly common in at

least the U.S. to see drivers who do not yield in the absence of a

dedicated signal, cutting off traffic that has right-of-way and is starting

to head across the intersection.[citation needed]

In the U.S., many older inner-city and rural areas do not have

dedicated left-turn lights, while most newer suburban areas have them.

Such lights tend to decrease the overall efficiency of the intersection as

it becomes congested, although it makes intersections safer by

reducing the risk of head-on collisions and may even speed up through

traffic, but if a significant amount of traffic is turning, a dedicated turn

signal helps eliminate congestion.

Some intersections with protected-turn signals occasionally have what

is known as "yellow trap", "lag-trap", or "left turn trap" (in right-driving

countries). It occurs at intersections where vehicles are permitted to

make left turns on normal green lights. "Yellow trap" refers to situations

when left-turning drivers are trapped in the intersection with a red light,

while opposing traffic still has a green.

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

43

Page 44: TC

Intelligent Ambulance for City Traffic Police

For example, an intersection has dedicated left-turn signals for

traffic traveling north. The southbound traffic gets a red light so

northbound traffic can make a left turn, but the straight-through

northbound traffic continues to get a green light. A southbound driver

who had entered the intersection earlier will now be in a predicament,

since they have no idea whether traffic continuing straight for both

directions is becoming red, or just their direction. The driver will now

have to check the traffic light behind them, which is often impossible

from the viewing angle of a driver's seat. This can also happen when

emergency vehicles or railroads preempt normal signal operation. In

the United States, signs reading "Oncoming traffic has extended green"

or "Oncoming traffic may have extended green" must be posted at

intersections where the "yellow trap" condition exists.

Although motorcycles and scooters in most jurisdictions follow the

same traffic signal rules for left turns as do cars and trucks, some

places, such as Taiwan, have different rules. In these areas, it is not

permitted for such small and often hard-to-see vehicles to turn left in

front of oncoming traffic on certain high-volume roads when there is no

dedicated left-turn signal. Instead, in order to make a left turn, the rider

moves to the right side of the road, travels through the first half of the

intersection on green, then slows down and stops directly in front of the

line of cars on the driver's right waiting to travel across the intersection,

which are of course being held by a red light. There is often a white box

painted on the road in this location to indicate where the riders should

group. The rider turns the bike 90 degrees to the left from the original

direction of travel and proceeds along with the line of cars when the red

light turns green, completing the left turn. This procedure improves

safety because the rider never has to cross oncoming traffic, which is

particularly important given the much greater likelihood of injury when

a cycle is hit by a car or truck.

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

44

Page 45: TC

Intelligent Ambulance for City Traffic Police

This system (called a "hook-turn") is also used at many

intersections in the CBD of Melbourne, Australia, where both streets

carry tramways. This is done so right-turning vehicles (Australia drives

on the left) do not block the passage of trams. The system is being

extended to the suburbs.

At intersections where no turns are allowed from any direction, the

green light can be replaced with a green arrow pointing up.

6.3 Programming on LEDsIn 8051 LEDs can be connected to pins P3_0, P3_1, P3_6, and

P3_7. These pins have to be initialized as input ports or out put port. For

input initialization port is given as 1 and for out put port is given as 0.

Example:Write a program for blinking of an LED

#include<P89v51rd2.h>

void delay(unsigned char del);

void main()

{

while(1)

{

P3_0=0;

delay (20);

P3_0=1;

Delay (20);

}}void delay (unsigned char del){int i,j;for (i=0;i<1000;i++)for (j=0;j<del;j++);}

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

45

Page 46: TC

Intelligent Ambulance for City Traffic Police

7. ADVANTAGES & ISSUE RELATED TO INTELLIGENT AMBULANCE

7.1 Abstract Problem statement- Traffic congestion and tidal

flow management were recognized as major problems in modern urban

areas, which have caused much frustration and loss of man-hours.

In order to solve the problem an intelligent RFID traffic control has

been developed. It is intended to avoid the problems that usually arise

with conventional systems.

7.2 Pre-timed- where the signal phases and cycle length are

predetermined using historical data; the time period of green light is

predetermined and it continues to be the same throughout the day, if

no sensory input is received. In our case the predetermined time for

green light is 5 seconds.

7.3 Actuated- where the signal phase lengths are adjusted in

response to traffic flow, as registered by the actuation of vehicle and/or

pedestrian detectors; if a sensory output is received by the controller, it

adjusts the time period of green light for the next road. Suppose we are

using only the output from the sensors then the drawback is that

suppose in a low congested road an ambulance or a high priority

vehicle comes it will not be signaled unless and until the congestion is

avoided so to deal with this situation we are planning to in incorporate

RFID modules which will prioritize the signals based on the traffic on the

priority vehicles also.

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

46

Page 47: TC

Intelligent Ambulance for City Traffic Police

8. CONCLUSION

A system is useful to improve the traffic flow on the road as well

as at the intersections of the roads, which in turn reduce the traveling

time, fuel consumption, and emissions, by reducing the cross over time

required at each intersection and by preventing or relieving the

congestions on the roads. The method controls traffic of vehicles

running between the two intersections or signals. The system

establishes the intelligent interaction among every two adjacent traffic

signals which results in the helps in the formation of the collection of

vehicles crossing the next signal which in tern helps in optimum

utilization of the ON time or Green time of the traffic signals. The

system also provides the real-time, necessary and useful information to

drivers in order to cross the next intersection or signal in minimum time

without exceeding or crossing the maximum and the minimum speed

limits. The system also detects the vehicle congestions and resolves it

by adjusting the traffic flow and size of the vehicle collections,

accordingly by changing the ON times of the signals with the help of

intelligent interaction among the traffic signals. The ON time of the

traffic signal near the congestion area is increased and the increased

time helps to resume the traffic flow, as earlier. The increased amount

of time is adjusted from the ON time of the adjacent signals so that the

traffic flow in the other areas should be less affected.

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

47

Page 48: TC

Intelligent Ambulance for City Traffic Police

11. REFRENCES

8051 Microcontroller & Embedded Systems using assembly and C Languages.

Author : Muhammed Ali Mazidi, Janice Gillispie Mazidi. 2006.

8051 Microcontroller 4th Edition

Author : Mc Kenzie

8051 Microcontroller Hardware, Software & Interfacing

Author : 1) James W Stewart

2) Kai Z. Mico 1999.

RFID Hand Book: Fundamentals & Applications

Author : Klans Finkenzeller 2003.

RFID : Radio Frequency Identification

Author : Steven Shepherd 2005.

RFID Essentials

Author : Bill Glover

Himanshu Bhatt 2006.

Sensors & Actuators

Author : Elseiver 2001.

Optical Sensors

Author : Narayan Swami

Linear and Digital IC Application

Author: U.A. Bakshi

Digital Electronics & Logic Design

Author : B Somnath Nair

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

48

Page 49: TC

Intelligent Ambulance for City Traffic Police

WEBSITES:

http://www.Digant.com//

http://www.555 Timer tutorials.com//

//Wikipedia, the free encyclopedia//

http://www.alldata sheets.com//

http://www.Luminlabz.com//

Department of Instrumentation Technology Engineering K.B.N. College of Engineering, Gulbarga

49