Traffic light control

The project supports the development of reliable and optimal control structures for urban traffic.The intelligent and cooperative set-up of actuation and its linkage to the central control system is vital for avoiding traffic jams and accidents.four traffic signal is installed across the road as shown in figure.code is designed with the help of at89c51 controller controlling the timimg of signal so as to manage traffic effectively.

Typically traffic lights consist of a set of three colored lights: red, orange and green. In a typical cycle,
·       green light allows traffic to proceed in the direction denoted,
·       orange light denoting, if safe to do so, prepare to stop 
·       red signal prohibits any traffic from proceeding.

PROTEUS DESIGN

CODE

#include<reg51.h>
void delay(unsigned int);
sbit G2 = P1^1;                        
sbit Y2 = P1^2;                        
sbit R2 = P1^3; 
sbit G1 = P2^4;                
sbit Y1 = P2^5;                       
sbit R1 = P2^6;                                    
sbit Y3 = P2^2;                        
sbit R3 = P2^3;                          
sbit G3 = P2^1;                    
sbit G4 = P3^1;                       
sbit Y4 = P3^2;                        
sbit R4 = P3^3;                        
void main(void)
{
while(1)
{
G1 = 0;           
Y1 = 1;        
R1 = 1;            
G2 = 1;        
Y2 = 1;           
R2 = 0;         
G3 = 1;         
Y3 = 1;            
R3 = 0;            
G4 = 1;            
Y4 = 1;            
R4 = 0;           
delay(500);            
G1 = 1;
Y1 = 0;
R1 = 1;
G2 = 1;
Y2 = 0;
R2 = 1;
G3 = 1;
Y3 = 1;
R3 = 0;
G4 = 1;
Y4 = 1;
R4 = 0;
delay(500); 
G1 = 1;
Y1 = 1;
R1 = 0;
G2 = 0;
Y2 = 1;
R2 = 1;
G3 = 1;
Y3 = 1;
R3 = 0;
G4 = 1;
Y4 = 1;
R4 = 0;
delay(500); 
G1 = 1;
Y1 = 1;
R1 = 0;
G2 = 1;
Y2 = 0;
R2 = 1;
G3 = 1;
Y3 = 0;
R3 = 1;
G4 = 1;
Y4 = 1;
R4 = 0;
delay(500); 
G1 = 1;
Y1 = 1;
R1 = 0;
G2 = 1;
Y2 = 1;
R2 = 0;
G3 = 0;
Y3 = 1;
R3 = 1;
G4 = 1;
Y4 = 1;
R4 = 0;
delay(500); 
G1 = 1;
Y1 = 1;
R1 = 0;
G2 = 1;
Y2 = 1;
R2 = 0;
G3 = 1;
Y3 = 0;
R3 = 1;
G4 = 1;
Y4 = 0;
R4 = 1;
delay(500); 
G1 = 1;
Y1 = 1;
R1 = 0;
G2 = 1;
Y2 = 1;
R2 = 0;
G3 = 1;
Y3 = 1;
R3 = 0;
G4 = 0;
Y4 = 1;
R4 = 1;
delay(500); 
G1 = 1;
Y1 = 0;
R1 = 1;
G2 = 1;
Y2 = 1;
R2 = 0;
G3 = 1;
Y3 = 1;
R3 = 0;
G4 = 1;
Y4 = 0;
R4 = 1;
delay(500); 
}
}
void delay(unsigned int x)
{
    int i,j;
    for(i=0;i<x;i++)
    for(j=0;j<1000;j++);
}

VIDEO


Category: 

tags: 

Share

Comments

Hi,I am planning to do this project using AT89c51. I have generated the hex file using Keil. But when I try to simulate the program in Proteus 8 professional, I get some errors as shown below1. Cannot find model file 'ITFMOD.MDF'2. Missing interface model 'AT89' in U1 #PPlease help with fixing this errors or provide any alternate approach.  Thanks,Sanju

Who's new

  • ravirajpatil871...
  • shubhambajoria
  • yassir
  • demiholyman890954
  • scottgillum51169040

Get Notified

 

Share

We are Social

Syndicate

Subscribe to Syndicate