You are on page 1of 5

IoT Based Dynamic Road Traffic Management for

Smart Cities
1
Syed Misbahuddin, 2Junaid Ahmed Zubairi, 3Abdulrahman Saggaf, 4Jihad Basuni, 5Sulaiman A-Wadany and
6
Ahmed Al-Sofi,
1,3,4,5,6
College of Engineering and Islamic Architecture
Department of Electrical Engineering, Umm Al-Qura University, Makkah Saudi Arabia
2
Department of Computer and Information Sciences, State University of New York at Fredonia, Fredonia NY 14063 USA
1
doctorsyedmisbah@yahoo.com, 2zubairi@fredonia.edu,3asa8af@gmail.com, 4 jihad.basuni@gmail.com,
5
eng.a7mdd@hotmail.com, 6syw2011@windowslive.com,

Abstract All metropolitan cities face traffic congestion Identification) and other. However, embedded PCs such as
problems especially in the downtown areas. Normal cities can be Raspberry Pi by Raspberry Pi foundation and Galileu by Intel
transformed into smart cities by exploiting the information or similar Embedded computing units can also be utilized in
and communication technologies (ICT). The paradigm of IoT infrastructure [3][4]. This paper suggests an IoT based
Internet of Thing (IoT) can play an important role in realization
solution for Traffic management for smart cities.
of smart cities. This paper proposes an IoT based traffic
management solutions for smart cities where traffic flow can be
dynamically controlled by onsite traffic officers through their Traffic signals are used on the crossroads to arbitrate the
smart phones or can be centrally monitored or controlled traffic rights for the commuters. Three color traffic signaling
through Internet. We have used the example of the holy city of system was introduced in New York City in 1918 for the first
Makkah Saudi Arabia, where the traffic behavior changes time. This model had a manual control from a tower in the
dynamically due to the continuous visitation of the pilgrims middle of the street. Modern traffic light was designed in USA
throughout the year. Therefore, Makkah city requires special as well. The modern traffic signaling standard are outlined in
traffic controlling algorithms other than the prevailing traffic
traffic signaling Manual [5]. A typical modern traffic light
control systems. However the scheme proposed is general and
can be used in any Metropolitan city without the loss of
model is shown in Figure 1.
generality.

Index TermsIoT, Embedded Systems, Embedded PC, Road


Traffic Management, Embedded Systems

I. INTRODUCTION
Worlds urban areas are facing several challenges because
of alarming trend of growing populations. Such colossal and
multifaceted congregations of people results in various kinds of
problems in waste management, scarcity of resources, air
pollution, human health concerns, and traffic congestions. The
concept of smart cities has been introduced to mitigate issues
related to growing urban population. There are several
definitions associate with smart cities as reported by Chourabi
et al [1]. One of the many definitions of smart city is The use
of Smart Computing technologies to make the critical
infrastructure components and services of a city. The Internet
Figure 1: Traffic Signal Model
of Thing (IoT) is a newly surfaced architype which aims to
provide new opportunities in the field of communication and
information technology. In IoT model virtually everything Traffic congestion is a major concern in every metropolitan
will be connected to the Internet. IoT can therefore, play a city. A study shows people spend about 38 hours per traffic
vital role in smart cities. IoT needs cloud computing year in traffic jams in USA [6]. Initially, the traffic light control
infrastructure to integrate devices. A thorough review of system was based on a fixed signaling scheme [7]. The idea of
current IoT trends has been studies by Luigi et al in [2]. In the making traffic light controlling adaptive according to real time
original IoT paradigm, connectivity to Internet is implemented traffic volume was introduced in 1982 and has been
by sensor devices such as RFID (Radio Frequency implemented in various metropolitan cities in the world [8].
The adaptive traffic light system provided significant

978-1-4673-9268-6/15/$31.00 2015 IEEE

142
improvement in traffic congestion management over first II. RASPBERRY PI AS EMBEDDED PC
generation traffic control [9]. The third generation of traffic
signaling control is featured with fully adaptive and dynamic Our proposed dynamic traffic signal controlling algorithm
decision making. The traffic signaling schemes are modified requires an intelligent hardware platform which could give
according to the real time traffic situation around an dependable performance in the harsh traffic environment. For
intersection. this purpose, the single board computer (SBC) attributed with
networking features would be a suitable choice. There are
Mostly the traffic light controlling systems are some popular SBCs such as Intel Galileo, Raspberry Pi (RPi)
microprocessor based and usually operate on a preprogrammed and Arduino Yun. Choice of a SBC depends upon the
algorithm. Depending upon the traffic conditions, it would be application. We have selected RPi over other contemporary
desirable to modify the traffic light controlling patterns. The SBCs due to following reasons: Raspberry Pi has lowest cost
issue of traffic congestion control has been the focus of many among all other SBCs. The operating system on Rpi allows
researchers. K. M. Ng et al. have reviewed various methods in convenient software updates and installation like any other
controller and intelligent systems implementing traffic- standard Linux machine. Finally, the Raspberry Pi can be
response strategies [10]. These strategies aim to provide configured as a web server, which is the requirement of our
automated regulation of traffic by dealing with special proposed algorithm. This section describes some significant
conditions in a smart way. Wen has developed a model in features of RPi.
which the count of vehicles and their speeds are fed to a
backend server to conjecture and provide different alternatives RPi has potential for its integration in IoT paradigm. RPi runs a
for setting red or green light duration via a traffic light control tailored Linux like operating system can be freely downloaded
interface to resolve the traffic congestion problem [11]. A from Raspberry Pi foundations website [4]. RPi provides
report published at University of New Mexico has briefed the complete computing solution as provided by any desktop
methods to control the traffic congestion [12]. These Linux machine. RPis onboard General Purpose Input-output
techniques are based on aboveground sensors like video image (GPIO) lines allows interfacing with external circuitry.
processing, microwave radar, laser radar, passive infrared, Original Rpi has 512 MB RAM, 2 USB ports, an Ethernet port
ultrasonic, and passive acoustic array. All these signaling and 26 extension connector for interfacing with external
schemes carry high equipment cost. In addition, their hardware. Rpi board contains Broadcom BCM2835 system-on-
functionality can be influenced by environmental conditions. chip (SoC) which includes an ARMl176JZF-S 700 MHz
Several prototypes of traffic controlling models have been processor, Video Core IV GPU and some memory. The RPi
developed. However, next generation of smart traffic card contains a special interface slot called Camera Interface
controllers is still in the stage of evaluation and development. (CSI) and Display Interface (DSI) for connecting special
camera and display respectively. Rpi expansion header consists
Traffic management is becoming more difficult in big of two rows of pins. RPi uses Secure Digital (SD) nonvolatile
cities. The researchers are focusing on the idea of smart cities memory card to hold the operating system and data. Figure 2
which intends to address all the issues pertaining to big cities shows the interfaces available on Rpi Model B.
including traffic management problems. In this paper, traffic
management solution in the context of smart cities has been
investigated. Sometime the traffic flowing towards a particular
direction needs more time at certain timings. In some
situations, the traffic police officer on duty may need to
enforce a particular traffic lights controlling pattern different
from the regular pattern of lights. As an example, in the city of
Makkah, Saudi Arabia, the traffic flowing towards holy Kaaba
may need more access during timings of prayers each day. In
this situation, the traffic light timings can be adjusted to allow
more traffic moving towards holy Kaaba. For this reason, lane
directions can be swapped and normally closed streets or lanes
may be opened to allow smooth flow of traffic for the
worshippers. In this paper, an IoT based solution for the design
of a traffic light control system has been presented. The traffic Figure 2: Raspberry Pi Model B
light pattern may be adjusted dynamically through the smart
phones of onsite traffic police officer. Rest of the paper is
organized as follows: section II reviews the Raspberry Pi as III. ADAPTIVE TRAFFIC LIGHTS CONTROLLING
embedded PCs, section III describes the software and hardware
In some case, the traffic conditions change suddenly due to
architecture of the proposed model. Finally, the paper is an event, an accident or special situations. Sometimes the
concluded in section IV.
traffic flowing in a particular direction needs green traffic
lights for longer duration of time. For example in Makkah city,

143
Saudi Arabia, the traffic flowing towards the Holy Grand
Mosque increases during the prayer timings each day and
would need more time for smooth traffic flow. In addition,
sometimes funerals also move towards the Grand Mosque and
some specific situations demand the blocking of traffic on
some streets while allowing it to flow on other streets. To allow
the pilgrims to go to Holy Mosque more easily, it would be
desirable if we manage all special situations through a digital
system that can be monitored and controlled by police officers
using their smart phones adaptively. The traffic controlling
systems are mostly standalone microprocessor or
microcontroller based. These systems control the traffic lights
by using the bit-addressability features of processors in the
systems. Timing delays are induced by calling real time delay Figure 4: Simple LED connection to GPIO 7.
routines written in the assembly language of the processors.
These systems work as open loop systems without human REST allows HTTP protocol to access resources spread
interventions. In this project, we have investigated the across the networked machines instead of using complex
methodologies for adjusting the traffic lights dynamically mechanisms such as CORBA, RPC or SOAP [13]. Due to
according to the current special traffic situations. In our WebIOPi configuration on the RPi, the GPIO interface of RPi
prototype design a RPi platform has been used due to flexible will be displayed on the client side as shown in Figure 5. The
features compared described above. client side could be a PC, smart phone or tablet. The user can
choose input or output mode of any programmable GPIO
through the web browser by simply clicking the button next to
A. Design
the GPIO shown in Figure 5. For output GPIO, logic value can
RPis board contains General Purpose Input-Output (GPIO) be set or reset by clicking on the button for the GPIO pins on
ports which can be interfaced to external hardware. . Figure 3 the smart phone or on the clients PC.
shows a layout of GPIO on RPi model B obtained from open
literature.

Figure 3: GPIO on model B

A GPIO line on RPi can be configured as input or output by


using Pythons commands defined in GPIO library. In case of
output configuration, a certain GPIO pin be derived by sending
high or low logic pulses by using Python commands. For
example, Python commands GPIO.output(7,True) or Figure 5: Rpis GPIO Interface via WebIOPi
GPIO.output(7,False) commands can send True (Logic 1) or
False (Logic 0) to GPIO pin 7 respectively. In our model, we B. Smart Phone App for GPIO
have used 12 GPIO lines for simulating a road intersection by Recently an app called RPi Automation has been developed
connecting GREEN, YELLOW and RED Light Emitting for Android smart phones and has been made available for free
Diodes (LEDs). A simple LED connection is shown in Figure download from Google play store. RPi Automation app
4. extends GPIO interface over the smart phone and allows
To access traffic light controlling RPi, we have used sending high or low logic levels to remote RPi within the same
WebIOPi which is Representational State Transfer (REST) API network zone by touching the buttons on the smart phone. For
on Raspberry Pi. WebIOPi extends the RPis GPIO over the using RPi Automation, smart phone and RPi should be
Internet or Intranet to a distant user accessing the RPi via connected via Wi-Fi router and must have the same IP range as
HTTP protocol [14]. REST is an architectural framework of RPi. Figure 6 shows RPi automation app interface on the
designed for networked applications. smart phone.

144
GPIO 5 and 6 in each iteration. The dynamic algorithm is
summarized in Figure 7.

Figure 6: Rpi Automation interface

C. Dynamic Traffic Algorithm Figure 7: Dynamic Traffic Light controlling Algorithm


In the algorithm developed for the traffic control, we have
selected three modes or patterns for traffic signaling as defined RPi Automation App as described in subsection III (D). This
below: app can be used to display the GPIO interface pins on the smart
phones of onside traffic police officer. RPi automation should
Pattern 1: Standard signaling scheme or Default standard be configured with correct IP address of RPi.
Pattern
Pattern 2: Green signal Turns ON for duration x seconds In our suggested model, one RPi controls one intersection. The
Pattern 3: Green signal Turns ON for duration y seconds system is scalable in coherent manner for covering other
intersections by adding additional RPi for each intersection. All
The value of variable x and y is adjustable according to the RPis may be connected with each other via Internet cloud.
traffic situation and requirement. In our prototype, we have This interconnection will help in any possible information
used fixed values of x and y for testing purpose. However, it exchange aimed to avoid traffic congestions and to resolve any
may be better to upload x and y values at runtime. Any emerging traffic problems quickly.
available GPIO line can be used to control the traffic lights. In
our design, we have used GPIO line 5 and 6. The traffic lights E. Security and Hacking issues
will follow one of these patterns controllable by GPIO pins as In order to control the traffic on demand, only authenticated
defined below in Table 1: clients can access the IoT framework running on the traffic
lights controlling Rpi. The WebIOPi IoT framework uses an
Table 1: Light pattern controlling by GPIOs encrypted file to contain both login and password. Therefore,
GPIO 5 GPIO 6 Pattern the password is protected through encryption and spurious
access to run the WebIOPi is not possible.
OFF OFF Pattern 1 (Default)
ON X Pattern 2
F. Real Time Traffic Flow Monitoring
OFF ON Pattern 3
In our model, we attached a webcam to the traffic controlling
D. Methodology RPi. We configured the RPi as a web server. A background job
In order to control the traffic lights in one of the patterns or to running on the RPi takes live traffic pictures at regular intervals
enforce any new pattern, the onsite traffic officer will access and stores them in a folder over a period of time. The traffic
RPis GPIO interface through a smart phone utilizing the images can be accessed through the web browser at the client
WebIoPi framework installed at RPi. The officer will use the machine connected to the Internet. Traffic controlling
IP address of the RPi on the web browser running on the smart authorities can observe the current traffic situation via Internet
phone. The URL to be typed should have following syntax in and can override the traffic controlling mechanism by
any browser on the smart phone: IP_Adress:8000, where 8000 accessing the GPIO of the traffic light controlling RPi if
is port number of WebIOPi. Once the GPIO interface is needed.
accessed, any particular pattern can be selected. The algorithm
will check the GPIO 5 and 6. If GPIO 5 is high, the traffic light G. On Demand Right of the Way
pattern will be pattern 2. On the other hand if the GPIO 6 is
In the situation of Ambulance or emergency vehicle
high, the traffic lights will use pattern 3. In case if both GPIO
movement, it is desirable to give right of the way to these
5 and 6 are off, the default pattern will be selected. In other
vehicles despite the status of the traffic lights. Presently, in
words, the algorithm in each pattern will check the status of
case of red traffic lights on the way of emergency vehicles, the

145
vehicles have to stop momentarily to avoid any accident and ACKNOWLEDGMENT
then cross red light. With the design proposed in our research, Authors would like to acknowledge Umm Al-Qura
it is possible that an emergency vehicle can demand right of the University, Makkah Saudi Arabia for providing the research
way. To get the right of the way, onboard staff inside the environment for conducting this experiment. The presented
emergency vehicle can have privilege to access the RPi work is outcome of design project of electrical engineering
controlling the traffic signals through their authenticated smart students at Umm Al-Qura University, Makkah, Saudi Arabia.
phones.
REFERENCES
IV.CONCLUSION
Disruptive issues such as traffic congestion, accidents, [1] Hafedh Chourabi, J. Ramon Gil-Garcia, Theresa A. Pardo,
unidirectional flow of caravans including large number of cars Taewoo Nam, Sehl Mellouli, Hans Jochen Scholl, Shawn
and emergency vehicle movement are challenging issues in Walker and Karine Nahon, Understanding Smart Cities: An
metropolitan cities. The concept of smart cities has been Integrative Framework, 2012 45th Hawaii International
introduced to give solutions to such issues manifested in big Conference on System Sciences pp 2289-2297.
cities. Present Traffic light controlling systems are not fully [2] Luigi Atzori Antonio Iera and Giacomo Morabito, The
adaptive to various traffic situations that can emerge in the Internet of Things: A survey, in Computer Networks, Vol. 54,
course of a day. Depending upon the circumstances, it is 2010.
desirable that traffic flow be controlled and managed as per the [3] http://arduino.cc/en/ArduinoCertified/IntelGalileo
current situation under the control and supervision of onsite [4] http://www.raspberyypi.org
traffic officer. Such situations are commonly observed in the [5] Traffic signaling Timing Manual, Publication Number:
holy city of Makkah, where the traffic lights can be controlled FHWA-HOP-08-024, June 2008.
dynamically using our scheme to adapt to various traffic [6] Annual Urban Mobility Report, Texas A&M University,
conditions. In this paper, we have investigated the possibility http://mobility.tamu.edu/ums/
of using embedded PCs in dynamic traffic light controlling [7] Vincent, R.A., Mitchell, A.I., Robertson, D.I., 1980. User guide to
through WebIOPI REST API in smart cities. The approach TRANSYT version 8
presented can be easily extended for more complex traffic [8] Hunt, P.B., Robertson, D.I., Bretherton, R.D., 1982. The SCOOT
controlling algorithm. The scheme presented in this paper can on-line traffic signal optimization technique, Traffic
be further improved if the traffic situational information is Engineering and Control, 23, 190-92.
automatically passed to the RPi unit controlling the lights at an [9] Chen Cai Adaptive Traffic Signal Control Using Approximate
intersection so that the authorities can make and implement Dynamic Programming PhD dissertation University College
quick decision. To implement this automation, RFID or any London, 2009.
other wireless sensor technique may be used. It is likely that [10] Kok Mun Ng, Mamun Bin Ibne Reaz, Mohd Alauddin Mohd
prioritizing certain roads or certain directions for longer Ali, Tae Guy Chang A brief survey on advances of control and
durations may cause traffic problems for the other roads. intelligent systems methods for traffic-responsive control of
Therefore, it is recommended that the suggested dynamic urban networks, Technical Gazette 20, 3(2013), 555-562
traffic light controlling scheme should only be applied after a [11] W. Wen A dynamic and automatic traffic light control expert
thorough study of traffic patterns that develop during a test system for solving the road congestion problem, Expert
period. Roads leading to special directions such as towards Systems with Applications, Volume 34, Issue 4, May 2008.
schools, hospitals and mosques at certain timings should be [12] The Vehicle Detector Clearinghouse, A summary of vehicle
monitored and managed through this RPi based system. In detection and surveillance technologies used in intelligent
transportation systems, Southwest Technology Development
addition, the presented scheme may be used to give privilege to
Institute, 2000
the emergency vehicle personnel to claim the right of the way
[13] R. Fielding, Architectural Styles and the Design of Network-
in case of emergencies. That is, the emergency vehicle
based Software Architectures, PhD thesis, University of
personnel should be able to turn the green lights on for California, Irvine, US, 2000
appropriate duration of time in a specific direction.
[14] http://webiopi.trouch.com/

146

You might also like