FPGA Based Traffic Light Controller
FPGA Based Traffic Light Controller
ICEI 2017
Abstract— The main purpose of the traffic light control system is architecture of the traffic light controller, section III discusses
to control the congestion of vehicles at the junctions and also for about the hardware setup, section IV gives the obtained
safer pedestrian crossing. There have been many technologies simulation and synthesis results followed by the conclusion in
used for implementing a traffic light controller all over the world. the section V.
India being one of the densely populated countries, upgrading to
a new control system and imposing it all over is a tedious process. II. VLSI ARCHITECTURE FOR THE TRAFFIC LIGHT
This paper proposes the reconfigurable Traffic Light controller CONTROLLER
which can display the time of waiting in all the directions. It has
been observed that the designed traffic light controller is working The paper mainly works on the design of FPGA traffic
up to a maximum operating frequency of about 300 MHz. The light controller for a four-junction road, with two seven
coding has been done using the Verilog Hardware Descriptive segment displays each at the four directions and LED’s for the
Language. red and green lights. A traffic light controller system consists
of three lights (red, green and yellow) in each direction
Keywords— FPGA (Field Programmable Gate Array), Seven generally [11]. The red light indicates stop, green light
segment displays, LEDs (Light Emitting Diodes), traffic control indicates the flow of traffic and yellow light gives caution that
the traffic is going to be stopped in few seconds. In this the
I. INTRODUCTION yellow light is excluded and instead a timer circuit is
Traffic jamming is a critical crisis in many of the cities developed to specify the duration for which the traffic is
and towns all over the world [1]. The congestion of the traffic needed to wait [8]. The traffic light controller is a sequential
has become the cause for many difficulties and challenges in circuit and is modeled as a finite state machine. This contrast
the major and most occupied cities all over the globe. Travel is with respect to four junction road, shown in figure 1.
within the cities to the place of work or recreation has become
a huge issue. This has led to the people losing their time,
money and most essentially the energy resources getting
wearied due to the constant use in the automobiles and other
applications.
Previously, traffic light controller (TLC) has been
implemented using microcontroller. FPGA has many
advantages over the microcontroller that is, it is highly
configurable, performs high speed computations and has more
input output ports necessary for a traffic light controller design
[4].
The Traffic Light System proposed in this project aims
at minimizing the waiting times of vehicles at the traffic
signals [2]. Field programmable gate arrays (FPGAs) are
extensively used in electronic systems, for rapid prototyping
and verification of a conceptual design, especially when the
mass-production of a conventional integrated circuit becomes
prohibitively expensive due to the small quantity [6]. Many
electronic system designs that used to be built in conventional
silicon VLSI are now implemented in Field Programmable
Gate Arrays. Fig. 1. Signals at the Junction.
The paper mainly works on the design of FPGA traffic
light controller for a four-junction road, with two seven A. Proposed Traffic Light Controller
segment displays at the directions and LED’s for the red and
green lights. We have considered four junctions i.e. North, West, South
and East and five states. Initially the TLC is of reset state i.e.
The brief review of the remaining paper is- the section II all the junctions displays red light. When the enable switch
discusses the developed VLSI (Very large scale integration) which is turned on, the TLC will work by transition of states
from S0 to S1for 30 second duration and this cyclic process traffic that needs to be waiting under RED Light is controlled
continues until enable switch is turned low (which is of active by the Timer.
low pin of FPGA).
A four junction road is being considered here– which
When TLC is in S0 state then green light will be turned could be of highway or country road. Equal duration of 30
on at North junction and simultaneously the red lights, along seconds is given to all the roads corresponding to the junction
with their corresponding timers get turned on, at the remaining (North, West, South and East) under GREEN light, in order to
directions. It can be seen that the down count of timer in West clear the corresponding junction’s traffic. This is done by
direction will be 30 seconds and that of South and East switching of the control from junction to another by Finite
directions will be 60 and 90 seconds respectively and this State Machine (FSM).
continues when there is a state transition. The switching of
states and reset button is controlled by the user which is one of In this process when one of the junction is turned on say
the important advantages of this project. Table 1 shows the North junction for 30 seconds GREEN controlled by FSM,
activity of traffic lights and timer across the each direction. then West, South and East are turned RED. The duration of
the traffic that needs to wait in those RED areas is controlled
Table 1–Signals at the junction by decay of Timer for 90, 60 and 30 seconds down count is
seen across the junction West, South and East. This is repeated
and is a cyclic process
STATE DIRECTIONS
In order to view the outputs on the FPGA board the ring
TRANSITIO
N
counter is being used to enable the tri-state buffers so that
NORTH WEST SOUTH EAST when one of the 8 bits of the ring counter value is turned on,
the corresponding buffer is turned on and the output of the
buffer drives the display of the FPGA.
RESET(0000) RED RED RED RED
Since the switching is done at 200 MHz frequency, which
is the input to ring counter, the entire display is seen to be
S0(1000) GREEN RED RED RED turned on of the corresponding junctions. The frequency of
200MHz clock is incorporated to control the ring counter in
(30) (30) (60) (90) order to attain the persistence of vision (Which is used for
multiplexing).
S1(0100) RED GREEN RED RED Once the desired results on FPGA are seen we are
realizing the outputs to TLC model (shown in figure 3) by
(90) (30) (30) (60) incorporating the external hardware (shown in figure 5) to
interface the signals coming out from FPGA board.
S2(0010) RED RED GREEN RED
(60) (90) (30) (30)
Traffic Light Controller is designed on two assumptions. Fig. 4. Artix-7 Nexys4™ FPGA.
Initially Red signal is in all the directions. Now when the
Field Programmable Gate Array (FPGA) from Xilinx.
Reset is made high the North side traffic is allowed to move
With its large, high-capacity FPGA (Xilinx part number
and traffic in all the other directions are stopped. Later the
XC7A100T-1CSG324C), generous external memories, and
traffic in all the other directions is allowed to move in a cyclic
collection of USB, Ethernet, and other ports, the Nexys4 can
manner [3]. The advantage of this particular Traffic Light
host designs ranging from introductory combinational circuits
Controller, is that the modifications can be done easily as per
to powerful embedded processors. Several built-in peripherals,
the requirements i.e., suppose there is traffic on main road and
including an accelerometer, temperature sensor, MEMs digital
the side road, it can be controlled by changing the states
microphone, speaker amplifier and lots of I/O devices allow
accordingly, i.e., when the main road traffic is heavy when
the Nexys4 to be used for a wide range of designs without
compared to the traffic on the side road. Five states have been
needing any other components.
chosen for the finite state machine and the state diagram in
figure 3 depicts the transition from S1 to S0. The Artix-7 FPGA (shown in figure 4) is optimized for
high performance logic, and offers more capacity, higher
performance, and more resources than earlier designs. Artix-7
100T features include:
x 15,850 logic slices, each with four 6-input LUTs and 8
flip-flops
x 4,860 Kbits of fast block RAM
x Six clock management tiles, each with phase-locked
loop (PLL)
x 240 DSP slices
x Internal clock speeds exceeding 450MHz
x On-chip analog-to-digital converter (XADC)
The Nexys4 also offers an improved collection of ports
and peripherals, including:
x 16 user switches
x USB-UART Bridge
x 12-bit VGA output
x 3-axis accelerometer
x 16Mbyte Cellular RAM
x Pmod for XADC signals
x 16 user LEDs
x Two tri-color LEDs
x PWM audio output
x Temperature sensor
x Serial Flash
x Digilent Adept USB port for programming and data
Fig. 5. External Hardware.
x Two 4-digit 7-segment displays
x Micro SD card connector
x PDM microphone
x 10/100 Ethernet PHY
x Four Pmod ports
x USB HID Host for mice, keyboards and memory sticks
IV. RESULTS The following figure shows the logic that has been
realized in the RTL schematic. This is normally done by the
A. Simulation Results tool itself in order to show the input and output pin activity for
The below figure shows the Wave form of the Traffic each and every blocks of the Top Module of TLC.
Light Controller when the test bench is applied to the source
code.
Science and Automation Engineering (CSAE), 2011 IEEE [11] Parasmani, Shri Gopal Modani, “ FPGA-Based Advanced Traffic Light
International Conference, Shanghai, June 2011, pp.114-118 Controller Simulation”, International Journal of Scientific &
[8] L. Zhenggang, X. jiaolong, Z. Mingyun and D. Hongwei "FPGA-Based Engineering Research, Volume 4, Issue 9, September-2013.
Dual-Mode Traffic Lights System Design," Information Science and [12] “Structural modeling of intelligent traffic light controller on fpga” ,
Engineering (ICISE), 2009 1st International Conference, Dec. 2009, surabhi s. gaopande, ashwini d. Bharade.Department of Electronics
pp.558-561 Engineering, Visvesvaraya National Institute of Technology, India.
[9] https://www.xilinx.com/products/design-tools/ise-design-suite.html,
Software manual
[10] https://reference.digilentinc.com/_media/nexys4-ddr:nexys4ddr_rm.pdf