Professional Documents
Culture Documents
Based On AT89C51 Microcontroller: A Minor Project On Traffic Light Controller
Based On AT89C51 Microcontroller: A Minor Project On Traffic Light Controller
Presented By:
Ramkrishna Mishra (5910428)
RED
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.
ABSTRACT
The function of traffic lights is to provide
sophisticated control and coordination to
ensure that traffic moves as smoothly and
safely as possible.
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
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
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