You are on page 1of 27

Traffic Control

System
using 89C51
Project Title:

Thajid Ibna Rouf Uday

Id:021 121 102


Marzia IslamMow
ID:024121009
Amzad Hossain
ID:021 111 140

Description
Traffic congestion is one of the major problems, the

world is facing today. Traffic monitoring and


controlling is a difficult task. We can easily handle it
by microcontroller system .
All roadways are built with devices meant to control
traffic. They help the driver navigate and assign the
right-of-way at intersections. Traffic lights have been
installed in most cities around the world. They assign
the right of way to road users by the use of lights in
standard colors (red - amber/yellow - green), using a
universal color code.

Description

This project is developed to meet the

requirements of solid state traffic light controller


by adopting microcontroller as the main
controlling element, and leds as the indication of
light. A micro controller is interfaced to leds
provide for centralized control of the traffic
signals. Microcontroller is programmed in such a
way to adjust their timing and phasing to meet
changing traffic conditions. The circuit besides
being reliable and compact is also cost effective

Description

Typically traffic lights consist of a set of three colored

lights: red, yellow and green. In a typical cycle,


Flashing Green: Varies among jurisdiction.
Illumination of the green light allows traffic to
proceed in the direction denoted.

Description
Flashing Yellow: Caution, crossing or road

hazard ahead. Illumination of the amber/yellow


light denoting, if safe to do so, prepare to stop
short of the intersection, and
Flashing Red: Treat as a stop sign. Illumination
of the red signal prohibits any traffic from
proceeding.
After completing every cycle red and yellow
lights are flashing at a time for proceed next cycle
to flash green light

Description

ASSUMPTION:

Traffic signal is controlled by light are generally

built in 2 types for four roads junction point.


TYPE 1: one major road and one minor road
are crossed at a point.
TYPE2: Two major roads are crossed at a point.
These two type of traffic system are different
for heavy rush of vehicles. Our traffic control
system is built in TYPE2 , which is shown next
slide

Description

Description

Working procedure:

When the display1 of road 1 flash green light to move

then other three roads are show stop sign.


After Some sec yellow light (halt signal) is flashes for
Some sec. At the same moment display1 of road2
shows red and yellow signals at a time, which means
that after some sec it will flash green light.
This sequence is repeated continuously for accordingly
road 1, 2, 3 & 4.
When all roads are shows red signal for Some sec,
then general people are crossing road very safely which
shows in Display

Description
Most of the time general people are not use

foot over bridge to cross the road, and many


busy roads have no foot over bridge to cross
road. So, If there is a traffic control display to
show when general people are cross the road
which is play very important role to minimize
largely the road accident. At the mean time there
was a bar which is closed all the road and does
not move on the vehicles. Because some time
driver are not flow the traffic signals .

COMPONENTS
AT89C51 Microcontroller Chip, 1pic
Crystal 12MHZ
PC B Board

74LS245 Buffer IC, 2pic


7404 Inverter, 4pic
Resistor: 330 ohms, 20pic
LED-Green, 8pic
LED-Red, 8pic
LED-Yellow, 4pic
L293D Motor Driver (package) , 4pic
Stepper Motor, 4pic

COMPONENTS
AT89C51 is an 8-

bit microcontroller and


belongs to Atmel's 8051
family.
ATMEL 89C51 has 4KB of
Flash programmable and
erasable read only memory
(PEROM) and 128 bytes of
RAM.
It can be erased and program
to a maximum of 1000 times.

AT89C51

COMPONENTS
These octal bus transceivers are

designed for asynchronous twoway communication between


data buses.
The control-function
implementation minimizes
external timing requirements.
The devices allow data
transmission from the A bus to
the B bus or from the B bus to
the A bus, depending on the
logic level at the directioncontrol (DIR) input. The outputenable(OE) input can disable the

74LS245

COMPONENTS
This package contains six
inverter
All six inverters can be used
independently of one another .

7404

COMPONENTS
Resistance - 330 ohms

COMPONENTS
LED

COMPONENTS

L293D Motor Driver

Wide Supply-Voltage Range:

4.5 V to 36 V
Separate Input-Logic Supply
High-Noise-Immunity Inputs
Output Current 1 A Per
Channel
Peak Output Current 2 A Per
Channel
Can Drive 2 motors (servo or dc
motor ) at a time
Can Drive one stepper motor

Stepper motor
Astepper motoris a brushless DC

electricmotorthat divides a full rotation into a


number of equal steps. The motor'sposition
can then be commanded to move and hold at
one of these steps without any feedback
sensor, as long as themotoris carefully sized
to the application.

Circuit Schematic

Program
ORG 0H
MOV R1,#22H
MOV R2,#24H
MOV R3,#14H
MOV R4,#0CH
MOV R6,#21H
ORG 0030

;load R1,22H
;load R2,24H
;load R3,14H
;load R4,0CH
;load R6,21H

Program
START: MOV p2,R2
;Sent port2 from R2
ACALL DELAY2
MOV p1,R6
;Sent port1 from R6
ACALL COUNTD
MOV p2,R2
;Sent port2 from R2
MOV p1,R6
;Sent port1 from R6
ACALL COUNTD
MOV p2,#26H ;Sent port2 from 26H
MOV p1,R1
;Sent port1 from R1
ACALL DELAY2
MOV p2,R6
;Sent port2 from R6
MOV p1,R2
;Sent port1 from R2
ACALL COUNTD
MOV p2,R6
;Sent port2 from R6
MOV p1,R2
;Sent port1 from R2
ACALL COUNTD
MOV p2,R1
;Sent port2 from R1
MOV p1,#34H ;Sent port1 from 34H

Program
ACALL DELAY2
MOV p2,R2
MOV p1,R4

;Sent port2 from R2


;Sent port1 from R4

ACALL COUNTD
MOV p2,R2
;Sent port2 from R2
MOV p1,R4
;Sent port1 from R4
ACALL COUNTD
MOV p2,#34H ;Sent port2 from 34H
MOV p1,R3
;Sent port1 from R3
ACALL DELAY2
MOV p2,R4
;Sent port2 from R4
MOV p1,R2
;Sent port1 from R2
ACALL COUNTD

Program
MOV p2,R4
MOV p1,R2

;Sent port2 from R4


;Sent port1 from R2

ACALL COUNTD
MOV p2,R3
;Sent port2 from R3
MOV p1,#24H
;Sent port1 from 24H
ACALL DELAY2
MOV p2,#0E4h ;Sent port2 from E4H
MOV p1,#0E4h ;Sent port1 from E4H
ACALL COUNTD
MOV p2,R2
;Sent port2 from R2
MOV p1,#26H
;Sent port1 from 26H
ACALL DELAY2
LJMP START

Program
COUNTD: MOV p0,#67H ; 9
ACALL DELAY2
MOV p0,#7FH ; 8
ACALL DELAY2
MOV p0,#27H ; 7
ACALL DELAY2
MOV p0,#7DH ; 6
ACALL DELAY2
MOV p0,#6DH ; 5
ACALL DELAY2
MOV p0,#66H ; 4

ACALL DELAY2
MOV p0,#4FH ; 3
ACALL DELAY2
MOV p0,#5BH ; 2
ACALL DELAY2
MOV p0,#06H ; 1
ACALL DELAY2
MOV p0,#3fH ; 0
ACALL DELAY2
RET

Program
DELAY1: MOV R0,#0EFH
L3: MOV R5,#7DH
L2: MOV R7,#7DH
L1: NOP
NOP
DJNZ R7,L1
DJNZ R5,L2
DJNZ R0,L3
RET

DELAY2: MOV
R0,#7DH
;47
L6: MOV R5,#7DH
L5: MOV R7,#0FFH
L4:

DJNZ R7,L4
NOP
DJNZ R5,L5
DJNZ R0,L6
RET
END

Simulation

Reference
http://www.engineersgarage.com/electronic-c

omponents/at89c51-microcontroller-datasheet
https://www.ece.cmu.edu/~ece348/labs/docs
/SN74LS245.pdf
http://www.me.umn.edu/courses/me2011/ardui
no/technotes/dcmotors/L293/L293.html
UIUserver 2

Thanks
Any Question or Query ?

You might also like