You are currently viewing How to Interface Traffic Light with 8051 Development Board

How to Interface Traffic Light with 8051 Development Board

Spread the love

This blog post summarize how to interface Traffic Light with 8051 Development Board

The 8051 Development board is specifically designed to help students to master the required skills in the area of embedded systems. The kit is designed in such way that all the possible features of the microcontroller will be easily used by the students. The kit supports in system programming (ISP) which is done through serial port.

NXP’s 8051 AT89V51RD2), 8051 Development Kit is proposed to smooth the progress of developing and debugging of various designs encompassing of speed 8-bit Microcontrollers.

Traffic Light Control

Traffic lights, which may also be known as stoplights, traffic lamps, traffic signals, signal lights, robots or semaphore, are signaling devices positioned at road intersections, pedestrian crossings and other locations to control competing flows of traffic.

About the colors of Traffic Light Control

Traffic lights alternate the right of way of road users by displaying lights of a standard color (red, yellow/amber, and green), using a universal color code (and a precise sequence to enable comprehension by those who are color blind).

In the typical sequence of colored lights:

☞Illumination of the green light allows traffic to proceed in the direction denoted,

☞Illumination of the yellow/amber light denoting, if safe to do so, prepare to stop short of the intersection, and

☞Illumination of the red signal prohibits any traffic from proceeding.

Usually, the red light contains some orange in its hue, and the green light contains some blue, for the benefit of people with red-green color blindness, and “green” lights in many areas are in fact blue lenses on a yellow light (which together appear green).

Interfacing Traffic Light with 8051

The Traffic light controller section consists of 12 Nos. point LEDS are arranged by 4Lanes in 8051 Development Board. Each lane has Go (Green), Listen (Yellow) and Stop (Red) LED is being placed.

Pin Assignment with 8051

Circuit Diagram to Interface Traffic Light with 8051

Source Code

The Interfacing Traffic Light Control with 8051 program is very simple and straight forward, which controls Traffic Light in certain time period. The C program is written in Keil software.

C Program to Traffic Light using 8051


***************************************************************************************

Title : Program to read traffic light controller


***************************************************************************************

#include 

sbit RA = P1^0;

sbit YA = P1^1;

sbit GA = P1^2;

sbit RB = P3^2;

sbit YB = P3^3;

sbit GB = P3^4;

sbit RC = P3^5;

sbit YC = P3^6;

sbit GC = P3^7;

 sbit rD = P1^3;

sbit YD = P1^4;

sbit GD = P1^5;

void Delay (void)

{

unsigned int i,j;

for (i=0;i<200;i++)

for (j=0;j<500;j++);

}

void SuperDelay()

{

unsigned int i;

for (i=0;i<25;i++)

Delay();

}

void main ()

{

P3 = 0;while (1)

{

RA = 0;

GA = 1;

YA = 0;

RB = 1;

GB = 0;

YB = 0;

RC = 1;

GC = 0;

YC = 0;

rD = 1;

GD = 0;

YD = 0;

SuperDelay();

GA = 0;

YA = 1;

Delay();

RA = 1;

GA = 0;

YA = 0;

RB = 0;

GB = 1;

YB = 0;

RC = 1;

GC = 0;

YC= 0;

rD = 1;

GD = 0;

YD = 0;

SuperDelay ();

GB = 0;

YB = 1;

Delay ();

RA = 1;

GA = 0;

YA = 0;

RB = 1;

GB = 0;

YB = 0;

RC = 0;

GC = 1;

YC = 0;

rD = 1;

GD = 0;

YD = 0;

SuperDelay ();

 GC = 0;

YC = 0;

rD = 0;

GD = 1;

YD = 0;

SuperDelay ();

GD = 0;

YD = 1;

Delay();

}

}

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.