You are on page 1of 17

A MINOR PROJECT ON

TRAFFIC LIGHT CONTROLLER


Based on AT89C51
Microcontroller

Presented By:
Ramkrishna Mishra (5910428)

HISTORY OF TRAFFIC LIGHT

The world's very first traffic lights were


invented by J P Knight installed near London's
House of Commons, which was on the
intersection of George and Bridge Street, in
1868.
In 1914 The American Traffic Signal Company
installed red and green traffic lights on every
corner of the intersection of 105th Street and
Euclid Avenue in Cleveland, Ohio.
First traffic lights were all controlled by either
timing, or manually switched

RED

Come to complete stop at stop line or before


crosswalk or intersection.
After stopping, you may turn right on red
at most intersections if the way is clear.
Some school districts have local policies that
prohibit right turns on red by bus operators.
Some intersections display NO TURN ON
RED, which you must obey.

YELLOW
Stop if you can do so safely.
The light will soon be red.

GREEN
Go, but only if intersection is clear.
If turning left, wait for gap in oncoming traffic to
complete turn.

Few things about AT89C51


It has four Ports:
Port 0
Port 1
Port 2
Port 3
These Four ports works as Input port as
well as output port.

ABSTRACT
The function of traffic lights is to provide
sophisticated control and coordination to
ensure that traffic moves as smoothly and
safely as possible.

FEATURES OF TRAFFIC LIGHT CONTROLLER

controller assumes equal traffic


density on all the roads.
The free left turn condition is
provided throughout the entire
signal period.
The control can also be
exercised manual when desired.

INTRODUCTION
This project uses a LED light as an indicator.
A microcontroller for auto change signal after a
specific time interval.
The LEDs are automatically on and off by
making the corresponding port pin of the micro
controller high.

COMPONENTS

AT89C51 Microcontroller
Capacitor (30pF x2,10F)
Resistor (8.2K)
Crystal oscillator (11.0592MHz)
LED light (Red, Green, Blue)
PCB
Power supply

BLOCK
DIAGRAM

CIRCUIT DIAGRAM

WORKING
The

pins of the various input output ports of

the
microcontroller are connected directly to the
given LEDs.
The 8051 is programmed in a manner that the
respective LEDs glow by setting the required
bit
using assembly language and a certain amount
of delay is provided depending on the user.

PROGRAM
#include<reg51.h>
sbit RE = P0^0;
sbit YE = P0^1;
sbit GE = P0^2;
sbit RW = P0^3;
sbit YW = P0^4;
sbit GW = P0^5;
sbit RN = P0^6;
sbit YN = P0^7;
sbit GN = P2^0;
sbit RS = P2^1;
sbit YS = P2^2;
sbit GS = P2^3;
void Delay(void)

{
unsigned int j;//,i;
////for(i=0;i<200;i++)
for(j=0;j<700;j++);
}
void SuperDelay()
{
unsigned int i;
for (i=0;i<25;i++);
Delay();
}
void main()
{
while (1)
{
RE=0; GE=1; YE=0;
RW=1; GW=0; YW=0;
RN=1; GN=0; YN=0;
RS=1; GS=0; YS=0;
SuperDelay();

GE=0; YE=1;
Delay();
RE=1; GE=0; YE=0;
RW=0; GW=1; YW=0;
RN=1; GN=0; YN=0;
RS=1; GS=0; YS=0;
SuperDelay();
GW=0; YW=1;
Delay();
RE=1; GE=0; YE=0;
RW=1; GW=0; YW=0;
RN=0; GN=1; YN=0;
RS=1; GS=0; YS=0;
SuperDelay();
GN=0; YN=1;
Delay();
RE=1; GE=0; YE=0;
RW=1; GW=0; YW=0;
RN=1; GN=0; YN=0;
RS=0; GS=1; YS=0;
SuperDelay();
GS=0; YS=1;
Delay();
}
}

MOTIVATIO
N

The project finds high practical


and widespread use.
It is a very primitive application
of the microcontroller.
Easy and convenient to be built
for a beginner as the coding
comprises of basic instructions.

SCOP
This project can be enhanced in
E
such a way as to control
automatically the signals
depending on the traffic density
on the roads using sensors like
IR detector/receiver module
extended with automatic turn
off when no vehicles are running
on any side of the road which
helps in power consumption

Thank
you

You might also like