Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

Project Name :

4 way traffic signal system


Group Members : Name Registration No.

Kashif Hussain FA18-CSE-075

Tasbeel Ahmed FA18-CSE-023


Hussan Khan FA18-CSE-047
Zeeshan Mushtaq FA18-CSE-055
Implementation Tool: Proteous ,Keil

Language C++

Name of Platform for Window + Hardware Base


Implementation
ABSTRACT
This work has been aimed at efficient means of controlling the traffic effectively for twenty-
four hours. As the world is growing technologically more and more vehicles jump into the
public road adding to the already existing number. Consequently: more efficient way of
controlling the traffics becomes more desirable as compared to the obsolete way of using the
traffic personnel's. The design of this traffic light control IS grouped basically into three;
digital logic design: the power circuit and the power supply design. The digital logic design IS
based on integrated circuits which happens to be the modern way of designing digital systems.

INTRODUCTION
The interesting thing about our project is 4 way traffic signal system. In the ever fast-growing
world of business and technology today. There has become an increasing column of vehicles
on every road in different place of the world_ Traffic control light has become a very effective
tool for sequential control of the teaming number of vehicles on the road to avert what would
have been a recurrent saga of ghastly accidents at the junctions. There have been many ways
of achieving this: uppermost among these being the employment of electronic monitoring
circuits that which is controlled by presto clock.
In developed countries: the employment of traffic personnel’s •who would be jumped up and
down at the centers of the junction just for the motorists to acknowledge their rigorous signs
has long come of age. In developing countries where 24 hours traffic flow is Involved: many
societies are adopting the usage of the traffic light control_ The advantage offered by this
method of traffic control cannot be over emphasized. For one: it offers a more advanced
technology that IS less prone to miscalculation and its regrettable occurrence. They stand out
better at night: then offer illumination to the Immediate surroundings which become important
for security purpose and m general add to there entire aesthetic beauty of night life.
The technology behind the design may vary from place to place: but the fact remains that in all
cases an electronic (logic) circuit is made to control a power circuit. The electronic logic circuit
is normally composed of the basic digital components of electronic design •which includes
oscillators.

`
AIM OF THE PROJECT
Going by the rapid advancement in technology all over the world: the need for better ways of
solvmg a problem keep cornmg up every day. Necessity is the mother of Invention_ It has
become Imperative for societies: companies: industries: business ventures: clubs etc to offer
24 hour service: hence thereby has to be a way of controllmg the teaming column of vehicles
which convey both individuals and goods to different destmatlons of that type. The most
elegant way of directing the motorists IS by the use of tramc light control. This type of control
serves a dual
purpose. In the day type it directs the vehicles: whereas it turns out to additionally illuminating
the environment in the night: so that at very far distance: its effect is noticeably felt: conveying
Its message to an oncommg vehicle very far from the pomt_
The project is therefore aimed at building a prototype four-way traffic light control circuitry.

SIGNIFICANCE OF THE PROJECT


The project design work signifies a lot in modern industrial electronics. This design that
replaced the manually used agent which is the traffic warden positioned at different tram
junctions. In most developed towns Nigeria: this system is employed at every T-junction: so
that traffic jam or hold up will be highly controlled and also accidents at this junction are
highly minimized_ In advance countries. Signals offer maximum control at intersections. They
relay messages of both what to do and what not to do. The primary function of any traffic signal
is to assign right-of-way to conflicting movements of traffic at an intersection_ This is done by
permitting conflicting streams of traffic to share the same Intersection by means of time
separation. By alternately assigning right of way to various traffic movements: signals provide
for the
orderly movement of conflicting flows_ They may interrupt extremely heavy flows to permit
the crossing of minor movements that could not otherwise move safely through an intersection.
Xoen properly timed: a traffic Signal increases the traffic handling capacity of an intersection:
and when installed under conditions that justify its use: a signal IS a valuable device for
Improving the safety and efficiency of both pedestrian and vehicular traffic. In particular:
signals may reduce certain types of accidents: most notably: right-angle (broadside) collisions.
SCOPE OF THE PROJECT
The entire system xvas built using an electronic circuit using digital components and a few
linear components such that a digital output is raised to control the traffic at cross (+) junction
using lamps rather light emitting diodes LEDS. At the input IS an stable multivibrator This
traffic light is made with the help of counter IC: which is mainly used for Sequential Circuits_
We can also call
It as Sequential Traffic Lights_ Sequential Circuits are used to count the numbers in series.

4 Way Traffic Signal System Circuit Principle:


The main heart of this traffic system is microcontroller Traffic lights are connected to ports of
microcontroller. After making program in c system generate the hex file .By using proteous
we make a circuit and burn hex file in microcontroller and If there is a traffic on road then that
particular sensor output becomes logic 0 otherwise logic 1.We have to write the program to
control the traffic system.
If you receive logic 0 from any of these sensors, we have to give the green signal to that
particular path and give red signal to all other paths. continuously we have to monitor check
for the traffic.
Circuit Components:
 AT89C51 Microcontroller
 PCB board
 LED’s-12(4-red,4-green,4-yellow)
 12v Battery or adaptor
 Serial cable
 Crystal
 Connecting wires
 Ardeno circuit
Four Way Traffic Signal System Circuit Diagram:
Circuit Diagram

Circuit Diagram
Circuit Daigram

How to Operate Traffic Signal System Circuit?

 Connect 12V battery or adaptor to the development board.


 Switch on the supply.
 Burn the program to the microcontroller by keeping the program mode.
 Connect trafic lights to mc.
 Connect LEDs to PORT 1 and PORT 2.
 Arrange all this lights same as like traffic lights.
 Arrange one IR sensor for each road.
 Now you can see the normal traffic system based on time basis.
 traffic of that particular path by glowing GREEN light.
 Finally, turn off the board power supply.
 For ardeno we use ardeno app and make code in c and burn the code in mc through the
app.
Keil Code For Microcontroller
Source Code:
#include<reg51.h> // calling the header file
sbit red1=P1^2; //variable Declaration we are now defining 12 bits of port P1
and P2
sbit yellow1=P1^1; // for the purpose of accessing each LED of four ways namely red
yellow
sbit green1= P1^0; // and green.
sbit red2=P1^3;
sbit yellow2=P1^4;
sbit green2= P1^5;
sbit red3=P2^0;
sbit yellow3=P2^1;
sbit green3= P2^2;
sbit red4=P2^3;
sbit yellow4=P2^4;
sbit green4= P2^5;

void main(void)
{

unsigned int i; // declare an integer i and put the value to zero


red1=yellow1=green1=0; // initially put all variable values to zero
red2=yellow2=green2=0;
red3=yellow3=green3=0;
red4=yellow4=green4=0;
while(1) // for infinite loop or continuous operation

{
red1=1; //Initially we start with IVth signal put red light as 1 for remaining
three directions
red2=1;
red3=1;
green4=1; //put the value of green light of traffic signal four as 1
yellow4=0;
red4=0;
{
for(i=0;i<=60000;i++); // the loop will executed for 60000 times to generate delay.
for(i=0;i<=60000;i++); // repeat the loop because we can not go beyond 65536
by defining unsigned int
}
green4=0; //now put green4 as 0
yellow4=1; // yellow4 willbe now 1
{
for(i=0;i<=40000;i++); //put value of red4 as 1
for(i=0;i<=40000;i++); // Delay of 40000 is created
}
yellow4=0; // now put value of yellow 4 as 0
red4=1; // now put value of red4 as 1
red3=0; // put value of red3 as 0
green3=1;
{
for(i=0;i<=60000;i++); // Delay of 60000 is created
for(i=0;i<=60000;i++); // Delay of 60000 is created
}
green3=0; // put green3 OFF
yellow3=1; //Yellow 3 ON
{
for(i=0;i<=40000;i++); // Delay of 40000 is created
for(i=0;i<=40000;i++);
}
yellow3=0; // put yellow 3 OFF
red3=1;
red1=0; // put red 3 On
green1=1; // put green1 ON
{
for(i=0;i<=60000;i++); // Delay of 60000 is created
for(i=0;i<=60000;i++);
}
green1=0; //put green 1 OFF
yellow1=1; // put yellow 1 ON
{
for(i=0;i<=40000;i++);
for(i=0;i<=40000;i++); //Delay of 40000 is created
}
yellow1=0; // PUT Yellow1 OFF, red 1 ON, Red 2 OFF, Green 2
ON
red1=1;
red2=0;
green2=1;
{
for(i=0;i<=60000;i++); //Delay of 60000 is created
for(i=0;i<=60000;i++);
}
green2=0; //put green 2 OFF Yellow 2 ON
yellow2=1;
{
for(i=0;i<=40000;i++); // Delay of 40000 is created
for(i=0;i<=40000;i++);
}
yellow2=0; // put yellow2 OFF red2 ON
red2=1;

}
}
Ardeno Code
Source Code:
int Lane1[] = {13,12,11}; // Lane 1 Red, Yellow and Green
int Lane2[] = {10,9,8};// Lane 2 Red, Yellow and Green
int Lane3[] = {7,6,5};// Lane 3 Red, Yellow and Green
int Lane4[] = {4,3,2};// Lane 4 Red, Yellow and Green

void setup()
{
for (int i = 0; i < 3; i++)
{
pinMode(Lane1[i], OUTPUT);
pinMode(Lane2[i], OUTPUT);
pinMode(Lane3[i], OUTPUT);
pinMode(Lane4[i], OUTPUT);
}
for (int i = 0; i < 3; i++)
{
digitalWrite(Lane1[i], LOW);
digitalWrite(Lane2[i], LOW);
digitalWrite(Lane3[i], LOW);
digitalWrite(Lane4[i], LOW);
}

void loop()
{
digitalWrite(Lane1[2], HIGH);
digitalWrite(Lane3[0], HIGH);
digitalWrite(Lane4[0], HIGH);
digitalWrite(Lane2[0], HIGH);
delay(7000);
digitalWrite(Lane1[2], LOW);
digitalWrite(Lane3[0], LOW);
digitalWrite(Lane1[1], HIGH);
digitalWrite(Lane3[1], HIGH);
delay(3000);
digitalWrite(Lane1[1], LOW);
digitalWrite(Lane3[1], LOW);
digitalWrite(Lane1[0], HIGH);
digitalWrite(Lane3[2], HIGH);
delay(7000);
digitalWrite(Lane3[2], LOW);
digitalWrite(Lane4[0], LOW);
digitalWrite(Lane3[1], HIGH);
digitalWrite(Lane4[1], HIGH);
delay(3000);
digitalWrite(Lane3[1], LOW);
digitalWrite(Lane4[1], LOW);
digitalWrite(Lane3[0], HIGH);
digitalWrite(Lane4[2], HIGH);
delay(7000);
digitalWrite(Lane4[2], LOW);
digitalWrite(Lane2[0], LOW);
digitalWrite(Lane4[1], HIGH);
digitalWrite(Lane2[1], HIGH);
delay(3000);
digitalWrite(Lane4[1], LOW);
digitalWrite(Lane2[1], LOW);
digitalWrite(Lane4[0], HIGH);
digitalWrite(Lane2[2], HIGH);
delay(7000);
digitalWrite(Lane1[0], LOW);
digitalWrite(Lane2[2], LOW);
digitalWrite(Lane1[1], HIGH);
digitalWrite(Lane2[1], HIGH);
delay(3000);
digitalWrite(Lane2[1], LOW);
digitalWrite(Lane1[1], LOW);
}

The End

You might also like