Traffic light controller

17
A MINOR PROJECT ON TRAFFIC LIGHT CONTROLLER Based on AT89C51 Microcontroller Presented By: Ramkrishna Mishra (5910428)

description

A minor project report on Traffic Light Controller using 8051(AT89C51) micro controller.

Transcript of Traffic light controller

Page 1: Traffic light controller

A MINOR PROJECT ONTRAFFIC LIGHT CONTROLLER

Based on AT89C51 Microcontroller

Presented By:Ramkrishna Mishra (5910428)

Page 2: Traffic light controller

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

Page 3: Traffic light controller

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.

Page 4: Traffic light controller

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.

Page 5: Traffic light controller

Few things about AT89C51

It has four Ports:Port 0Port 1Port 2Port 3

These Four ports works as Input port as well as output port.

Page 6: Traffic light controller

ABSTRACT

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

Page 7: Traffic light controller

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.

Page 8: Traffic light controller

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.

Page 9: Traffic light controller

COMPONENTS

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

Page 10: Traffic light controller

BLOCK DIAGRAM

Page 11: Traffic light controller

CIRCUIT DIAGRAM

Page 12: Traffic light controller

WORKINGThe 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.

Page 13: Traffic light controller

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)

Page 14: Traffic light controller

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();

Page 15: Traffic light controller

MOTIVATION

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.

Page 16: Traffic light controller

SCOPE This project can be enhanced in

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 saving.

Page 17: Traffic light controller