Mini Project Report - A01
Mini Project Report - A01
By
UNIVERSITY OF MUMBAI
TERNA ENGINEERING COLLEGE, NERUL,
NAVI MUMBAI
Department of Computer Engineering
Academic Year 2020-21
CERTIFICATE
This is to certify that the mini project 1 A entitles “Mini Project Title” is a bonafide work of
submitted to the University of Mumbai in partial fulfillment of the requirement for the award
of the Bachelor of Engineering (Computer Engineering).
This Mini Project 1 A Report – entitled “Mini Project Title” by following students is
approved for the degree of B.E. in "Electronics and Telecommunications Engineering".
Submitted by:
1.---------------------------------------------------------
2.----------------------------------------------------------
Date: ---------------------------------
Place: ---------------------------------
Declaration
We declare that this written submission represents our ideas in our own words and where others'
ideas or words have been included, we have adequately cited and referenced the original sources.
We also declare that we have adhered to all principles of academic honesty and integrity and have
not misrepresented or fabricated or falsified any idea/data/fact/source in our submission. We
understand that any violation of the above will be cause for disciplinary action by the Institute and
can also evoke penal action from the sources which have thus not been properly cited or from
whom proper permission has not been taken when needed.
Date: _____________________
Place: _____________________
Acknowledgement
We would like to express our sincere gratitude towards our guide Prof. Guide name, Mini Project
Coordinators Prof. Mini Project Coordinator for their help, guidance and encouragement, they
provided during the project development. This work would have not been possible without their
valuable time, patience and motivation. We thank them for making our stint thoroughly pleasant
and enriching. It was great learning and an honor being their student.
We are deeply thankful to Dr. Jyothi Digge (H.O.D Electronics and Telecommunications
Department) and entire team in the Electronics and Telecommunications Department. They
supported us with scientific guidance, advice and encouragement, they were always helpful and
enthusiastic and this inspired us in our work.
We take the privilege to express our sincere thanks to Dr. L. K. Ragha our Principal for providing
the encouragement and much support throughout our work.
Date: _____________________
Place: _____________________
Index
TABLE OF CONTENTS
Abstract
List of Figures
List of Tables
Chapter 1 Introduction
1.1 Sub chapter
1.2 Sub chapter
Chapter 2 Problem Statement
Chapter 5 Results
Reference
Abstract
Traffic light controller establishes a set of rules and instructions that drivers, pilots, train
engineers, and ship captains rely on to avoid collisions and other hazards. Traffic control systems
include signs, lights and other devices that communicate specific directions, warnings, or
requirements. In order to minimize the road congestion and avoid accidents we implement this
system, for a better traffic control at the highway-farm road intersections.
Highways in India connect India is a populated country with busy road schedule. Our highways
connect the rural to the urban or the sub-urban region. The supply and the daily trade trucks from
farms access the highways. By using Road Traffic Signal Controllers, they can reduce the
number without investing extra manpower and also avoid road traffic congestion.
We wrote a source code on Vivado Xilinx on xc7a100tcsg324-1 board to overcome the problem.
List of Figures
1 2.1 11
2 4.1 13
3 4.2 14
4 4.3 14
5 4.4 15
6 4.5 15
7 5.1 26
8 5.2 26
9 5.3 27
10 5.4 27
Chapter 1
Introduction
1.1 Motivation:
2.2 Features
There is a sensor in the farm way side to detect if there is any vehicle on the farm
way. If vehicles are detected on the farm way, traffic light on the high way turns to
YELLOW, then RED so that the vehicles from the farm way can cross the high way.
Otherwise, the traffic light on the high way is always GREEN and traffic light on the
farm way is always RED. The time period is 3 seconds for the YELLOW light and 10
seconds for the RED light.
2.3 Objectives
To write a source code for a traffic light controller on FPGA.
Literature Survey
At an intersection, the movements of various users such as vehicles follow the rules indicated by
traffic signals. In traditional traffic signal settings, there exists a sequence of indications that
periodically repeats. There are three main concepts describing traffic signal sequence settings:
cycle, phase, and duration. The cycle is the total time required to complete one signalization
sequence for all movements at an intersection, the phase is the controller timing unit associated
with one or more movements, and the duration is the amount of time the signal spends in each
phase, during which the signal indications do not change. Furthermore, a traffic flow group is
defined as one or more compatible movements of road users, and each phase has a set of timings
for each traffic flow group.
Chapter 4
Fig.4.1
When the sensor gets active i.e., when sensor detects a vehicle on the farm road:
Fig.4.3
Sensor about to complete its time cycle i.e., Vehicle has crossed the intersection:
Fig.4.5
Algorithm:
• Source code for traffic light controller.
• Preprocessor Directives.
• Include Statements.
• Parameter definitions.
• DUT Input regs.
• DUT Output wires.
• DUT Instantiation.
• Initial Conditions.
• Generating Test Vectors.
• Debug output.
• Determines the simulation limit.
Code:
parameter HGRE_FRED=2'b00,
HYEL_FRED = 2'b01,
HRED_FGRE=2'b10,
HRED_FYEL=2'b11;
input C,
clk,
rst_n;
reg delay10s=0,
delay3s1=0,delay3s2=0,RED_count_en=0,YELLOW_count_en1=0,YELLOW_count_en2=0;
wire clk_enable;
begin
if(~rst_n)
else
end
always @(*)
begin
case(state)
HGRE_FRED: begin
RED_count_en=0;
YELLOW_count_en1=0;
YELLOW_count_en2=0;
light_highway = 3'b001;
light_farm = 3'b100;
end
HYEL_FRED: begin
light_highway = 3'b010;
light_farm = 3'b100;
RED_count_en=0;
YELLOW_count_en1=1;
YELLOW_count_en2=0;
end
HRED_FGRE: begin
light_highway = 3'b100;
light_farm = 3'b001;
RED_count_en=1;
YELLOW_count_en1=0;
YELLOW_count_en2=0;
end
HRED_FYEL:begin
light_highway = 3'b100;
light_farm = 3'b010;
RED_count_en=0;
YELLOW_count_en1=0;
YELLOW_count_en2=1;
end
endcase
end
begin
if(clk_enable==1) begin
if(RED_count_en||YELLOW_count_en1||YELLOW_count_en2)
count_delay <=count_delay + 1;
if((count_delay == 9)&&RED_count_en)
begin
delay10s=1;
delay3s1=0;
delay3s2=0;
count_delay<=0;
end
begin
delay10s=0;
delay3s1=1;
delay3s2=0;
count_delay<=0;
end
begin
delay10s=0;
delay3s1=0;
delay3s2=1;
count_delay<=0;
end
else
begin
delay10s=0;
delay3s1=0;
delay3s2=0;
end
end
end
begin
count <=count + 1;
if(count == 3)
count <= 0;
end
endmodule
• Testbench Code:
`timescale 10 ns/ 1 ps
`define DELAY 1
module tb_traffic;
reg clk;
reg rst_n;
reg sensor;
initial
begin
clk = 1'b0;
rst_n = 1'b0;
sensor = 1'b0;
end
initial
begin
main;
end
task main;
fork
clock_gen;
reset_gen;
operation_flow;
debug_output;
endsimulation;
join
endtask
task clock_gen;
begin
end
endtask
task reset_gen;
begin
rst_n = 0;
# 20
rst_n = 1;
end
endtask
task operation_flow;
begin
sensor = 0;
# 600
sensor = 1;
# 1200
sensor = 0;
# 1200
sensor = 1;
end
endtask
task debug_output;
begin
$display("----------------------------------------------");
$display("------------------ -----------------------");
$display("-------------- -------------------");
$display("---------------- ---------------------");
$display("----------------------------------------------");
$monitor("TIME = %d, reset = %b, sensor = %b, light of highway = %h, light of farm road =
%h",$time,rst_n ,sensor,light_highway,light_farm );
end
endtask
task endsimulation;
begin
#ENDTIME
$finish;
end
endtask
endmodule
Chapter 5
Results
Fig.5.1
When the sensor gets active i.e., when sensor detects a vehicle on the farm road:
Fig.5.2
Sensor is active. Vehicle on the farm road is approaching the intersection:
Fig.5.3
Sensor about to complete its time cycle i.e., Vehicle has crossed the intersection:
Fig.5.4
Chapter 6
5.1 Conclusion
An FPGA code of traffic light controller system of a two roads structure with two traffic lights
has been simulated, implemented and tested. The system has been coded using Verilog, and
implemented on hardware using Artix-7 FPGA xc7a100tcsg324-1. The code reaches the
maximum utilization of the traffic either during rush hours or normal time.
Some of these functions are to control more than two traffic lights. Also, to allow the user to
assign the time for each traffic light (i.e., minimum time to be Green), adding more sensors on
each road to count the number of cars in each road and check for the longer queue to increase the
timer for that road, another function is to link the traffic light with the other traffic lights along
the streets to increase the flow of traffic.
References
[1] FPGA-Based Advanced Real Traffic Light Controller System Design | Intelligent Data
Acquisition and Advanced Computing Systems: Technology and Applications, 2007. IDAACS
2007. 4th IEEE Workshop on.