Traffic Signal Controller with Night Mode

The basic concept of this is project is how to stop traffic signals in night time automatically and only flash YELLOW signal only.
This is the AT89C51 microcontroller based simple traffic signal controller project of the basic traffic signal understanding concept and working details. Here iam using simple C program and very few electronic components.
LIST OF COMPONENTS:
1. 8 Bit AT89C51 IC =1.
2. Seven segment display (Common Cathode)=1.
3. LEDs RED,YELLOW and GREEM (Each =1)
4. Resistor 100 ohms =  nos.
5. Crystal 12 Mhz = 1.
6. Capacitor 10 Mfd =1.
7. Capacitor (disc) 33pf =2.
8. LDR =1.
9. IC 741 =1.
A seven segment display used as counter for STOP, GET READY and GO mode and time in seconds with 5,3,9, connected with in PORT2. if you want 2 seven segment use another PORT to MCU.
7-segment-androiderodein this circuit common cathode was used to display single digit and it display form 0 to 9 only.
The seven segment pin details are given blow with simple circuit.
This simple circuit is tested with PROTEUS software.
The LEDs RED, YELLOW and GREEN are connected in PORT3.
traffic
C PROGRAM
Program developed with C Language and compiled with KEIL software.
// Simple traffic control using AT89C52//
#include<reg51.h>
#include<stdio.h>
sbit red = P3^0;
sbit yellow = P3^1;
sbit green = P3^2;
sbit night = P1^0;
void delay (unsigned int time)
{
int x,y;
for(x=0;x<time;x++)
for(y=0;y<2000;y++);
}
void main()
{
P1=0xff;
P2=0x00;
P3=0x00;
red,yellow,green=0;
if (night==1)
{
red =0; // RED for STOP
yellow=1;
green=1;
P2=0x6d;
delay(100);
P2=0x66;
delay(100);
P2=0x4f;
delay(100);
P2=0x5b;
delay(100);
P2=0x06;
delay(100);
P2=0x3f;
delay(100);
red=1; // yellow for GET READY
yellow=0;
green=1;
P2=0x4f;
delay(100);
P2=0x5b;
delay(100);
P2=0x06;
delay(100);
P2=0x3f;
delay(100);
red=1; // GREEN for GO
yellow=1;
green=0;
P2=0xe7;
delay(100);
P2=0xff;
delay(100);
P2=0x07;
delay(100);
P2=0x7c;
delay(100);
P2=0x6d;
delay(100);
P2=0x66;
delay(100);
P2=0x4f;
delay(100);
P2=0x5b;
delay(100);
P2=0x06;
delay(100);
P2=0x3f;
delay(100);
}
if (night==0) // For mode only yellow light flash.
{
red=1;
yellow=0;
green=1;
delay(100);
red=1;
yellow=1;
green=1;
delay(100);
}
}

Subramanian
Subramanian

Subramanian MK, currently serving as a workshop instructor at Sakthi Polytechnic College, Erode Tamil Nadu. With a career spanning 25 + years, Subramanian MK has dedicated himself to advancing knowledge in Electronics and Communication Engineering (ECE). His passion for exploring new technologies has led to the development of numerous projects, showcasing expertise in IoT and PCB design.

Articles: 508

Leave a Reply

Your email address will not be published. Required fields are marked *

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

×

Hi, How can I help you?

×