A Mini Project Report On

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 18

A MINI PROJECT REPORT ON

Density Based Traffic Signal

BACHELOR OF TECHNOLOGY

ELECTRICAL ENGINEERING

Submitted by:

NEERAJ SETH (18339)

MOHD. SHOEB (18334)

MANVENDRA SINGH (18333)

SWATI VERMA (18356)

RUPAM KUMAR SINGH (18346)

Under the guidance of

(Mr.Dhananjai Singh)
ELECTRICAL ENGINEERING DEPARTMENT

KAMLA NEHRU INSTITUTE OF TECHNOLOGY

SULTANPUR (UP) 228118


DECLARTION
This Is to declare to following students neeraj seth, mohd. Shoeb,manvendra singh, swati
verma and rupam kumar singh of B.tech 2nd year in electrical engineering department own the
full responsibility for the information result etc. provided in this mini project titled DENSITY
BASED TRAFFIC SIGNAL submitted to KNIT SULTANPUR. It is also declared that the
project has not been directly purchased for any source. Further the material (data,theoretical
analysis,text,etc) used from other sources has been properly given credit giving their details in
the references.

NEERAJ SETH 18339

MOHD.SHOEB 18334

MANVENDRA SINGH 18333

SWATI VERMA 18356

RUPAM KUMAR SINGH 18346


ACKNOWLEDGEMENT
We Would like to express my special thanks to my teacher (DHANANJAI SINGH ) as well as
our HOD (RP PAYASI SIR) who gave me the golden opportunity to do this wonderfull project
on the topic (DENSITY BASED TRAFFIC SIGNAL), which also helped me in doing a lot of
Research and I came to know about so many new things I am really thankful to them.

Secondly I would also like to thank my parents and group members who helped me a lot in
finalizing this project within the limited time frame.

GROUP MEMBERS ARE :-

NEERAJ SETH 18339

MOHD.SHOEB 18334

MANVENDRA SINGH 18333

SWATI VERMA 18356

RUPAM KUMAR SINGH 18346


Table of content

1. Introduction
1.1 Meaning of project title
1.2 History and necessity
1.3 Motivation
2. Definetion of problem

2.1 Solution

3. Project setup
3.1. Aim
3.2. Requirements
3.3. Theory
3.4. Procedure
3.5. Working
3.6. Arduino Code
3.7. Result
4. Application and timeline
5. Reference/ bibliography
CHAPTER – 1

INTRODUCTION

1.1 Project title meaning

Density based traffic signal is a device which control the traffic according to the density of
vehicles on each side of the road.

1.2 History and necessity

The world's first traffic light was a manually operated gas-lit signal installed in London in
December 1868. It exploded less than a month after it was implemented, injuring its policeman
operator.

Countdown timers on traffic lights were introduced in the 1990s. Timers are useful for
pedestrians, to plan whether there is enough time to cross the intersection before the end of the
walk phase, and for drivers, to know the amount of time before the light switches.

Need of density based traffic signal

Nowadays, controlling the traffic becomes major issue because of rapid increase in automobiles
and also because of large time delays between traffic lights. So, in order to rectify this problem,
we will go for density based traffic lights system.
One of the major problems faced in any metro city is traffic congestion. Getting stranded in
between heavy traffic is a headache for each and every person driving the vehicle and even to the
traffic police in controlling the traffic.

1.3 Motivation

At the present time, the traffic control system becomes the main issue because of the fast
increase in automobiles and also due to large time delays between traffic lights. So, in order to
overcome this problem, we will go for density based traffic light timing control system. This
project discusses how to control the traffic based on density.The proposed system uses IR
sensors to calculate the traffic density.

2. Definetion Of Problem
The problem with the traffic system is that for every minute the vehicles at the four way road
will be heavy and the traffic lights shall be changed to each side for some fixed time. Even
though there are no vehicles at particular side the traffic signal will glow for given fixed time.
Due to that there is time waste process. Due to this other side vehicles have to wait for the time
to complete the process .So to reduce the wastes of the time we can implement the system that
control the traffic based on heavy flow of vehicles at any particular side.

2.1 Solution

We have to place one IR sensor on every road; where the sensor always senses the traffic on
that specific road. All these sensors are interfaced to the Arduino . Based on the sensors,
Arduino detects the traffic and controls the traffic system.
3. Project Setup
3.1 Aim

To Make The Density Based Traffic Signals.

3.2 Requirement

 Arduino Mega 2560


 4 X HC-SR04 ultrasonic sensors
 4 X Red LEDs
 4 X Green LEDs
 4 X Yellow LEDs
 12 X 220 ohm resistors
 Jumper cables
 Breadboards

3.3 Theory

Arduino is the main part of this project and it will be used to read from ultrasonic sensor HC -
SR04 and calculate the distance. This distance will tell us if any vehicle is near the signal or
not and according to that the traffic signals will be controlled.

The main task was to avoid use of delay because we have to continuously read from the
ultrasonic sensors and also at the same time, we have to control signals which requires the
use of delay function.

3.4 Procedure

Connect three IR sensors on each road. Connect LEDs to the digital pins of the Arduino.
Arrange all the LED's same as traffic lights. particular path by glowing GREEN light.
3.5 Working

The working of the project is divided into three steps

 If there is traffic at all the signals, then the system will work normally by controlling the
signals one by one.
 If there is no traffic near a signal, then the system will skip this signal and will move on to the
next one. For example, if there is no vehicle at signal 2, 3 and currently the system is allowing
vehicles at signal 1 to pass. Then after signal 1, the system will move on to signal 4 skipping
signal 2 and 3.
 If there is no traffic at all the 4 signals, system will stop at the current signal and will only
move on the next signal if there will be traffic at any other signal.
3.6 Arduino code

#include<TimerOne.h>

int signal1[] = {23, 25, 27};


int signal2[] = {46, 48, 50};
int signal3[] = {13, 12, 11};
int signal4[] = {10, 9, 8};
int redDelay = 5000;
int yellowDelay = 2000;

volatile int triggerpin1 = 31;


volatile int echopin1 = 29;
volatile int triggerpin2 = 44;
volatile int echopin2 = 42;
volatile int triggerpin3 = 7;
volatile int echopin3 = 6;
volatile int triggerpin4 = 5;
volatile int echopin4 = 4;

volatile long time; // Variable for storing the time traveled


volatile int S1, S2, S3, S4; // Variables for storing the distance covered

int t = 5; // distance under which it will look for vehicles.

void setup(){
Serial.begin(115200);
Timer1.initialize(100000); //Begin using the timer. This function must be called first.
"microseconds" is the period of time the timer takes.
Timer1.attachInterrupt(softInterr); //Run a function each time the timer period finishes.

// Declaring LED pins as output


for(int i=0; i<3; i++){
pinMode(signal1[i], OUTPUT);
pinMode(signal2[i], OUTPUT);
pinMode(signal3[i], OUTPUT);
pinMode(signal4[i], OUTPUT);
}

// Declaring ultrasonic sensor pins as output


pinMode(triggerpin1, OUTPUT);
pinMode(echopin1, INPUT);
pinMode(triggerpin2, OUTPUT);
pinMode(echopin2, INPUT);
pinMode(triggerpin3, OUTPUT);
pinMode(echopin3, INPUT);
pinMode(triggerpin4, OUTPUT);
pinMode(echopin4, INPUT);
}

void loop()
{
// If there are vehicles at signal 1
if(S1<t)
{
signal1Function();
}

// If there are vehicles at signal 2


if(S2<t)
{
signal2Function();
}

// If there are vehicles at signal 3


if(S3<t)
{
signal3Function();
}

// If there are vehicles at signal 4


if(S4<t)
{
signal4Function();
}
}

// This is interrupt function and it will run each time the timer period finishes. The timer
period is set at 100 milli seconds.
void softInterr()
{
// Reading from first ultrasonic sensor
digitalWrite(triggerpin1, LOW);
delayMicroseconds(2);
digitalWrite(triggerpin1, HIGH);
delayMicroseconds(10);
digitalWrite(triggerpin1, LOW);
time = pulseIn(echopin1, HIGH);
S1= time*0.034/2;

// Reading from second ultrasonic sensor


digitalWrite(triggerpin2, LOW);
delayMicroseconds(2);
digitalWrite(triggerpin2, HIGH);
delayMicroseconds(10);
digitalWrite(triggerpin2, LOW);
time = pulseIn(echopin2, HIGH);
S2= time*0.034/2;

// Reading from third ultrasonic sensor


digitalWrite(triggerpin3, LOW);
delayMicroseconds(2);
digitalWrite(triggerpin3, HIGH);
delayMicroseconds(10);
digitalWrite(triggerpin3, LOW);
time = pulseIn(echopin3, HIGH);
S3= time*0.034/2;

// Reading from fourth ultrasonic sensor


digitalWrite(triggerpin4, LOW);
delayMicroseconds(2);
digitalWrite(triggerpin4, HIGH);
delayMicroseconds(10);
digitalWrite(triggerpin4, LOW);
time = pulseIn(echopin4, HIGH);
S4= time*0.034/2;

// Print distance values on serial monitor for debugging


Serial.print("S1: ");
Serial.print(S1);
Serial.print(" S2: ");
Serial.print(S2);
Serial.print(" S3: ");
Serial.print(S3);
Serial.print(" S4: ");
Serial.println(S4);
}

void signal1Function()
{
Serial.println("1");
low();
// Make RED LED LOW and make Green HIGH for 5 seconds
digitalWrite(signal1[0], LOW);
digitalWrite(signal1[2], HIGH);
delay(redDelay);
// if there are vehicels at other signals
if(S2<t || S3<t || S4<t)
{
// Make Green LED LOW and make yellow LED HIGH for 2 seconds
digitalWrite(signal1[2], LOW);
digitalWrite(signal1[1], HIGH);
delay(yellowDelay);
}
}

void signal2Function()
{
Serial.println("2");
low();
digitalWrite(signal2[0], LOW);
digitalWrite(signal2[2], HIGH);
delay(redDelay);

if(S1<t || S3<t || S4<t)


{
digitalWrite(signal2[2], LOW);
digitalWrite(signal2[1], HIGH);
delay(yellowDelay);
}
}

void signal3Function()
{
Serial.println("3");
low();
digitalWrite(signal3[0], LOW);
digitalWrite(signal3[2], HIGH);
delay(redDelay);

if(S1<t || S2<t || S4<t)


{
digitalWrite(signal3[2], LOW);
digitalWrite(signal3[1], HIGH);
delay(yellowDelay);
}
}

void signal4Function()
{
Serial.println("4");
low();
digitalWrite(signal4[0], LOW);
digitalWrite(signal4[2], HIGH);
delay(redDelay);

if(S1<t || S2<t || S3<t)


{
digitalWrite(signal4[2], LOW);
digitalWrite(signal4[1], HIGH);
delay(yellowDelay);
}
}

// Function to make all LED's LOW except RED one's.


void low()
{
for(int i=1; i<3; i++)
{
digitalWrite(signal1[i], LOW);
digitalWrite(signal2[i], LOW);
digitalWrite(signal3[i], LOW);
digitalWrite(signal4[i], LOW);
}
for(int i=0; i<1; i++)
{
digitalWrite(signal1[i], HIGH);
digitalWrite(signal2[i], HIGH);
digitalWrite(signal3[i], HIGH);
digitalWrite(signal4[i], HIGH);
}
}

3.7 Result

Density based traffic signal will control the traffic where the number of vehicles are more than
the other sides of roads.

4. Applications
We can avoid unnecessary occurrence of traffic jams which causes public inconvenience.We can
save considerable amount of time Density based traffic light control have many advantages
compared to time based traffic control.

The intelligent work which is done by traffic inspector will be perfectly done by the Arduino in
the circuit with the help of sensors and the program which is coded to the Arduino . There is no
need of traffic inspector at the junctions for supervising the traffic to run smoothly.
Timeline

1. Its start from thought of traffic problem and its consequences and make a idea to work on
this project to resolve this problem.
2. We make a team and discuss about this project.
3. Then make a report and ppt of this project.
4. Collect the materials and waste accommodation wherever it is possible to use and try to
make it more cheaper.
5. Study books of Arduino and density based traffic signal and search concept in Wikipedia
and Youtube.
6. Make a model of project and test it.
7. Finally show in exhibition and submit it.

5. Reference And Bibliography

 Youtube link :- https://youtu.be/aYHnc1DVk_Q


 Wikipedia
 Google
 Books and articles
 Link:- https://ieeexplore.ieee.org/abstract/document/8365387
 Arduino link :- https://www.arduino.cc/

You might also like