Base Paper
Base Paper
Research Article
Automated Real-Time Intelligent Traffic Control System for
Smart Cities Using Wireless Sensor Networks
Received 9 May 2020; Revised 18 July 2020; Accepted 23 August 2020; Published 11 September 2020
Copyright © 2020 Adil Hilmani et al. This is an open access article distributed under the Creative Commons Attribution License,
which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
Over the years, the number of vehicles has increased dramatically, which has led to serious problems such as traffic jams, accidents,
and many other problems, as cities turn into smart cities. In recent years, traffic jams have become one of the main challenges for
engineers and designers to create an intelligent traffic management system capable of effectively detecting and reducing the overall
density of traffic in most urban areas visited by motorists such as offices, downtown, and establishments based on several modern
technologies, including wireless sensor networks (WSNs), surveillance camera, and IoT. In this article, we propose an intelligent
traffic control system based on the design of a wireless sensor network (WSN) in order to collect data on road traffic and also on
available parking spaces in a smart city. In addition, the proposed system has innovative services that allow drivers to view the
traffic rate and the number of available parking spaces to their destination remotely using an Android mobile application to
avoid traffic jams and to take another alternative route to avoid getting stuck and also to make it easier for drivers when looking
for a free parking space to avoid unnecessary trips. Our system integrates three smart subsystems connected to each other
(crossroad management, parking space management, and a mobile application) in order to connect citizens to a smart city.
Management and
application center
Internet
Mobile application
RFID tag
connect citizens to roads and parking spaces in their city
remotely and in real time using only one mobile application
(Figure 1).
The rest of this paper is organized as follows. The related
work is presented in Section 2. In Section 3, we describe the
general architecture of the proposed intelligent traffic control
system. The presentation of our system and the proposal of a Hybrid sensor
(sensor + RFID reader)
self-organization protocol are presented in Section 4. Section
5 presents the algorithm of our intelligent system. The simu- Figure 2: Car presence detection using hybrid sensors.
lation and the evaluation of the performances in terms of
energy consumption, lifetime of the WSN, etc. are presented
in Section 6. Section 7 presents our Android Smart Traffic
mobile application. Finally, Section 8 is the conclusion. of linear car parks and for large car parks because it will cre-
ate a load imbalance between the different detection nodes
2. Related Work during the communication of a single hop towards the sink
node quickly exhausting the most distant nodes which will
Several traffic control systems have been implemented in negatively affect the quality of communication and the reli-
recent years using different communication and surveillance ability of the system. In addition, this approach uses recent
technologies to control and manage the problem of urban technologies such as wireless sensors to limit the cost of sys-
traffic in cities and resolve the limitations of traditional traffic tem deployment. However, such a solution remains obsolete
light systems. vis-à-vis citizens and drivers because they cannot connect to
The authors in [5] propose a new architecture for the the roads and know the state of traffic in real time and
urban traffic control system (S1) based on an IoT network. remotely which are part of the concept of the creation of
This system makes it possible to connect roads to the Internet smart cities.
via sensor nodes, capable of detecting the arrival of vehicles In [6], a new intelligent traffic control system (S2) is pre-
and sending the detected data to a cloud from a border sented, which is based on the deployment of wireless sensor
router. Data collected in the cloud allows middleware to networks on roads, on traffic lights, and on specific places
decide the future state of traffic lights. This decision is dis- (such as hospitals and petrol pumps) in order to monitor
seminated via the network to actuators installed in traffic road traffic in the city and find the shortest route to the des-
lights to manage traffic in city intersections. This system is tination in terms of time and distance, avoiding traffic jams.
based on the implementation of a self-organization protocol This system employs intelligent cameras on the roads to
that creates a star network topology allowing all detection identify the vehicle numbers and send this information to
nodes to send their data to the sink node via a single hop. the central system to monitor the cars in the city. The pro-
However, this protocol is not adequate for the management posed system uses more recent technologies which allow
Wireless Communications and Mobile Computing 3
the interconnection of the various urban services between implemented in the roads. The TDMM deployed on each
them by creating a smart city. However, the deployment of road in a road crossing send their collected data to their near-
smart cameras can be expensive and also less effective, espe- est TMM via Wi-Fi using multihop or single-hop communi-
cially when detecting the numbers of cars in cases where cation depending on the communication range in order to
there are visibility problems such as the reflection of light determine the density of road congestion (strong, medium,
from car headlights, given that there are other cheaper and or low) and dynamically define the operating time of the traf-
efficient solutions such as RFID technology which interacts fic lights according to the values obtained from the different
with WSN networks and which allows vehicles to send this routes. This system uses a self-organization protocol which
information to the central system in a sustainable and effi- creates a nonautonomous tree type topology between the dif-
cient way. ferent nodes, of which each monitoring node communicates
In [7], the authors propose an intelligent traffic conges- via a single hop with the nearest node which in turn commu-
tion control (S3) based on the deployment of wireless sensor nicates with the sink node via intermediate nodes to transmit
networks in order to measure the density of road congestion data to the traffic management module. However, the nonau-
created at road crossings. This system consists of two mod- tonomous tree structure formed by this system creates an
ules. The first is TDMM (traffic density monitoring module) imbalance in the energy consumption between the various
which uses an ultrasonic sensor to measure the length of the monitoring nodes, especially for the intermediate nodes,
queue created by the crowd of cars, and the second is TMM and also, it decreases the quality of data delivery to the central
(traffic management module) which is software deployed in node when one of the routing nodes becomes faulty or
a computer which makes it possible to control the traffic exhausted in energy. In addition, the deployment of ultra-
lights according to the data collected by the various TDMM sonic sensors should only be used on roads with little traffic
4 Wireless Communications and Mobile Computing
Gateway
Axis Y
Node Sk
the street. Bluetooth beacons are installed along the road at
Node Sm different heights in order to identify and classify the type of
vehicles traveling on the road (cars or trucks). The RSSI
𝜃m values detected by mobile devices on each route as well as
𝜃k Node Sj
their positions are sent via a cellular network or Wi-Fi com-
munication to a server in order to measure the density of
𝜃j road congestion and monitor traffic on the roads. On the
other hand, Bluetooth technology can cause major synchro-
BS Axis X nization problems and communication breakdowns between
yi – ybs the BLE beacon and the smartphone, which negatively affect
arctan , xi > xbs, yi > ybs , the feasibility of the system, especially in the case of heavy
xi – xbs
𝜃i = yi – ybs traffic. So, an agent must be on-site to pair the two devices
90 + arctan , xi < xbs, yi > ybs
xi – xbs to resume communication.
The authors in [9] present a new intelligent traffic moni-
Figure 4: The angular value of each node of the first level. toring and traffic light control system (S5) based on wireless
sensor networks. These sensor nodes are installed along the
roads constituting a road intersection. The data captured by
and moderate traffic. Car vehicle detection on multiple lanes the sensors is sent to a two-traffic signal controller to assess
with roadside ultrasonic sensors is subject to a reduction in the congestion conditions of traffic on each road at an inter-
detection accuracy in heavy traffic. This can cause a system section and to predict the state of traffic jams. This system
stability problem, especially during peak hours with heavy uses a self-organization protocol (Alg5) which creates a star
traffic, which can lead to poor decisions when estimating topology between the different nodes of the network. How-
the running time of traffic lights. ever, the algorithm adopted by this system will create dark
The authors in [8] propose a system for monitoring road areas for certain nodes far from their associated central node
traffic (S4) based on mobile devices and Bluetooth beacons which they will not be able to communicate with it and which
with low energy consumption. The vehicle detection offered will cause degradation in the quality and in the feasibility of
by this system uses mobile devices (for example, smart- this system. This solution makes it possible to dynamically
phones) installed on the side of the road to measure the manage the traffic lights according to the states of traffic con-
strength of the RSSI signal when receiving radio frequency gestion obtained in an intersection and also makes it possible
frames emitted by Bluetooth beacons on the other across to optimize the synchronization phase of traffic light control
Wireless Communications and Mobile Computing 5
Level 2 Level 1
Clusteri Clusteri
BS
in order to avoid traffic jams before its formation. The intel- smart city and be connected to citizens remains isolated from
ligence of this system remains beyond the reach of drivers drivers who ignore what is happening on the roads of their
and citizens because they do not interact with the remote sys- city.
tem and also do not connect to roads in real time.
The authors in [10] describe a new intelligent system of 3. Architecture of the Intelligent Traffic
adaptive traffic light control (S6) based on the deployment Control System
of the wireless sensor network (WSN) in the roadways lead-
ing to an intersection. These nodes are magnetic sensors The proposed system contains 3 basic parts: parking space
installed in the ground along all the paths that form an inter- management center, traffic light management center, and
section. These sensors form a cluster-type network topology global information and management center (Figure 1).
in which each node detects the presence of vehicles and sends The parking space management center is based on the
the data to the nearest head cluster to reach the base station. deployment of WSNs in all parking spaces in order to consol-
The data collected by the WSN is used by the base station by idate all the availability states of spaces in each zone of the
running an algorithm to detect the rate of traffic congestion city for those sent to the corresponding gateway (sink), and
in each lane and dynamically control the traffic lights at the these will then be transferred to the global information and
road intersection. La transmission des données à la station management center to be used by and made available to
de base par les nœuds capteurs est basée sur l’utilisation drivers and citizens. The sensor nodes used are hybrid sen-
d’un protocole d’auto-organisation qui permet à tous les sors (presence sensor+RFID readers) which make it possible
nœuds du réseau de former une topologie en cluster dont on the one hand to detect the presence of vehicles and on the
les têtes de cluster (CH) transmettent toutes les données de other hand to identify the vehicle by its registration number
leur cluster à la station de base via un seul saut. Cependant, available in its RFID tag (Figure 2). In the case of hybrid sen-
ce protocole crée un déséquilibre de charge entre certains sors detecting the presence of a car without any RFID tag, the
nœuds de capteurs qui sont élus en tant que clusters de têtes system informs the parking agent to enter the registration
et qui sont éloignés de la station de base car la communica- number of the car parked in the system.
tion d’un seul bond vers la station de base consomme The traffic light management center is responsible for the
beaucoup d’énergie ce qui provoque un épuisement rapide management and control of traffic lights at road intersections
de ces nœuds. This system adopts recent, intelligent, and in order to minimize the traffic jam and ensure the flow of
inexpensive technology to monitor traffic congestion and to traffic in the city. This center is based on the implementation
control traffic lights. However, such a solution to create a of sensor networks to collect the density and the number of
6 Wireless Communications and Mobile Computing
Begin
Level = 1
BS sends a HELLO message to the nearest nodes
Yes No
Does BS receive
node positions?
Level = Level +1
BS sends each node the message
Cluster_ADV (Node-Id, Level, Cluster-Id)
more than 100 magnetic parts, of which these sensors are able
to measure the magnetic fields generated and to detect with
precision the presence of a car. Table 1 presents a comparison
made between the 3 most used types of sensors.
𝜃max
𝜃min
4.2. Wireless Communication. For a better management of
Level 1
parking spaces and traffic control in the city, the choice of
wireless communication technology is essential to obtain
good results of reliability and efficiency of the system when
exchanging data between the different sensors and the gate-
Level 2 way. Wireless communication between sensors is affected
by several major factors: cars, their noise and external inter-
ference, etc. The most common wireless communication
technologies used for sensor networks are Bluetooth, Wi-Fi,
and ZigBee.
In this type of application, a large number of monitoring
Level 3 and control systems based on sensor networks have been
exploited by the Bluetooth and ZigBee standards. Bluetooth
is a short-distance radio technology intended to simplify
communication and interconnection between sensors which
allows data to be transferred at low speed and at short dis-
𝛼=3
tance. On the other hand, this technology has a great defect
which is reflected in its too great consumption of energy
Base station Sensor node
and cannot therefore be adapted to the sensors which are
supplied by a battery and which should function for several
Cluster Relay node years. On the other hand, the ZigBee standard, despite its
low data transmission rate, offers characteristics that even
Figure 7: Formation of localization levels and clusters with α = 3.
better meet the needs of sensor networks in terms of energy
saving. In addition, this technology offers fairly high reliabil-
ity and a low-cost price, whose energy consumption is a
selection criterion [11, 12].
cars circulating in each road forming crossroads in order to Table 2 shows the advantages and limitations of ZigBee
make a decision when estimating the maximum duration compared to other wireless technologies.
during which a traffic light can remain in green. This center
is based on innovative and robust calculations which make 4.3. Network Topologies. Wireless sensor networks are made
our road traffic management system more efficient and more up of small sensor nodes that use limited energy resources
performant (see Section 5.2). and low communication and processing power to collect
The global information and management center is a data- information in a given geographic area and transfer it to
base of all the information collected from all the sensors the gateway (called sink). These sensors are individual nodes
installed in the city, which provides a general overview of that know nothing about the network, and they do not have
the available parking spaces, and it manages the traffic lights an existing fixed infrastructure; they are often completely
to increase traffic flow in the city. This center provides drivers decentralized. So, these nodes must self-organize, unlike con-
with an Android mobile application which identifies free ventional wired networks, autonomously to form a network
parking spaces for their destinations and also the traffic rate topology so that they can communicate and transfer the
in real time in order to avoid unnecessary trips and to look detected data to the sink. Direct communication from the
for another alternative route and other places available in sensor node with BS or multihop communication from sen-
locations closer to their destinations to avoid getting stuck sor nodes to BS is not practical as the power consumption
in a traffic jam and increasing traffic congestion in the city. is high, which leads to early expiration of the sensor nodes
and duplication of data, and the most distant nodes die
4. System Overview quickly. To overcome these problems, two-level communica-
tion via a hierarchical clustering approach is used when the
4.1. Types of Sensors. The proposed system uses sensor nodes nodes are grouped into clusters, and a leader node, called
to detect the presence of vehicles and send the detection the cluster head (CH), is responsible for aggregating the data
states to the corresponding gateway in order to transmit and then transmitting it to the gateway. The communication
them to the global information and management center. To within a cluster and between clusters is single hop (intraclus-
detect the presence of vehicles, several systems use different ter) and multihop (intercluster), respectively, as shown in
types of sensors, magnetic sensors, ultrasonic sensors, light Figure 3. Techniques based on clustering are the hierarchical
sensors, etc. But the majority of systems use magnetic sensors techniques most commonly used in wireless sensor networks
installed in the ground for a simple reason: a vehicle contains [13–15].
8 Wireless Communications and Mobile Computing
Start
Existence
Yes Cluster head Yes of a cluster head
CHi check
in the current
Weighti > T (n)?
round
Send
Cluster Head_ADV_MSG No No
Yes Node i
No
candidate
cluster head
Weighti > T (n)?
Node i candidate cluster head exchanges its Sleep for Tslot
End weight with that of their neighbors seconds
of the same cluster
Wait
Cluster Head_ADV_MSG
The weight of
Yes node i
No
is more than that of all
the nodes in No
its cluster T > Tround Reset T
Send Wait
Cluster Head_ADV_MSG Cluster Head_ADV_MSG Yes
Yes
Yes
End
Start
No
No
End
Figure 10: The phase of data transmission and the selection of optimal routes to the base station.
consumption while waiting to receive the Cluster_Head_ 4.3.3. Data Transmission. After selecting the CHs, the pro-
ADV_MSG message from the CH node to begin transmitting cess of transmitting data to the base station begins. Based
the data. on the TDMA protocol, communication is initiated
The selection of CHs is not done periodically in each between the different nodes of each cluster and their
round. During the selection phase of the CHs, each node respective CHs in their corresponding time slots. The
CH checks the value of its weight if it is below the threshold CHs aggregate the collected data and transmit it to the
TðnÞ. In this case, the process for selecting a new CH begins intermediate CH node or the BS according to the location
by sending a Selection_Cluster Head_MSG message level. To maximize the energy levels of the nodes, we
(Figure 8). In the opposite case, the node remains as much designed an energy-efficient multihop communication
as CH in the next round to prevent the nodes from consum- when transmitting intercluster data to the base station tak-
ing more power during the CHS selection process and to ing into account residual energy and distances from neigh-
balance the load between the different nodes in the next boring CH nodes and the base station.
rounds. The selection of a new CH in each cluster is done For the first level of location, all the nodes are close to the
independently of the rest of the clusters in each location base station including the CHs. For this reason and in order
level. to reduce the energy consumption of these nodes, we have to
Wireless Communications and Mobile Computing 11
Base station
Figure 11: Optimal routes and data transmission between CHs: (a) message propagation, (b) the transmission distance between the first-level
CHs and the base station, (c) the different routes between the CHs, and (d) selection of the best routes for intercluster data transmission.
use the single-hop communication to the base station for the according to formula (4). Each CHi node chooses a neighbor
first level as shown in Figure 9. node CH j with the largest weight belonging to the lower loca-
For the other location levels, there are several routes tion level as the next hop to transmit the collected data to the
between the neighboring CHs and the base station using base station.
the intercluster multihop communication. The process of
selecting the optimal routes between the different CHs and Ej d c S j , BS
the BS starts with the CHs of the first level of location. Each Weight‐CH j = + , if Leveli > Level j ,
Emax d c S j , BS + d S j , Si
CH j selected in the second phase broadcasts a nexthop_Clus-
terHead_MSG message containing the residual energy, the ð4Þ
cumulative distance of its route to the base station, its identi-
fier CH-Id, its location, its location level, and the identifica- where E j denotes the estimated current residual energy, Emax
tion of its cluster Cluster-Id. Each upper-level node CHi is the maximum energy for all nodes, d c ðS j , BSÞ is the
receiving this message updates its neighborhood table of cumulative distance between node j and the base station,
CHs and calculates Weight‐CH j of each neighbor CH j and dðS j , Si Þ is the distance between node i and node j.
12 Wireless Communications and Mobile Computing
Base station
1 8 Level 1
12 19
22 27 30 36
(b)
Figure 12: (a) Reception of the nexthop_ClusterHead_MSG messages by a CH. (b) Example of a neighborhood table and the selection of the
next hop by a CH.
This process of selecting optimal data paths is repeated in 4.4. Data Sent by Sensor Nodes. Our road traffic control sys-
all network location levels (Figure 10). Figure 11 illustrates tem contains two types of sensor nodes: hybrid nodes
the optimal route construction steps and the data transmis- which detect occupied parking spaces and nodes which
sion between the CHs. detect the density of road traffic in each lane. These nodes
Figure 12 illustrates an example which CH 22 fills its rely on the network topology of the cluster tree to send
neighborhood table with the CHs after reception of the their data packets in order to reach the gateway. Before
nexthop_ClusterHead_MSG messages from different neigh- sending the data packets, each type of sensor prepares
boring CHs (1, 8, and 27). CH 22 deletes the route to the base the detected data to send them to the corresponding CH
station passing through CH 27 because it belongs to the same (Figure 14).
level, and it chooses the optimal route passing through CH 1 Figure 15 illustrates the different packets sent by the dif-
which belongs at the lower level and whose weight is greater ferent nodes of the proposed system.
than that of CH 8. Once the data packets are sent by the various sensors,
When transmitting data, the CHs closest to the base the gateway gathers all the data collected in a correspond-
station will consume more energy compared to the others. ing road crossing and transfers them to the global informa-
Then, it will have a new selection of the new CHs in each tion and management center of the system in order to
cluster in an independent way according to the phase of the update the information available to drivers and also for bet-
CH selection. For each newly selected cluster head, it sends ter and efficient management and control of traffic lights in
a New_nexthop_ClusterHead_MSG broadcast message real time. The management center organizes all the data
containing the residual energy, its CH-Id, its location, its sent by each gateway of each road crossing in the form of
location level, and the identification of its cluster Cluster-Id. a given database in order to facilitate the monitoring of
Each CHi node receiving this message and which belongs parking spaces and also to control the density of traffic in
to the higher level modifies its neighborhood table according the lanes that form each crossing. Figure 16 shows an
to the location level and the Cluster-Id of the new CH example of the situation of lane 2 crossing from packets
selected to make a new selection of a new optimal route to sent by the gateway.
the base station as shown in Figure 13. For lower-level CHs
receiving the same message, they send the nexthop_Cluster- 5. Proposed Algorithm
Head_MSG message to the new CH again so that it can refill
its neighbor table and select the next hop as the best route to Our intelligent traffic control system is based on the imple-
the base station. mentation and deployment of sensor networks in each road
Wireless Communications and Mobile Computing 13
Base station
1 8 Level 1
12 19
10
New_nexthop_ClusterHead_MSG
Cluster head node
message
22 CH-Id New cluster head node
(a)
Neighborhood table of CH 22
CH- Residual Cluster- Cumulative
energy Level Location Weight
Id Id distance
1 E1 1 1 Position 1 dc 1 Weight 1
8 E8 2 1 Position 8 dc 8 Weight 8
10 E8 2 1 Position 10 dc 10 Weight 10
27 E27 2 2 Position 8 dc 27 Weight 27
(b)
Figure 13: (a) Sending a New_nexthop_ClusterHead_MSG broadcast message by the new CH. (b) Example of a neighborhood table and
selection of a new CH.
Figure 14: Data sent by sensor nodes. Crossroad ID is the identifier of the road crossing. Lane ID is the identifier of the road in the
corresponding intersection. Lane direction ID is the identifier of the direction of the road (1 for incoming lanes at the crossing and 2
outgoing lanes). Sensor type is the identifier of the type of sensor (1: detection of parking spaces, 2: detection of traffic in the lane). Node
ID is the node identifier. State is the state detected by the sensor (1: occupied, -0: free), and this field is filled in by the nodes which
monitor road traffic. Parking space state is the state of parking space occupancy, and this field is filled in by the hybrid nodes which
monitor the parking spaces in each lane. Car registration number is the registration number of the parked car captured by hybrid sensors
thanks to the RFID reader.
crossing in order to detect the number of occupied parking information and management center of the system from
spaces in the available parking areas and also to identify the the corresponding gateway in order to increase the lifetime
traffic density in the tracks that form this crossing in order of the system and also increase excellent efficiency and feasi-
to effectively control and manage the traffic lights corre- bility of the system.
sponding to this crossing. To monitor the availability of
parking spaces, the system uses hybrid sensors to detect the 5.1. Behavior of the WSN. In each road crossing, the sensors
presence of vehicles in the available space and also to identify execute a self-organizing algorithm which makes it possible
the car parked by its registration number provided by the to create a cluster tree topology between the different sensor
RFID tag. This system also uses presence sensors installed nodes in order to minimize energy consumption and increase
in the lanes of each road crossing to detect traffic density the life of the nodes due to transmission directly to the gate-
and to manage traffic lights to increase the flow of traffic in way. In each network formed in a crossing, there are two
this crossing. Our system is based on the deployment of the types of sensors. The first sends the status of the parking
cluster network topology so that the different types of sensors space and registration number of the parked car, and the sec-
installed in each crossing can send their data to the global ond sends only the state of the traffic in the corresponding
14 Wireless Communications and Mobile Computing
1 2 1 1 1 0
2 1 1 2 1 1-D-65897
1 4 2 1 4 1 1-A-12345
Car D
Crossroad 1 C B
Car
Gateway
1 4 2 2 2 1
Lane 1 1 2 1 2 1 1
1 1 1 2 1 0
Crossroad 1
Parking Car
Lane Sensor
Node ID Lane state space registration
direction type
state number
1 0
2 1 1-D-65879
1 3 0
Lane 2 4 0
5 0
1
1 1
2 0
2 3 0
4 0
5 0
1 0
2 0
1 3 0
4 0
5 0
2
1 0
2 0
2 3 0
4 0
5 0
lane of this crossing. Each of these nodes plays a specific role in has not changed between the current round and the previous
the network: either a node member of a cluster, which will send round, then the node saves its energy during this round and it
only the detection state to its cluster head, or a head cluster, does not send any data in order to minimize the energy con-
which will then perform the aggregation of this data with the sumption when sending unnecessary and duplicated data.
data received by the member nodes of its cluster to the next CH. The following flowchart (Figure 17) allows nodes to send
In each round and before starting to send the data, each data packets in case there is a change in the detection state.
sensor checks the data detected in the current round with The pseudocode shown in Pseudocode 1 shows the
the data detected in the previous round. If the detection state behavior of different sensor nodes in a road crossing.
Wireless Communications and Mobile Computing 15
Start
Next
round
1: All the nodes of each crossroads execute out self-organization protocol to form a cluster-free network topology
2: Cluster Head Selection in each Cluster
3: For i=1 to N do //N: Number of the crossroad in the city
4: For j=1 to M do //M: Number of the nodes in the crossroad
5: Execute flowchart // execute flowchart of validation of the detection state by the nodes (Figure 17)
6: T⟵flowchart// flowchart: return 1 occupied state, return 0 open state
7: If (T==1)then //return 1 occupied state
8: Sensor node prepares the corresponding data structure with occupied state
9: If (Sensor node is a cluster head) then
10: Sensor node uses the aggregation of all the data received from these members
11: Sends all information to the neighboring Cluster Head or to the Gateway depending on its next hop
12: Else
13: Sensor node prepares the corresponding data structure according to its role in the crossroad
14: Sends those data to its Cluster Head
15: End if
16: Else //return 0 open state
17: Sensor node prepares the corresponding data structure with open state
18: Go to 9
19: End if
20: End for
21: End for
22: Next round
23: Go to 2
Start
No Car Yes
Wait Wait
detected
2 seconds 2 seconds
?
Go to
flowchart of validation of the
detection state by the nodes
Each gateway installed in a road crossing sends all the management center according to the type of sensors which
data collected from the corresponding WSN to the global sent the detected information, that is to say, the data sent
information and management center in order to exploit all by type 1 nodes (see Section 4.4).
the data and send them to the management center for park- Once a car has just parked in a space available in a
ing spaces and also towards the traffic light management concrete crossing, the appropriate sensor detects on the
center. one hand the presence of the vehicle. On the other hand,
the integrated RFID reader reads the driver data using the
5.2. Parking Space Management Center. The parking space RFID tag installed in the vehicle and transfers it by merg-
management center plays a crucial role in detecting the num- ing it with the seat status to the seat management center.
ber of free spaces in each road crossing in the city. This center The data related to parking will be used when paying for
receives the filtered data from the global information and the parking time and also to check for incidents while
Wireless Communications and Mobile Computing 17
Lane 3
Lane 2
Crossroad 1
Lane 4
Gateway
Lane 1
Total nodes in the outgoing lane 2
parking the vehicle. In the case of cars not tagged with Density Lane i
T Lane i = × TL
RFID, a message is sent, with the identifier of the cross- All lane except lane i
Σj = 1 Density Lane j
ing and of the parking space, to the officials responsible
for managing the parking spaces to enter the vehicle reg- Figure 20: The green light time. DensityLane i is the density of lane i
istration number in the system to guarantee payment of and T L is the minimum green light time estimated by the proposed
parking fees. The pseudocode shown in Pseudocode 2 system which varies between 30 and 60 seconds.
shows the management of parking spaces in each road
crossing.
The payment for parking time is made online using the
mobile application (see Section 7) or manually using the from the global information and management center accord-
automatic parking machines available in each lane of a cross- ing to the type of sensors that sent the detected information,
road. In both cases, only the registration number of the that is to say, the data sent by type 2 nodes (see Section 4.4).
parked vehicle has to be entered so that the system can detect The center calculates the number of type 2 sensors in each
it in the database and the owner of the vehicle can make the lane that detected the presence of cars in stable condition.
payment. For this type of nodes, they execute a detection state stability
flowchart (Figure 18) before sending the data packets to the
5.3. Traffic Light Management Center. The traffic light man- gateway, knowing that the states detected in the traffic state
agement center has a fundamental role in controlling road of cars can influence the calculation of traffic density which
traffic by calculating the density of traffic in each lane that may result in poor decisions when estimating the length of
forms a crossing in the city. This center uses the filtered data time for the green light.
18 Wireless Communications and Mobile Computing
Lane 3
Lane 2
Smartphone
Crossroad 1
User
Lane 4
Collect
Gateway
Lane 1
The global information
management center
Distribute Distribute
Collect Collect
The calculation of the road density is based on the cal- Table 3: The simulation parameters.
culation of the rate of cars existing in each lane in a road
crossing taking into account the incoming traffic and also Parameters Value
the outgoing traffic. Figure 19 shows the calculations Standard 802.15.4
made. Communication radius 150 m
Depending on the traffic density calculated, the traffic Sensor radius 2m
light management center will make the decision when esti- Initial energy (E0 ) 4J
mating the length of time for which a traffic light can
ETx 50 μJ
remain green. Several studies have been carried out to
determine and estimate the time for the green light. ERx 50 μJ
Between them, we find Kell and Fullerton [18] who sug- Simulation time 300 s
gest that the maximum time for the green light should
be between 30 and 60 seconds. Orcutt [19] observed that
the maximum time for the green light should be long
enough to allow 1.3 times the average length of the queue and validate distributed algorithms for monitoring, collect-
and minimize the cycles of stops and resumptions. Cour- ing environmental data, etc. and to visualize the operating
age et al. [20] indicated that a maximum high green light concepts of sensor networks and their deployment, and it
time did not have negative consequences if the traffic was can also help scientists test their topologies, protocols,
too light. In [21], the authors propose more modern etc. wirelessly [26]. Figure 22 represents the CupCarbon
methods in order to fix a coherent maximum green light interface, in which our network and our intelligent traffic
time, complex to define due to the complexity and the control system are implemented on the openstreet map
possible diversity of an intersection. On the one hand, (Google Maps) and the sensors are deployed in a real city
the authors of the article [22] estimated the green light (Kenitra, Morocco). The simulator uses a scripting lan-
time in a dynamic and rotating manner according to the guage to encode distributed algorithms called SenScript
density of traffic calculated in each using video surveil- which allows one to program and configure each sensor
lance cameras and video processing techniques. On the node individually.
other hand, our proposed system calculates the green light The simulation is configured as follows:
time T Lane based on the traffic density of each lane which
forms a road crossing taking into account the fact that this (i) There are two road crossings
duration must be between 30 and 60 seconds. Figure 20
(ii) The number of nodes for traffic management is 40
describes the proposed length of green light time.
sensors
Once the green light time is calculated, the traffic light
management center distributes the orders to the traffic lights (iii) The number of nodes for monitoring parking spaces
of each road crossing in order to increase traffic flow and is 40 sensors
reduce congestion.
(iv) There is only one gateway deployed in each crossing
5.4. The Global Information and Management Center. The (v) The sensor nodes are subject to energy constraints;
global information and management center distributes the that is to say, they are not rechargeable
data packets received from the gateway to the parking space
management center and also to the traffic light management The parameters used in the simulation are presented in
center according to the type of sensors that sent the packet. Table 3 and Figure 23.
This center has another important role in our proposed intel- Figure 24 shows the data transmission between the nodes
ligent traffic control system, which is to collect real-time and their cluster (intracluster communication), and
information from these two centers, containing the traffic Figure 25 illustrates the aggregation and data transmission
jam rate in each road crossing and the number of parking between the CHs to the gateway using the cluster tree topol-
spaces available to a given destination, and to update and ogy (intercluster communication).
save them in a MySQL database server to connect drivers The gateway of each crossing executes a Sink.csc script
and citizens to our system via an Android mobile application which allows it to collect all the data received from all the
in order to avoid getting stuck and take another alternative nodes of its corresponding road crossing in order to save
route. Figure 21 illustrates the role of the global information them in a file and send them to the global information
and management center in the proposed intelligent traffic and management center. Figure 26 illustrates the data
control system. received by the gateway according to the data structure
used by our intelligent traffic control system.
6. Simulation and Results
6.2. Simulation Results and Analysis. To assess the perfor-
6.1. Simulation Platform. To simulate our algorithm, we mance and quality of service of our proposed system, we sim-
used the CupCarbon simulator [2–25]. It is a smart city ulated our system in three types of traffic density scenario:
and Internet of things wireless sensor network simulator 40%, 60%, and 80%, and we will compare it with existing traf-
(SCI-WSN). Its objective is to design, visualize, debug, fic control systems using the following performance
20 Wireless Communications and Mobile Computing
Figure 26: The data received by the gateway in each road crossing.
measures: energy consumption, first node death (FND) and of cars in circulation. That is to say, only 40% of the sen-
network lifetime (NL), and packet delivery ratio (PDR). sors will send their stable detection states which will con-
sume energy during data transmission. On the other hand,
6.2.1. Energy Consumption. The energy consumption is the the other systems do not execute any algorithm of stability
amount of energy consumed by the nodes in relation to a and there is no process of verification of the states of
number of revolutions. The main objective of this experiment detection of the sensors, which causes the transmission
is to compare the influence of the density of road traffic on of useless and duplicated data in each round which will
the energy consumption of the whole network. Figures 27– increase energy consumption and rapid depletion of these
29 show the experimental results. nodes and the WSN.
During 40% of traffic density, our proposed system At 60% of traffic density, our system consumes more
consumes less energy in the first rounds because the detec- energy compared to 40% of traffic density; this is due to
tion states of the sensors change rapidly with the number the increased number of cars in circulation, which leads
22 Wireless Communications and Mobile Computing
100
60
40
20
0
0 50 100 150 200 250 300
Simulation time (s)
Proposed S2
S6 S4
S5 S3
S1
100
Energy consumption (%)
80
60
40
20
0
0 50 100 150 200 250 300
Simulation time (s)
Proposed S2
S6 S4
S5 S3
S1
to the sending of more data in the network. For the other main metrics. The first is the time until the death of the
systems, there is no change in energy consumption, first node (FND). The FND duration is considered a
because the sensor nodes used in these systems send data period of stability for the network since a node becomes
during each round. dead during this period. The second is the total network
On the other hand, in 80% of traffic density, our sys- life which represents the time that there is no more node
tem consumes a significant amount of energy in the first to continue the communication; this time is called
rounds, because there are a high number of cars that cir- network life (NL). The result illustrated in Figures 30–32
culate in the city roads. But, in the last rounds, we observe concerns the lifetime of the network.
that there is a stability of energy consumption in the net- In the 3 illustrations, we observe that our proposed
work, because the detection states of our sensors have not system increases the lifetime of the network based on the
changed, due to the high traffic jam rate on the roads and deployment of an efficient and effective network topology
less car traffic. which adapts to the change in the density of existing
traffic in the roads, which allows it to be an intelligent
6.2.2. First Node Death (FND) and Network Lifetime (NL). and innovative system. On the other hand, the other exist-
We represent the lifetime of the network based on two ing systems use simple and standard algorithms which
Wireless Communications and Mobile Computing 23
100
60
40
20
0
0 50 100 150 200 250 300
Simulation time (s)
Proposed S2
S6 S4
S5 S3
S1
200
150
100
50
0
FND NL
Proposed S2
S6 S4
S5 S3
S1
Figure 30: Comparison of the network lifetime with 40% of traffic density.
200
150
100
50
0
FND NL
Proposed S2
S6 S4
S5 S3
S1
Figure 31: Comparison of the network lifetime with 60% of traffic density.
200
150
100
50
0
FND NL
Proposed S2
S6 S4
S5 S3
S1
Figure 32: Comparison of the network lifetime with 80% of traffic density.
the traffic of data transmitted over the network and it center sends the collected information, from the parking
also reduces the loss of packets sent. In addition, the pro- space management center and also from the traffic light
posed system is based on an intelligent and efficient algo- management center, to a central web server to display
rithm which allows nodes not to send duplicate data in the available parking spaces and the traffic jam rate in each
every round, as this injects more useless data into the road crossing of the city and update them in the MySQL
network and it minimizes the lifespan of nodes and net- database automatically. Clients of our proposed system
work longevity. (computers, smartphones, tablets, etc.) will make HTTP
requests containing the URL of the central server via the
7. Mobile Application Internet. Once the request has arrived at its destination,
it first passes through an API (Application Programming
The global information and management center of our Interface) which has a procedure which will associate the
proposed intelligent traffic control system connects drivers form of the URL with an action to be performed. This
to city streets via an Android mobile application compared API will communicate and dialogue with the server to
to other existing traffic control systems. This management retrieve the data. It retrieves the result and formats it in
Wireless Communications and Mobile Computing 25
PDR (%)
40 40
30 30
20 20
10 10
0 0
Proposed S2 Proposed S2
S6 S4 S6 S4
S5 S3 S5 S3
S1 S1
Figure 33: Comparison of the packet delivery ratio with 40% of Figure 35: Comparison of the packet delivery ratio with 80% of
traffic density. traffic density.
40
(3) Suggestion of Alternative Routes. It allows alternative
30 routes to be offered around the given destination.
20
Figures 38 and 39 illustrate the design of our Smart Traf-
10 fic application.
0 With the help of this android application, drivers and cit-
izens can remotely view the traffic jam and available parking
Proposed S2
spaces in real time to avoid unnecessary trips in order to min-
S6 S4
imize road traffic on the roads and minimize dissipation of
S5 S3
CO2 in the city.
S1
Internet
Database server
(MySQL)
HTTP-JSON
(a) (b)
Conflicts of Interest
The authors declare that there are no conflicts of interest
regarding the publication of this paper.
References
[1] J. Lloret, S. H. Ahmed, D. B. Rawat, W. Ejaz, and W. Yu, “Edi-
torial on wireless networking technologies for smart cities,”
Wireless Communications and Mobile Computing, vol. 2018,
Article ID 1865908, 3 pages, 2018.
[2] A. Zanella, N. Bui, A. Castellani, L. Vangelista, and M. Zorzi,
“Internet of things for smart cities,” IEEE Internet of Things
Journal, vol. 1, no. 1, 2014.
[3] P. Vlacheas, R. Giaffreda, V. Stavroulaki et al., “Enabling smart
cities through a cognitive management framework for the
internet of things,” IEEE Communications Magazine, vol. 51,
no. 6, pp. 102–111, 2013.
Figure 39: The search results and the alternative routes. [4] P. Chamoso, A. González-Briones, S. Rodríguez, and J. M.
Corchado, “Tendencies of technologies and platforms in smart
cities: a state-of-the-art review,” Wireless Communications and
28 Wireless Communications and Mobile Computing
Mobile Computing, vol. 2018, Article ID 3086854, 17 pages, Business, Engineering and Science, pp. 254–258, Hong Kong,
2018. China, August 2010.
[5] R. Zitouni, J. Petit, A. Djoudi, and L. George, “IoT-based urban [18] J. H. Kell and I. J. Fullerton, Manual of Traffic Signal Design,
traffic-light control: modelling, prototyping and evaluation of Prentice-Hall, Englewood Cliffs, NJ, USA, 3rd edition, 1998.
MQTT protocol,” in 2019 International Conference on Internet [19] F. L. Orcutt Jr., The Traffic Signal Book, Prentice-Hall, Engle-
of Things (iThings) and IEEE Green Computing and Communi- wood Cliffs, NJ, USA, 1993.
cations (GreenCom) and IEEE Cyber, Physical and Social Com-
[20] K. G. Courage, J. Z. Luh, and C. E. Wallace, Development of
puting (CPSCom) and IEEE Smart Data (SmartData), pp. 182–
Guidelines for Implementing Computerized Timing Designs at
189, Atlanta, GA, USA, 2019.
Traffic Actuated Signals, Transport Research Center, Gaines-
[6] S. Latif, H. Afzaal, and N. A. Zafar, “Intelligent traffic monitor- ville, FL, USA, 1989.
ing and guidance system for smart city,” in 2018 International
Conference on Computing, Mathematics and Engineering [21] G. Zhang and Y. Wang, “Optimizing minimum and maximum
Technologies (iCoMET), pp. 1–6, Sukkur, Pakistan, 2018. green time settings for traffic actuated control at isolated inter-
sections.,” IEEE Transactions on Intelligent Transportation
[7] P. Sadhukhan and F. Gazi, “An IoT based intelligent traffic
Systems, vol. 12, no. 1, pp. 164–173, 2011.
congestion control system for road crossings,” in 2018 Interna-
tional Conference on Communication, Computing and Internet [22] K. Dangi, M. S. Kushwaha, and R. Bakthula, An Intelligent
of Things (IC3IoT), pp. 371–375, Chennai, India, 2018. Traffic Light Control System Based on Density of Traffic,
[8] M. Lewandowski, B. Płaczek, M. Bernas, and P. Szymała, Emerging Technology in Modelling and Graphics, Springer,
“Road traffic monitoring system based on mobile devices and 2019.
bluetooth low energy beacons,” Wireless Communications [23] K. Mehdi, M. Lounis, A. Bounceur, and T. Kechadi, “CupCar-
and Mobile Computing, vol. 2018, Article ID 3251598, 12 bon: a multi-agent and discrete event wireless sensor network
pages, 2018. design and simulation tool,” in Proceedings of the Seventh
[9] W. Zhang, G. Tan, N. Ding, and G. Wang, “Traffic congestion International Conference on Simulation Tools and Techniques,
evaluation and signal control optimization based on wireless pp. 126–131, Lisbon, Portugal, March 2014.
sensor networks: model and algorithms,” Mathematical Prob- [24] S. Shamneesh, M. Manoj, and K. Keshav, “Node-level self-
lems in Engineering, vol. 2012, Article ID 573171, 17 pages, adaptive network path restructuring technique for Internet of
2012. things (IoT),” in Intelligent Communication, Control and
[10] K. Zaatouri, M. H. Jeridi, and T. Ezzedine, “Adaptive traffic Devices, pp. 453–461, Springer, 2018.
light control system based on WSN: algorithm optimization [25] N. Kadjouh, A. Bounceur, A. Tari, L. Lagadec, R. Euler, and
and hardware design,” in 2018 26th International Conference M. Bezoui, “A new leader election algorithm based on the
on Software, Telecommunications and Computer Networks WBS algorithm dedicated to smart-cities,” in Proceedings of
(SoftCOM), pp. 1–6, Split, Croatia, 2018. the 3rd International Conference on Future Networks and Dis-
[11] R. Singh, P. Singh, and K. Yadav, “Wireless communications tributed Systems - ICFNDS '19, pp. 1–5, Paris, France, 2019.
enlargement: a review of advancement in technologies,” Inter- [26] “CupCarbon simulator,” http://www.cupcarbon.com.
national Journal of Current Engineering and Technology, vol. 4,
no. 4, 2014.
[12] A. Triantafyllou, P. Sarigiannidis, and T. D. Lagkas, “Network
Protocols, Schemes, and mechanisms for Internet of things
(IoT): features, open challenges, and trends,” Wireless Com-
munications and Mobile Computing, vol. 2018, 24 pages, 2018.
[13] B. Jan, H. Farman, H. Javed, B. Montrucchio, M. Khan, and
S. Ali, “Energy efficient hierarchical clustering approaches in
wireless sensor networks: a survey,” Wireless Communications
and Mobile Computing, vol. 2017, Article ID 6457942, 14
pages, 2017.
[14] N. Sabor, S. Sasaki, M. Abo-Zahhad, and S. M. Ahmed, “A
comprehensive survey on hierarchical-based routing protocols
for mobile wireless sensor networks: review, taxonomy, and
future directions,” Wireless Communications and Mobile Com-
puting, vol. 2017, Article ID 2818542, 23 pages, 2017.
[15] H. Farman, H. Javed, J. Ahmad, B. Jan, and M. Zeeshan, “Grid-
based hybrid network deployment approach for energy effi-
cient wireless sensor networks,” Journal of Sensors, vol. 2016,
Article ID 2326917, 14 pages, 2016.
[16] A. Hilmani, A. Maizate, and L. Hassouni, “Hierarchical proto-
col based on recursive clusters for smart parking applications
using Internet of things (IOT),” Wireless Communications
and Mobile Computing, vol. 2020, Article ID 9179530, 21
pages, 2020.
[17] X. H. Wu and S. Wang, “Performance comparison of LEACH
and LEACH-C protocols by NS2,” in 2010 Ninth International
Symposium on Distributed Computing and Applications to