Вы находитесь на странице: 1из 9

TOPIC:- Microprossor based traffic light controller

using 8085

INTRODUCTION:- associated traffic accidents. The


more number of drivers who
know about the operation of
Many traffic light systems traffic signals, the less
operate on a timing frustrated they are going to be
mechanism that changes the while waiting for the lights to
lights after a given interval. An change. The main aim in
intelligent traffic light system designing and developing of the
senses the presence or absence Intelligent Traffic Signal
of vehicles and reacts Simulator is to reduce the
accordingly. The idea behind waiting time of each lane of the
intelligent traffic systems is that cars and also to maximize the
drivers will not spend total number of cars that can
unnecessary time waiting for cross an intersection given the
the traffic lights to change. An mathematical function to
intelligent traffic system detects calculate the waiting time. The
traffic in many different ways traffic signal system consists of
The older system uses weight as three important parts. The first
a trigger mechanism . Current part is the controller, which
traffic systems react to motion represents the brain of the
to trigger the light changes. traffic system. It consists of a
Once the infrared object computer that controls the
detector picks up the presence selection and timing of traffic
of a car, a switch causes the movements in accordance to
lights to change. In order to the varying demands of traffic
accomplish this, algorithms are signal as registered to the
used to govern the actions of controller unit by sensors . The
the traffic system. While there second part is the signal
are many different visualization or in simple words
programming languages today, is signal face. Signal faces are
some programming concepts part of a signal head provided
are universal in Boolean Logic. for controlling traffic in a single
We need to understand the direction and consist of one or
function of traffic signals so more signal sections. These
that we can improve driving usually comprise of solid red,
habits by controlling the speed yellow, and green lights. The
in order to reduce the number of third part is the detector or
sensor. The sensor or detector is Controller 8279, Programmable as
a device to indicate the Peripheral Interface 8255, 26 pin
presence of vehicles. One of the parallel port connector, 21 keys Hexa
technologies, which are used key pad and six number of seven
today, consists of wire loops segment LED’s.
placed in the pavement at The second part is the traffic light
intersections. They are activated controller interface board, which
by the change of electrical consist of 36 LED’s in which 20
inductance caused by a vehicle LED’s are used for vehicle traffic
passing over or standing over and they are connected to 20 port
the wire loop. Recent lines of 8255 through Buffer.
technology utilization is video Remaining LED’s are used for
detection. A camera feeds a pedestrian traffic. The traffic light
small computer that can "see" if interface board is connected to Main
a vehicle is present. board using 26 core flat cables to 26-
pin Port connector. The LED’s can
be switched ON/OFF in the specified
sequence by the Microprocessor.

AIM:
The main aim of this project is to
design a Traffic light controller using
8085 microprocessor.
The 8085 Microprocessor is
a popular Microprocessor used in
Industries for various applications.
Such as traffic light control,
temperature control, stepper motor
control, etc. In this project, the
Experimental setup: -
traffic lights are interfaced to
Microprocessor system through
buffer and ports of programmable In order to implement the Intelligent
peripheral Interface 8255. So the Traffic Signal Simulator, one needs to
traffic lights can be automatically setup and assemble the hardware
switched ON/OFF in desired components and write a program to
sequence. The Interface board has control the intelligent traffic signal
been designed to work with parallel simulator. The layout of the Intelligent
port of Microprocessor system. Traffic Signal Simulator is displayed in
Figure 1. The blocks, which are labeled
The hardware of the system consists N1, N2, N3, E1, E2, E3, S1 and W1 are
of two parts. The first part is the infrared object detectors.
Microprocessor based system with
8085. Microprocessor as CPU and
the peripheral devices like EPROM,
RAM, Keyboard & Display
output by the microcontroller. In each
Hardware components:- lane, there are three LEDs according to
traffic lights colors which consist of red,
yellow and green. Moreover, two
The traffic light system consists of four inverters were used in order to connect
important components: the controller the output of green and red LEDs
which is the brain to the system, the together. Therefore, when the green
sensors which detect the presence of LED is ON then the red LED will be
vehicles, the light emitting diodes. OFF and vice-versa. Figure 3 shows the
(LED) which act as the actuator and the connection of the input and output ports
countdown timers which is displayed in to sensors and LEDs. The BS2
Lab VIEW. BASIC STAMP 2 (BS2) is microcontroller has 16 Input and Output
used as the microcontroller of the traffic ports. The ports were divided into 8
signal. The BS2, which needs to be input and 8 output ports. The output
plugged to the Board of Education ports, which are from P0 to P7, give
(BoE), is directly attached to the either logic 0 or 1 to the LEDs.
computer in order to program it. The Meanwhile, the input ports, which are
wiring for the output and input signals is from P8 to P15, receive input signal
done from this board. Figure 2 shows the from the sensors.
Board of Education to which a 9V DC
power is supplied. There is also a DB9
connector, that is connected to the COM Software simulation: -
port of computer using RS-232 serial
cable, for BS2 programming and serial After the hardware had been setup, a
communication during runtime. program written in the BASIC
Next to the BS2, there is a breadboard. programming language in the BASIC
The breadboard has many strips of STAMP editor is downloaded into the
copper, which run underneath the board microcontroller. The simulation of the
in a horizontal fashion. These strips algorithm of the traffic signal system
connect the sockets to each other. As for was done using MATLAB software.
the infrared object detector, SHARP Furthermore, the countdown timer
GP2D15 is used. The sensor task is to interfacing according to the traffic
detect the presence of vehicles. It is system using Lab VIEW software is
functioning continuously by giving a created using the BNC Adapter and he
logic 0 when there are no vehicles and Data Acquisition Card (DAQ) device.
logic 1 when there are vehicles present. The Lab VIEW programming is done in
Therefore, they can detect the length of the diagram using graphical source code.
the queue depending on where they are In the block diagram the program runs
placed. Each detector has a JST from left to right. If the green light in the
connector housing slot and three traffic model does not illuminate, the
crimped wires to use in the JST system goes into default since there is no
connector. The connectors are plugged input into the system. The signal from
into the appropriate housing slot and into the sensor is acquired through the DAQ,
the detector. The light emitting diodes which is connected, to the computer.
are used in order to show the traffic light
changing according to the program. The
LED light will change according to
Fig. 3: Connection of the input and
output ports to
sensors and LEDs

Fig. 1: Intelligent traffic signal


simulator layout

Fig. 4: Traffic signal sequence

Implementation: -

A single 3-lamp traffic light is


considered as a finite state machine. It
has three states, Red, Yellow, and Green,
which are also the outputs. A single
input for the traffic light is defined, with
values 0 for no change and 1 for change.
This input is connected to the output of a
countdown timer, which outputs a 1
Fig. 2: Board of Education
when it reaches zero. Thus for a single
light, we can draw the state transition
diagram as shown in Fig. 4. A single
traffic light is not very useful. In reality,
lights are installed in pairs, with two
pairs per intersection. Therefore, in the
simulation one pair of lights was used to
control traffic in the north-south
direction, while the other pair controls
the east-west direction. Furthermore, the
two pairs of lights must be synchronized;
therefore countdown timers are
connected to the lights in pairs. Since the
lights that make up a pair mirror each
other, they are considered as a single
light. But since the opposite pairs must gate should be wired correctly. Then the
be in sync, we must group their different program codes that had been developed
outputs together. Thus there are 3 × 3 = simultaneously are downloaded to the
9 possible outputs. Each combined BS2. In each lane, three infrared object
output describes the color of the north- detectors have
south light along with the color of the installed. Therefore, the program will
east-west light. check first the condition of the sensors,
whether they are triggered
In order for the Traffic Signal Simulator
to work intelligently, mathematical
functions that can calculate the time
needed for the green signal to illuminate
based on the length of queue are
developed. The length of queue is
detected through the infrared object
detectors by the presence of vehicles.
The timing for the green signal to
illuminate is given by:
Fig. 5: Front panel of counters

where d is the distance between one


sensor to another sensor in (m), v1 is the
average speed of the first car moving
from stationary at the moment the signal
turned green in (m/s), aa is the average
acceleration of a car from stationary
position to the next car position in
(m/s2), vs is the average speed of a car
moving from standstill after traffic light
turns green in (m/s), z is a variable,
which gives two values only: 0 when Fig. 6: Default situation
there is no sensor triggered and 1 if there
is at least one sensorv triggered, D12 is
the total time delay given by:
D12 t1  ( nt 1)t2
where t1 is the value of the first time
delay in (s), nt
equals to the number of sensors
triggered, and t2 is the
second time delay for each lane in (s).
The first step in the simulator
implementation is to install the hardware
components. The connection of the BS2,
infrared object detector, light emitting
diode (LED), AND gate and inverter
Fig. 7: Situation where only 1 sensor is
triggered

or not. The total number of sensors


triggered will be used in the
mathematical function to calculate the
appropriate timing for the green signal to
illuminate. After the green signal
finishes the illumination timing, the
yellow signal will illuminate for 2
seconds and then finally the red signal
will illuminate. After that, the traffic
signal will wait for 1 second before it
goes to the next lane condition

DIAGRAM:-

26 pin port connector


26 pin port connector

26 pin
FRC cable
Stop PW

Stop PE

Stop PN Stop PN
Go PE

NORTH
Go PW

AD0-AD7 A0-A7 Go PN Go PN
8085 Latch 8255 Buffer
D0-D7

CPU PPI
Stop N
Warning W

Warning N
FL W

Go N
Stop W

System Bus
Warning E

FR N
ST N FL N
Stop E
FR E

8279
ST W

Anode driver
ST E

EPROM RAM keyboard


WEST

EAST

Display Display
Go W

Controller
FR W

FL E

Decoder
Keyboard
Cathode driver ST S
FL S FR S

Go S
Warning S
Stop PW

Stop PE
Go PE
Go PW

Stop S
Stop PS Stop PS

Go PS Go PS
SOUTH
Microcontrollers are often used for
logic-timer control. A traffic light
controller is a
simple example. The light patterns are
flashed on for a specified time using the
parallel or serial port. The time delays
can be generated using either software
(delay loops) or hardware (timer
facilities). For this particular example,
the software method is quite
appropriate. During lunchtime, there has
been excessive congestion in front of
Platt Dining Hall. Students headed north
and south bound in front of Platt have
nearly collided withunicyclists headed
east or west reading books or juggling
swords. No serious injuries have yet
occurred, but parents have been calling
Requirement:- the President demanding action. He has
directed Physical Plant to install a
Design a traffic light sequence simulator system of traffic lights at the intersection
using the MC68HC11 microcontroller controlling
and glue logic on your FPGA board. The east/west traffic and north/south traffic.1
traffic lights are to be built with colored Lights A control east/west traffic while
LEDs. Light patterns and delay times are lights B control north/south traffic.
to be read from a table, while the output
is to be sent to
six LEDs by the:
Microprocessor-Based
a) Parallel I/O Port B Systems ;-
b) Serial Peripheral Interface (SPI)
Your controller should be built with a
Types of System:- sequence descriptor and an interpreter.
In this way
The different types of system used for the control sequence may be changed at
solving traffic congestion problems are: any time to better accommodate traffic
1. Fuzzy Expert System conditions.
2. Artificial Neural Network The sequence descriptor is an entry in a
3. An Intelligence Decision-making table containing the light pattern and
system for Urban Traffic-Control duration. In order to have a variable
(IDUTC) length table, a null entry (pattern of 0
and duration of 0 sec) can be designated
as the end of the table, for this will never
be part of the sequence.
Discussion:- The interpreter is a program that reads
values from the sequence descriptor
table. The interpreter sends light patterns
for the specified durations. The 1) Configure the data direction register
interpreter should have a delay for port D (DDRD)
subroutine to waste exactly 1 second. 2) Configure the control register (SPCR)
The delay time read from the table is 3) Read the status register to clear any
used to count out the number of times flag that is set (SPSR)
the “1 second delay” subroutine is 4) Write a pattern to the data I/O register
executed. Your delays should meet a +/- (SPDR)
5% tolerance. 5) Repeat steps 3 and 4 as needed
For the experiment, the following Remember that bit 5 of the DDRD must
sequence descriptor is suggested: be high or SSbar must be tied high with
Pattern an external resistor to avoid looking for
North-South East-West errors when MISO is not used.
Duration When connecting to the Berg strip from
red green 15 the HC11 board, be very careful not to
red yellow 3 short adjacent pins with wires or careless
green red 10 handling of a probe. This is a likely
yellow red 2 cause of damage to many boards in the
null null 0 past. It is very difficult to debug your
Write your code in assembly language project when you do not know if the
using a text editor and assemble it using failure is coming from your code or from
the AS11 a damaged board.
program. Experiment with the –l flag to
produce a listing of the code showing the
opcodes alongside your assembly
CONCLUSION
language statements.Listing handy
An intelligent traffic light system
during debug is often useful. Download
had successfully been designed
the .s19 output file to the EVB to test
and developed. The sensors
your program.
Use good coding practice on your were interfaced with Lab VIEW
assembly language programs. Comment integrated system. This
your code thoroughly. Use EQU interface is synchronized with
statements to define port addresses. the whole process of the traffic
Control the North-South lights with data system. This prototype can
coming over Port B and control the East- easily be implemented in real
West lights with data coming over the life situations.
SPI. When the SPI is used, you will need Increasing the number of
an 8-bit serialin parallel-out shift register sensors to detect the presence
to capture the data. You can build such a of vehicles can further enhance
shift register on your FPGA. You are the design of the traffic light
free to use either Verilog or schematic system. Another room of
entry. The programming ritual for the improvement is to have the
SPI is reviewed below. You should infrared sensors replaced with
carefully study the 68HC11 reference an imaging system/camera
manual for more information or look at system so that it has a wide
some of the examples in other HC11 range of detection capabilities,
books. which can be enhanced and
ventured into a perfect traffic
system.

PROCEDURE:-

1. Connect power supply 5V & GND


to both microprocessor trainer kit &
Traffic light controller interfacing kit.
2. Connect data bus between
microprocessor trainer kit & Traffic
light controller interfacing kit.
3. Enter the program to control
Traffic light.
4. Execute the program by typing GO
E000:0B80 ENTER.
5. Observe the LED’s on traffic light
controller PCB.