Adaptive Traffic Light Controller Using FPGA

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

2018 3rd IEEE International Conference on Recent Trends in Electronics, Information & Communication Technology (RTEICT-2018), MAY 18th

& 19th 2018

Adaptive Traffic Light Controller using FPGA


Varshitha V Siddharth J
Simrit Kaur
th 4th year BE, Electrical and Electronics 4th year BE, Electrical and Electronics
4 year BE, Electrical and Electronics
Engineering Engineering
Engineering
University Visvesvaraya College of University Visvesvaraya College of
University Visvesvaraya College of
Engineering Engineering
Engineering
Bangalore, India Bangalore, India
Bangalore, India
[email protected] [email protected]
[email protected]
Prasanna Kumar H
Tejus V S
Assistant Professor, Electrical and
4th year BE, Electrical and Electronics
Electronics Engineering
Engineering
University Visvesvaraya College of
University Visvesvaraya College of
Engineering
Engineering
Bangalore, India
Bangalore, India
[email protected]
[email protected]

Abstract—Through this paper, the design of ATLC using congestion. [1] B. Dilip et al. have implemented FPGA based
Spartan 3E FPGA is presented. It adapts to the traffic based on advance traffic light controller which controls the traffic light
density and it prioritizes emergency vehicles like ambulance, fire based on traffic density. However, this paper does not allocate
brigades etc. Due to urbanization, the number of vehicles in appropriate time for green signal based on the density. Also, it
metropolitan cities has increased tremendously resulting in
does not function effectively when two or more roads have
increase in traffic congestion. Traffic control is a challenging task
since its proper operation can bring the difference between same amount of traffic. [2] D. Bhavana et al. have presented
smooth flowing traffic and a grid-lock. Generally, the traffic traffic light controller, wherein specific switching mechanism
signals are fixed-time signals which follow a pre-determined is used to control traffic effectively. [5] Sourav Nath et al.
sequence of signal operation, always providing the same amount have designed FPGA based intelligence traffic light controller
of time to vehicle movement whether traffic is present or not. for 12 roads with 6 traffic lights. [7] Shwetank Singh et al.
This consumes more time and doesn’t have any provision for have implemented FPGA based dynamic traffic controller
sensing and prioritizing emergency vehicles. This problem can be which alters the timing based on density of traffic. [8] Taehee
overcome by using adaptive traffic light controller implemented Han has implemented intelligence traffic light Controller
on FPGA. The system is designed to sense the traffic density and
(ITLC) with VHDL which saves time by allocating signal
the presence of any emergency vehicles on individual roads. Once
an emergency vehicle is sensed, priority is given to the traffic of timing based on the width of the road, but no provision to
that particular direction. During normal operation, the signal will detect the presence of ambulance in order to ensure smooth
be controlled based on traffic density. The system has been ambulance movement. The above methods for traffic control
designed using Verilog HDL and is implemented on Spartan 3E have dynamic allocation of time based on density but don’t
FPGA. This system overcomes the limitations of conventional prioritize any emergency vehicle in the road. The adaptive
TLC by efficient traffic road management. traffic light controller (ATLC) presented in this paper is
designed using less number of states compared to above
Keywords— Adaptive Traffic Light Controller (ATLC), Finite
mentioned papers. Also we have employed One-hot encoding
State Machine (FSM), Field Programmable Gate Array (FPGA),
Density Sensor (DS)
for the FSM states. This makes operation run faster. The
ATLC ensures smooth movement of emergency vehicles by
continuously checking for the presence of an emergency
I. INTRODUCTION vehicle and prioritizing the road with the emergency vehicle.
One of the greatest obstacles is applying sound principles to Adaptive traffic light controller reduces conflicts in an area
traffic engineering is that simply installing a traffic signal will that is shared amongst multiple intersections. This is done by
solve any traffic problem. The traffic control mechanism controlling the access to junctions and allocating effective time
currently being used doesn’t have a provision for ensuring period between various users. ATLC has been implemented
smooth movement of ambulance. During peak hours, when using FPGA. The advantages of using FPGA over
people are travelling, traffic will be maximum. The absence of Microprocessors are more number of input and output ports,
an effective ATLC system results in traffic jams. This could improved performance, high speed, design flexibility etc.
lead to loss of life due to the inability of the ambulance to which are all very important in ATLC design, at the same time
reach the hospital on time. The problem arises due to an it is cheap compared to ASIC since mass production of custom
imbalance in the traffic movement at the junctions which IC becomes prohibitively expensive due to small quantity.
causes major congestion on the affected directions. For this, II. BLOCK DIAGRAM
many ideas about the traffic control systems have come up in
the recent past to simplify the complex problem of the traffic

978-1-5386-2440-1/18/$31.00 ©2018 IEEE


1612

Authorized licensed use limited to: University of Exeter. Downloaded on May 08,2020 at 13:34:18 UTC from IEEE Xplore. Restrictions apply.
The idea of ATLC is to develop a 24-hr traffic light controller The sensors placed for detection of ambulance are:
to manage the traffic movement of the roads at the same time, x Along N side: Z1
achieving maximum utilization of the roads and to ensure x Along E side: Z2
smooth movement of ambulance at the junction. Maximum x Along S side: Z3
utilization of the road is achieved by measuring the traffic
x Along W side: Z4
density with the help of sensors. The sensors are placed along
each side of the intersection at fixed distances from the signal.
All these sensors are interfaced to the controller (FPGA). The The road where an ambulance is detected will go green. The
block diagram of adaptive traffic light controller is shown in traffic signal at that road remains green until the ambulance
fig.1. Whenever vehicles reach the junction along each side, passes the signal. Otherwise, the traffic signal at the road
the sensor detects the vehicles and sends a signal to the which has the highest number of active sensors at a given
controller. Based on the number of sensors active along each instant of time will go green. The duration for which it
road the controller decides which of the four roads has more remains green depends upon the number of sensors active at
traffic and makes it green. The controller also determines the that road. The operation of the ATLC can be divided into three
time for which the signal will be green based on the number of modes:
active sensors. However, if an ambulance present at one of the
roads; the road where it is present will go green, ensuring it ¾ Emergency mode:
passes smoothly. When an ambulance is detected at any sides of the
roads at the intersection, the road where the
ambulance is present goes green. It remains green
until the ambulance has passed the signal.

¾ Negligible traffic mode:


The ATLC operates in this mode when there is very
little traffic. During off peak hours when none of the
sensors are active, the ATLC operates in normal
traffic sequence i.e. clockwise in this case.

¾ Heavy traffic mode:


This mode arises when at least one of the sensors
along the road is active. When there is heavy traffic
along a particular road, the traffic signal at that
particular road goes green and remains green until the
traffic at that road is cleared.

Fig. 1. Block Diagram

III. METHODOLOGY
The road structure depicted in fig.2 has four traffic signals
across each road at the junction. The four traffic signals are
represented by N, E, S, and W.
Along each of these roads four sensors are placed at a fixed
distance from the traffic signal. These sensors detect the
density of traffic across each road.

Another set of sensors which is used to detect the ambulance


are placed along each of the four roads.
The sensors (density detection) across each road are named as:
x Along N side: A1, A2, A3 & A4
x Along E side: B1, B2, B3 & B4 Fig.2 . Four way traffic signal with sensor
x Along S side: C1, C2, C3 & C4
x Along W side: D1, D2, D3 & D4

1613

Authorized licensed use limited to: University of Exeter. Downloaded on May 08,2020 at 13:34:18 UTC from IEEE Xplore. Restrictions apply.
The timing set for the ATLC is as follows: traffic at N and W sides, moderate traffic at E and S sides. Let
the number of active sensors at N, W, S, E side be 4,3,2,1
¾ Emergency mode: respectively.
Once an ambulance is detected:
GREEN First the traffic signal at N side will go green and will remain
The signal will be green for 6s before turning green for about 26s.The remaining roads remain red
amber meanwhile. Next the signal at W side goes Amber for about 3s
AMBER and then turns green. It remains green for 21s. Now the signal
at S side goes amber for 3s before going green for 16s. Finally,
The signal will be amber for 3s before turning
the signal at E side goes amber for about 3s and turns green for
green again.
11s. Fig.3. illustrates the flowchart of ATLC.
The cycle repeats until the ambulance passes the
signal.

¾ Less traffic mode (sensors inactive):


GREEN
The duration of green light at all the traffic
signals is for 6s.
AMBER
The duration of amber light at all the traffic
signals is 3s when there is negligible traffic.
RED
The duration of red light at all the traffic
signals is 6s when there is less/negligible
traffic.

¾ Heavy traffic mode:


During this time sensors will be active.
Depending upon the number of sensors
Fig.3. Flow chart of ATLC
active the duration of red/green light will be
set. The timing of amber light remains 3s.
The timing for green light depending upon
the number of active sensors is summarized
in Table.1.

Table.1. Delay Table

No. of Timing
sensor/sensors
active

1 6s+5s=11s

2 6s+10s=16s

3 6s+15s=21s

4 6s+20s=26s

Here 6s is the time for green/red during regular sequence (low


traffic condition)
If an ambulance is detected at any one of the roads, the road
where it is present will go green for 6s and then turns amber
for 3s. The traffic light continuously switches from green to
amber while other signals remain red until the ambulance
passes the signal. Consider the condition where there’s heavy Fig. 4 State diagram

1614

Authorized licensed use limited to: University of Exeter. Downloaded on May 08,2020 at 13:34:18 UTC from IEEE Xplore. Restrictions apply.
Fig.4 and Table.2 depict the state diagram and state transition
table of the adaptive traffic light controller respectively. S0 is
the default state. The comparison of density takes place in S9
state. Depending upon which of the roads have higher density
the state changes. Also, a delay is generated for green light
depending upon the number of sensors active. For instance, If
X1 is active the transitions take place from S0 to S1 and
finally to S2 where N turns green. Depending upon the number
of sensors active along the N side, a delay is generated. In case
of emergency if any of the roads have ambulance sensor active
then the transition will take place from the existing state to the
state where the road with the ambulance sensor active goes
green.
Table.2. State transition table

Fig.5. Implementation of ATLC using FPGA

The hardware for Adaptive Traffic Light is implemented using


Papilio One 500k FPGA Board as shown in fig.5. The code is
synthesized using Xilinx ISE and the RTL Schematic diagram
is shown in Fig.6. Three LEDs (Red, Yellow, and Green) are
connected on a breadboard representing a road and four of
such combination represents a four-way traffic structure. Four
switches are connected along each road (N, E, S, and W) to
indicate density. Additional four switches are used to indicate
an emergency vehicle. We have used four switches along each
road as to demonstrate the proof of concept. In reality the
switches can be replaced with the appropriate sensors like IR
sensors, Magnetic sensors etc. However the basic idea remains
the same. The four sensors along each of the four roads will
make it easier to calculate the density. When the vehicles start
to fill up the road, the sensors gets activated one by one. The
sensor outputs are then added to find the amount of density in
each road. The density of all the four roads is compared and
the road with maximum density is selected. Appropriate time
is allotted for the signal depending on number of sensors
active (Table 1.)
Fig.7, 8 and 9 depict the simulation results obtained for
various conditions wherein different sets of sensors are
activated.

IV. IMPLEMENTATION AND RESULT

Fig.6. RTL Schematic of ATLC

1615

Authorized licensed use limited to: University of Exeter. Downloaded on May 08,2020 at 13:34:18 UTC from IEEE Xplore. Restrictions apply.
Testbench results:

Case (i) Sensor Z4 is sensed along West side

Fig.7. Sensor Z4 is sensed along West side

Input Z4 is activated along west side indicating the presence of an ambulance/emergency vehicle. This road is given priority over
any other road and needs to be cleared first. This feature is demonstrated in both simulation and hardware

Case(ii) 3 sensors on East side and 4 sensors on West side are activated

Fig.8. 3 sensors on East side and 4 sensors on West side are activated

The ATLC compares all the four roads for maximum density and selects the road with four sensors activated. The green light will
be ON for 6 + 20s. The result is obtained as expected both in simulation and hardware.

Case(iii) Sensor Z2 is activated on East side and 3 sensors are activated on South side

1616

Authorized licensed use limited to: University of Exeter. Downloaded on May 08,2020 at 13:34:18 UTC from IEEE Xplore. Restrictions apply.
Fig.9. Sensor Z2 is activated on East side and 3 sensors are activated on South side

Z2 is activated on East side and three density sensors are activated on South side. As the priority is given to ambulance over
density the ATLC selects the East side. The result is obtained as required both in simulation and hardware.

V. CONCLUSION
An Adaptive traffic light controller using FPGA has been [4] S. Nath et al., “Design of an Intelligent Traffic Light Controller
successfully designed, simulated, implemented and the desired with VHDL", International Conference on Radar, Communication
results are obtained. The system has been designed using and Computing, Pp.92-97, 21 - 22 December, 2012
Verilog HDL and is implemented on hardware on Spartan 3E [5] Sourav Nath, Suman Sau, Abhishek Roy, “Design of FPGA
Based Intelligence Traffic Light Controller”, Conference on Radar,
FPGA using Papilio One 500k FPGA Board. The traffic Communication & Computing, SKP College, Tiruvannamalai, TN,
density at each of the four roads is sensed and accordingly December 2012.
time is allocated to the signal with maximum density such that [6] Y.S. Huang et al., "Design and Analysis Urban Traffic Lights
the traffic at that road is cleared. This system provides an Using Timed Colour Petri Nets," IEEE International Conf. on
efficient way for allocating the time to signals depending on Networking, Sensing and Control, pp. 248-253, 2006.
density and also has a provision to detect and give priority to [7] Shwetank Singh, et al., "Design and Implementation of FPGA-
ambulance. It overcomes the limitations of conventional traffic Based Adaptive Dynamic Traffic Light Controller", International
controllers, with the capability of providing varying green Conference on Emerging trends in Networks and Computer
cycle interval based on dynamic traffic load changes at every Communication (ETNCc), ISBN-978-1-4577-0239-6, 2011.
[8] Taehee Han and Chiho Lin, "Design of an intelligence traffic light
lane. The design of the ATLC is easy to realize and Controller (ITLC) with VHDL", Conference on Computers,
implement. It provides a fast response time ensuring efficient Communications, Control and Power Engineering (TEN CON '02),
traffic management. This design can further be modified by Proceedings 2002 IEEE Region 10, vol 3, pp: 1749 -1752, Oct. 2002.
incorporating changes based on the topology of an area. [9] WM El-Medany and MR Hussain, “FPGA-Based Advanced Real
Traffic Light Controller System Design”, IEEE International
Workshop on Intelligent Data Acquisition and Advanced Computing
Systems: Technology and Applications 6-8 September 2007,
REFERENCES Dortmund, Germany.
[1] B. Dilip, et al.,”FPGA Implementation of an Advanced Traffic [10] M.F.M.Sabri et al., “Design of FPGA-Based Traffic Light
Light Controller using Verilog HDL” International Journal of Controller System”, 2011 IEEE International Conference on
Advanced Research in Computer Engineering & Technology Computer Science and Automation Engineering.
(IJARCET) Volume 1, Issue 7, September 2012.
[2] D. Bhavana et al., “Traffic Light Controller Using FPGA “Int.
Journal of Engineering Research and Applications, ISSN: 2248-9622,
Vol. 5, Issue 4, (Part -6) April 2015, pp.165-168
[3] Tseng S. T, Song K. T. “Real-Time Image Tracking for Traffic
Monitoring”, IEEE, 5th International Conference on Intelligent
Transportation Systems, 2002.

1617

Authorized licensed use limited to: University of Exeter. Downloaded on May 08,2020 at 13:34:18 UTC from IEEE Xplore. Restrictions apply.

You might also like