TRAFFIC LIGHT CONTROLLER · LED light (Red, ... The 8051 is programmed in a manner that the...

16
TRAF F IC L I GHT CONTROLLER

Transcript of TRAFFIC LIGHT CONTROLLER · LED light (Red, ... The 8051 is programmed in a manner that the...

Page 1: TRAFFIC LIGHT CONTROLLER · LED light (Red, ... The 8051 is programmed in a manner that the respective LEDs glow by setting the required bit using assembly language and a certain

TRAFFIC LIGHT CONTROLLER

Page 2: TRAFFIC LIGHT CONTROLLER · LED light (Red, ... The 8051 is programmed in a manner that the respective LEDs glow by setting the required bit using assembly language and a certain

HISTORY OF TRAFFIC LIGHT

The world's very first traffic light were invented by JP Knight installed near London's House of Commons,which was on the intersection of George and BridgeStreet, in 1868.

In 1914 The American Traffic Signal Companyinstalled red and green traffic lights on every cornerof the intersection of 105th Street and Euclid Avenuein Cleveland, Ohio.

First traffic lights were all controlled by either timing,or manually switched

M.Bhagavathi Priya/AP/ECE-SNSCE-Traffic Light Controller 2

Page 3: TRAFFIC LIGHT CONTROLLER · LED light (Red, ... The 8051 is programmed in a manner that the respective LEDs glow by setting the required bit using assembly language and a certain

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.

M.Bhagavathi Priya/AP/ECE-SNSCE-Traffic Light Controller 3

Page 4: TRAFFIC LIGHT CONTROLLER · LED light (Red, ... The 8051 is programmed in a manner that the respective LEDs glow by setting the required bit using assembly language and a certain

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.

M.Bhagavathi Priya/AP/ECE-SNSCE-Traffic Light Controller 4

Page 5: TRAFFIC LIGHT CONTROLLER · LED light (Red, ... The 8051 is programmed in a manner that the respective LEDs glow by setting the required bit using assembly language and a certain

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.

M.Bhagavathi Priya/AP/ECE-SNSCE-Traffic Light Controller 5

Page 6: TRAFFIC LIGHT CONTROLLER · LED light (Red, ... The 8051 is programmed in a manner that the respective LEDs glow by setting the required bit using assembly language and a certain

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.

M.Bhagavathi Priya/AP/ECE-SNSCE-Traffic Light Controller 6

Page 7: TRAFFIC LIGHT CONTROLLER · LED light (Red, ... The 8051 is programmed in a manner that the respective LEDs glow by setting the required bit using assembly language and a certain

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.

M.Bhagavathi Priya/AP/ECE-SNSCE-Traffic Light Controller 7

Page 8: TRAFFIC LIGHT CONTROLLER · LED light (Red, ... The 8051 is programmed in a manner that the respective LEDs glow by setting the required bit using assembly language and a certain

COMPONENTSAT89C51 Microcontroller

Capacitor (30pFx2,10µF)

Resistor (8.2KΩ)

Crystal oscillator (11.0592MHz)

LED light (Red, Green, Blue)

PCB

Power supplyM.Bhagavathi Priya/AP/ECE-SNSCE-Traffic Light Controller 8

Page 9: TRAFFIC LIGHT CONTROLLER · LED light (Red, ... The 8051 is programmed in a manner that the respective LEDs glow by setting the required bit using assembly language and a certain

BLOCK DIAGRAM

M.Bhagavathi Priya/AP/ECE-SNSCE-Traffic Light Controller 9

Page 10: TRAFFIC LIGHT CONTROLLER · LED light (Red, ... The 8051 is programmed in a manner that the respective LEDs glow by setting the required bit using assembly language and a certain

CIRCUIT DIAGRAM

M.Bhagavathi Priya/AP/ECE-SNSCE-Traffic Light Controller 10

Page 11: TRAFFIC LIGHT CONTROLLER · LED light (Red, ... The 8051 is programmed in a manner that the respective LEDs glow by setting the required bit using assembly language and a certain

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.

M.Bhagavathi Priya/AP/ECE-SNSCE-Traffic Light Controller 11

Page 12: TRAFFIC LIGHT CONTROLLER · LED light (Red, ... The 8051 is programmed in a manner that the respective LEDs glow by setting the required bit using assembly language and a certain

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)

M.Bhagavathi Priya/AP/ECE-SNSCE-Traffic Light Controller 12

Page 13: TRAFFIC LIGHT CONTROLLER · LED light (Red, ... The 8051 is programmed in a manner that the respective LEDs glow by setting the required bit using assembly language and a certain

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

M.Bhagavathi Priya/AP/ECE-SNSCE-Traffic Light Controller 13

Page 14: TRAFFIC LIGHT CONTROLLER · LED light (Red, ... The 8051 is programmed in a manner that the respective LEDs glow by setting the required bit using assembly language and a certain

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.

M.Bhagavathi Priya/AP/ECE-SNSCE-Traffic Light Controller 14

Page 15: TRAFFIC LIGHT CONTROLLER · LED light (Red, ... The 8051 is programmed in a manner that the respective LEDs glow by setting the required bit using assembly language and a certain

SCOP EThis 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.M.Bhagavathi Priya/AP/ECE-SNSCE-Traffic Light Controller 15

Page 16: TRAFFIC LIGHT CONTROLLER · LED light (Red, ... The 8051 is programmed in a manner that the respective LEDs glow by setting the required bit using assembly language and a certain

M.Bhagavathi Priya/AP/ECE-SNSCE-Traffic Light Controller 16