Keywords

11.1 Introduction

A considerable number of people are migrating to urban areas and predicted that by 2030, With over 60% of worldwide people will live in cities 2050 [1, 2]. Cities all over the world are confronting numerous problems and issues as a result of the rapid growth of the urban population. This circumstance has increased the urgency of finding better solutions to the problems. ICF (Intelligent Community Forum) has developed the Smart 21 community, which yearly announces several cities with high scores in five areas evaluated by the neighborhoods (Broadband access, a skilled workforce, digital inclusiveness, innovation, marketing, and advocacy are all examples.) A smart city is a dynamic and constantly growing urban, complex, and distributed system in nature. Complex systems, such as the nervous system or societies, are examples of complex systems. The overall behaviors of the system are determined by these individual behaviors. The trend toward smart cities also renders them vulnerable to new computerization technologies that could be integrated into services that already have infrastructure [3]. From sociological, technological, and urban aspects, smart cities are defined [4,5,6]. Smart cities, according to the definition given in [7], include boosting the city’s computerization in numerous other areas such as both to enhance quality and economic expansion.

The Internet of Things (IoT) uses modern ubiquitous communication methods to bring the digital world into the physical world. Many commonplace items, such as networked cellphones and tablets, have distinct traits and are also linked to the Web. The Internet of Things (IoT) focuses on the configuration, operation, and connectivity of “Internet of Gadgets” or “Things” that have never been connected to the Internet, thermostats, for example, electrical equipment, appliances, utility meters, medical gadgets, cameras, and other sensors are all examples of sensors [8]. The IoT ushers in a new era of Internet-connected endpoint possibilities. IoT applications can be found in a variety of industries, including homes, cities, the ecosystem, energy sources, retail, transit, industrial, agro, and healthcare. Experts estimate that by 2025, The Internet of Things will have an $11 trillion annual hidden impact, which is comparable to 11% of the global GDP [9]. By 2035, it is estimated that users will have installed a total of 1 trillion IoT devices [10]. More than merely connecting items to the internet is at the heart of the IoT. The IoT enables these gadgets to exchange information while accomplishing a critical task for a basic human or machine purpose. To obtain useful pieces of information and/or its users, as well as the surroundings and activities, Currently, IoT data makes up the vast majority will be cloud servers that are used to save and process data. Cloud computing systems are highly scalable and may be scaled up or down promptly “pay-per-use” model, reducing the cost of developing the required analytics application. Existing data analytics techniques can handle the massive amounts of data processing in a managed cloud network, on the other hand, falling short of the standards for the reasons listed below [11]. A number of innovative and real-life applications are being developed as a result of the exponential growth of Internet of Things (IoT) devices. A resource-constrained fixed node or a mobile node is used by IoT to support such applications [12].

  1. (a)

    Cloud providers (CPs) aspire to create data centers in faraway locations with low-cost resources to lower cloud service running expenditures since cloud servers positioned far from sensing nodes struggle to analyze real-time data for connection applications. The physical distance between servers increases the time it takes for data to be transmitted. This is inefficient for time-sensitive applications, which frequently have milliseconds or even microsecond data transmission delays. Whenever sensors on oil refineries sense a pressure shift in oil extraction, for example, rapid action is required to avoid disaster by automatically shutting down pumps.

  2. (b)

    The volume of data generated by IoT continues to grow, causing the cloud to become significantly overburdened. IoT technology is a cloud-based system that incorporates a range of sensing, identification, communication, networking, and data management devices. It is inefficient to send massive amounts of data generated by millions of IoT devices [13] for storage and analysis to the cloud. This could cause network bandwidth to be overburdened, as well as place a strain on the data center [14]. The study’s major purpose is to employ IoT to create an intelligent traffic system. In addition, the proposed approach is more user-friendly than existing alternatives.

11.1.1 Problem Statements

Traffic congestion and delays are caused by the lack of an effective emergency vehicle traffic management system, which replaces the flawed and inefficient manual method. Using a smart city-like traffic control service, this research evaluates the feasibility of implementing a scientific testbed in the cloud. Establishing stateful data-driven IoT services at a scalable scale with real-time limits.

The rest of the paper is organized as follows: The literature reviews are discussed in Sect. 11.2. The suggested system’s architecture is described in Sect. 11.3, and the mathematical model of the system also the system’s result analysis and methodology are represented in Sects. 11.4 and 11.5. Finally, the study’s findings and future directions are presented in the final part.

11.2 Related Works

In our modern-day, the urban population is rapidly rising, which has a significant impact on daily living, particularly transportation. For the rapidly growing population, Cities in rising countries such as Delhi, Dhaka, and many others continue to adopt the old vehicle management technique. According to a report published by the United Nations, around 55% of the world’s majority population lives in cities in 2018, with the rate of increase in Asia and Africa expected to reach 90% by 2050. According to recent research, Japan, which holds one of the top ITS [Intelligent Transportation System] jobs, collects real-time data using two ways, which helps to reduce congestion. One method is to implant sensors in roadside barriers, while another is to use smartphones [16].

In such parts of India, to ease traffic congestion, MATLAB, KEIL (Microcontroller coding)-based devices, and surveillance cameras are used [19]. Because the system was difficult to deploy and expensive, some provinces now employ detection of the shortest route and infrared to sensors evaluate traffic density. Temperature and humidity, however, affect the IR sensor. As a result, the result obtained by the IR sensor was not correct. The density of traffic in Pakistan is measured using cameras and sensors. Pakistan regulates traffic signaling based on the data gathered by the sensors. A smoke sensor was also utilized to identify an emergency scenario, such as a fire accident [20]. Rain and fog can wreak havoc on the camera’s sensitivity. It’s also not economical. In Nepal, 35 traffic crossings use wireless traffic data and CCTV live video. To avoid traffic congestion, the system may modify signal policies and divert traffic [21].

Swathi and her colleagues demonstrated a traffic control scheduling system that determines the shortest and least crowded route. To get information on the density of traffic, sensors are used, which are powered by solar and battery power. As an object approached, sensors continued to transmit infrared light, and assess traffic density, they studied the reflected light from the vehicle. The readings may vary if the temperature and humidity alter [22]. Al-Sakran et al. created a system whose main goals had been to use sensors as well as RFIDs to recognize cars and evaluate their location, then send the information to a central control unit for further processing via a wireless link [23] (Table 11.1).

Table 11.1 Different existing approaches

11.3 Proposed System

Sensors are used in the proposed model described in Fig. 11.1, video surveillance, and RFID tags are placed on the roadside to regulate traffic on road networks. The proposed system (shown in Fig. 11.1) uses sensors, video surveillance, and RFID tags placed on the roadside to regulate traffic on road networks users can also use it to predict traffic congestion on a certain road. There are three layers to the system.

  1. (1)

    Layer for data capture and gathering.

  2. (2)

    The layer of Selection and Data Analysis

  3. (3)

    A layer of Actuation and Utilization.

Fig. 11.1
An illustration depicts the relationship between the data acquisition and collection layer, data computation and processing layer, and application and actuation layer.

The model of the smart road traffic system

11.3.1 Layer for Data Capture and Gathering

To identify traffic in the current state of the art, researchers have used ultrasonic waves, RFIDs, video monitoring, and laser beams. All of these sources are good candidates for the proposed system. They include surveillance cameras, ultrasonic sensors, RFIDs, smoke detectors, and flame sensors. Surveillance cameras are the most often used source for detecting road traffic in this field because of their efficiency and ease of maintenance [25,26,27,28]. The blob identification method [28] is used on the video stream at the local server because of its speed and noise reduction capabilities. Following traffic detection, a local server sends the density determined by image processing to the required microcontroller.

This technology uses ultrasonic sensors in addition to cameras to improve precision. Sensors are an important component for identifying traffic density in numerous traffic management system applications represented in [24]. It works out the distance by sending out a sound wave at a specific frequency and listening to the reply. This inexpensive sensor can detect distances ranging from 2 to 400 cm [29]. The system uses the formula below to compute the distance.

$$ Distance=\left(\frac{\left(a\times b\right)}{2}\;\right) $$
(11.1)

where ‘a’ is represented as sound speed and ‘b’ defines as the time taken

Figure 11.2 shows IOT-based traffic management, which describes how easy it is to identify a path for an emergency in an ambulance, as well as how traffic violators are identified and transferred to the police. To compute the traffic density, As indicated in Fig. 11.3, three pairs of sensors are embedded on a chord side of a section at a particular distance. The readings of each sensor are either 1 or 0. At the node level, density is calculated by combining the signals from all of the sensors put along that particular road.

Fig. 11.2
An illustration depicts that the raspberry is connected to WiFi system, camera, and signal system.

The proposed smart road traffic system

Fig. 11.3
An illustration of a 4 way road. It depicts signal light, an ultrasonic sensor, and a surveillance camera.

Wireless sensor network in the road traffic system

$$ \sum \limits_{i=1}^3(Si)={s}_i+{s}_{i+1}+{s}_{i+2} $$
(11.2)

The pair of ultrasonic sensors is signified as S. The statuses of the sensors are shown in Table 11.2, and the results are as follows:

Table 11.2 Ultrasonic sensors measure shows traffic density

Where S1, S2, S3 are sensors and C1, C2, C3 are different conditions. Also, L, M, and H are represented as High, Low, and Medium traffic density. The microcontroller uses Table 11.3 to determine cumulative density after receiving data using sensors, as well as video from a local server.

Table 11.3 Cumulative density

11.3.2 The Layer of Selection and Data Analysis

Based on the present situation, the system regulates traffic flow. In the beginning, respectively traffic signal takes a predetermined time in seconds when there is typical traffic on the road. Each signal goes green for a few seconds, but the other signals at an intersection remain red until all traffic signals have completed their turns. Because the traffic ratio is increasing day by day, our current fixed-time signal control system is not performing properly in this circumstance. The density-based traffic control module must be able to dynamically assign lanes at their times based on traffic density. After Step 1, when the traffic capacity is increased and flow fluctuates, the algorithm calculates the level of density using Table 11.2. A traffic light’s time is modified based on the volume of traffic. It is also subjected to the algorithm’s traffic control techniques.

Algorithm 1: Traffic Management Algorithm

  • Phase 1: When there is no emergency vehicle in sight

    1. 1.

      if (TD == H)  //Traffic Density = TD

    2. 2.

      if (RI == Yes)   //Rush Interval = RI

    3. 3.

      Time = ((α × ex × sinθ) + β) + y

    4. 4.

      else

    5. 5.

      Time = (α × ex × sinθ) + (cosθ × y) + β

    6. 6.

      else if (RI = =Yes)

    7. 7.

      Time = (α × ex × sinθ) + y

    8. 8.

      else

    9. 9.

      Time = α

  • Phase 2: RFID tags are activated when an emergency vehicle is detected.

    1. 1.

      While (vehicle Exits = = True)

    2. 2.

      Time! = 0

Algorithms 2: Vehicle Counter Algorithm

  1. 1.

    Assume that the objects identified by the IR Sensors are automobiles.

  2. 2.

    int ƞ = 0;  # ƞ is counter

  3. 3.

    int O1 = false;  // O1 is hit object

  4. 4.

    int V1;

  5. 5.

    Step 1: Read the sensor’s value (V1). If a car is spotted, the sensor outputs 0; otherwise, it outputs 1.

  6. 6.

    Step 2: If val == 0, O1 = false then increment the counter and set O1 = true.

  7. 7.

    else if val == 1, O1 = true

  8. 8.

    then set O1 = false.

  9. 9.

    Step 3: Go to step 1

11.3.3 The Layer of Actuation and Utilization

This layer explains the duration of a green signal from node to traffic light, as well as daily, weekly, monthly, and yearly data to a centralized server’s web application for smart traffic control system administration. To begin, the technology uses the regression tree methodology it analyses data recorded on the server-side of a local server to estimate rush intervals, and it communicates this information to the centralized server every day (after 24 h). In the system, a rush interval is specified as thirty minutes. This report is again shown on a user interface connected to a centralized server that manages a smart traffic management system and displays graphs of rush intervals for roadways on a daily, weekly, and monthly basis. Monthly, and yearly basis. Future road design and resource management will benefit from this graphical data.

Second, the server notifies the relevant information to the microcontroller, together once the actuation module recognizes the rush interval, the route id is used. The length of the green signal is adjusted by the decision-making module to the associated traffic signal after receiving the rush interval notification. In today’s society, lost time is pricey, and time equals money, knowing the traffic conditions on a given road before traveling on that road is essential, which can be done with the help of a smartphone app. In addition, if smoke or fire is detected on the road, this system can handle the situation. The system uses a mobile application to notify the appropriate department in the region, flame sensors detected a roadside fire, while smoke sensors detected significant smoke in the system.

11.3.4 Component Description of Proposed System

11.3.4.1 HC-SR04 Ultrasonic Sensors

The sensor head of the HC-ultrasonic SR04 creates an ultrasonic pulse and detects the reflected wave from the target. The distance to the target is calculated using the period between emission and reception. Ultrasonic sensors HCSR04 are utilized in this system to assess traffic density on roadways at a frequency of 40 kHz, with a detection range of 2 cm to 400 cm [30].

11.3.4.2 Arduino Mega 2560 Controller

The Arduino Mega 2560 is a microcontroller with 16 analog inputs, 54 digital input/output pins, four UARTs, a 16 MHz crystal oscillator, an ICSP connector, a USB connection, a reset button, and a power jack. It is based on the ATmega2560-family [31].

11.3.4.3 RFID Sensor Module

The TMF RC-522 RFID module recognizes and tracks tags attached to goods using electromagnetic fields. By scanning a person’s RFID tag with a non-contact card reader chip that is low-cost and tiny in size, this device detects a signal violation.

11.3.4.4 ESP8266 Wi-Fi Module

The ESP8266 Wi-Fi Module, which is based on TCP/IP, has powerful enough processing capabilities to allow it to be combined with sensors while operating with minimal load. On the server side, the system under control was also used to convey real-time data [32].

11.3.4.5 LED Signal

When IoT devices and sensors are connected to a lighting system, additional capabilities can be provided with a simple user interface. A timer is used to control the traffic LED signals light.

11.3.4.6 IR Sensor

An infrared sensor is an electrical device that uses infrared light to detect environmental features. An infrared sensor can both detect motion and measure the temperature of an object. Almost everything emits some form of infrared heat radiation. These are infrared radiations that are invisible to the naked eye but may be detected by an infrared sensor. The number of vehicles on the route is counted using an infrared sensor.

11.3.5 Software

IoT analytics develops channels for plotting real-time graphs by analyzing real-time traffic data. The Arduino programming language was used to create this work. The data from the sensors is sent with the help of the ESP8266 Wi-Fi module to the server, which is controlled by a microcontroller. Sensor data is stored in a server database for later processing. The Arduino IDE is used to burn the uploaded system code, which is user-friendly and trustworthy. The Traffic Wallet mobile app was created with Android Studio. The proposed Signal prototype model is shown in Fig. 11.4.

Fig. 11.4
A photograph of someone working on the model.

Proposed prototype model of traffic lights signal module

11.4 Mathematical Modelling of Systems

This section introduces the suggested smart traffic light system mathematical modelling. Vehicle velocity, vehicle position, and the cost function, all expressed as ordered pairs, dominate the system. The speed of approaching vehicles at the intersection is defined as

$$ V{e}_i(t)=\left[V{e_i}^{\prime }(t),V{e_i}^{{\prime\prime} }(t)\right] $$
(11.3)

where Vei(t) is the rear endpoint and Vei(t) is the front endpoint

$$ V{e_i}^{\prime }(t)=\min \left\{V{e_i}^{\prime}\left(t-1\right)+1,{E}_i(t),V{e_{\textrm{max}}}^{\prime }(t)\right\} $$
(11.4)
$$ V{e_i}^{{\prime\prime} }(t)=\max \left\{V{e_i}^{{\prime\prime}}\left(t-1\right)+1,{E_i}^{\prime }(t),V{e_{\textrm{max}}}^{{\prime\prime} }(t)\right\} $$
(11.5)

where,

  • \( V{e}_i^{\prime /{\prime\prime}}\;\left(t-1\right) \)is the rear endpoint/At step t, the position of the vehicle it’s the front end

  • Ei(t) is at time step (t), in front of the vehicle (i) there are several empty cells

  • \( V{e}_{\textrm{max}}^{\prime /{\prime\prime}}\;\left(t-1\right) \)is the rear end/front end maximum vehicle i at the time step t

The vehicles’ location,

ƕi(t) = [ƕi(t), ƕi(t)] are updated concerning the vehicle’s speed:

$$ {h_i}^{\prime}\left(t+1\right)={h_i}^{\prime }(t)+V{e_i}^{\prime }(t) $$
(11.6)
$$ {h_i}^{{\prime\prime}}\left(t+1\right)={h_i}^{{\prime\prime} }(t)+V{e_i}^{{\prime\prime} }(t) $$
(11.7)

where,

  • \( {h}_i^{\prime /{\prime\prime}}\left(t+1\right) \) is the predicted rear endpoint/At step t + 1, the position of vehicle i’s front end.

  • \( {h}_i^{\prime /{\prime\prime} }(t) \) is the current rear endpoint/At step t, the position of vehicle i’s front end.

The cost of alternative control actions is determined using a cost function, and choose and perform the control action that has the lowest cost. The cost is expressed in time delay intervals.

\( c\left(\upalpha \right)=\left[c{\left(\upalpha \right)}^{\prime },c{\left(\upalpha \right)}^{{\prime\prime}}\right] \) and it is derived by:

$$ {c}^{\prime}\left(\upalpha \right)=\min \left\{\sum \limits_i\sum \limits_i{n_i}^{\prime }(t),\sum \limits_i\sum \limits_i{n_i}^{{\prime\prime} }(t)\right\} $$
(11.8)

where,

$$ {n_i}^{\prime }(t)=\left\{\begin{array}{c}1,V{e_i}^{\hbox{'}}(t)=0,\\ {}0, otherwise\end{array}\right. $$
$$ {n_i}^{{\prime\prime} }(t)=\left\{\begin{array}{c}1,V{e_i}^{{\prime\prime} }(t)=0,\\ {}0, otherwise\end{array}\right. $$

11.5 Results and Discussion

The wireless sensor nodes, which are made up of sensors, are the system’s first and most important component. The sensors interact with the physical world, such as the presence or absence of cars, and the data from the sensors is sent to the central microcontroller by the local server. This system involves in each direction, the 4 × 2 sensor nodes array. This denotes four tiers of traffic and two lanes in each direction. Ultrasonic sensors provide information based on a vehicle’s proximity. The sensor nodes send data to a central microcontroller stationed at each intersection at predetermined intervals. The signal is received by the microcontroller, which calculates which road and which lane should be used based on traffic density. The Microcontroller’s computed data is then sent to a local server via Wi-Fi and cloud connections. The data acquired by the controller is used by the controller to execute Intelligent Traffic Routing. The fundamental goal of this system is to acquire information from moving cars via WSN to provide them with a clear path to their destinations, and traffic signals should alter automatically to offer these cars a clear path.

The design was constructed to demonstrate the applicability of our suggested strategy. The suggested algorithm’s efficiency was tested using real-world traffic data in a series of experiments. Vehicle detection was utilized to track and calculate traffic density, as seen in Fig. 11.4. When a road’s traffic density surpasses a predetermined level, Until the situation on the road returns to normal, the system suspends normal activities and displays the green signal. Data was sent to the cloud, as well as a local and central server, in a real-time system.

In addition, as discussed in Sect. 11.3, a traffic update interface was created to allow authorities to make real-time and long-term decisions about traffic. Figure 11.5 depicts statistical traffic data, such as the vehicles passing on a certain road during a given time.

Methodologies, the traffic lights inside this system are LEDs, and the vehicle tracking sensor is an ultrasonic sensor. These blocks are physically connected to the microcontroller. Based on the distances measured by the ultrasonic sensor and the time between those measurements, the Microcontroller calculates the number of cars on the street of the intersection it is monitoring. A traffic light controller is a microcontroller that receives sensor data and switches between green, yellow, and red traffic lights. The microcontroller communicates the number of cars to the local server every minute. The serial port on the microcontroller is used for this communication. The data is exchanged between the local server and the cloud server to be able to predict changes in traffic signal timing, this information is transmitted through Wi-Fi. The cloud server, in particular, uses an equation to compute the time interval of LEDs required for smooth traffic flow based on the data collected (number of cars). After that, the estimated time is compared to the current LEDs’ actual time. The server then makes a choice. The green time will be increased if the computed time is less than the current true green time; else, it will be decreased.

11.5.1 Different Lanes and Signal View

LANE 1 has a green signal and is currently open in Pt. – 1, LANE 4 has a yellow signal and is ready to go, however, LANE 2 and LANE 3 are blocked. Because the number of vehicles in LANE 3 exceeds the threshold value, the route leading to LANE 2 of Pt. – 1 is blocked in Pt. – 2. As a result, they are rerouted through different lanes. (Assume the present intersection is point 1 and the previous intersection is point 2.) Figure 11.5 depicts a comprehensive view of the lane (Figs. 11.6, 11.7 and 11.8).

Fig. 11.5
An illustration depicts the sensors and signals at lanes 1, 2, 3, and 4, respectively.

Signals at different lanes

Fig. 11.6
An illustration depicts signals at lanes 1, 2, 3, and 4, respectively.

Signal at lane 1

Fig. 11.7
An illustration depicts signals at lanes 1, 2, 3, and 4, respectively.

Signal at lane 2

Fig. 11.8
An illustration depicts signals at lanes 1, 2, 3, and 4, respectively.

Signal at lane 3

Lane 1 has a green signal, while the other lanes have a red signal.

Lane 2 is open with a green signal, while the remaining lanes are closed with a red signal in the diagram above

Lane 3 has a green light, while the other lanes have a red signal, and Lane 4 will receive a green signal automatically.

11.5.2 Sequence Diagram of Signal Control System (Fig. 11.9)

The suggested system improves time-based monitoring and hence offers various advantages over the current technique, including fewer accidents, cheaper fuel costs, and remote controllability, to name a few. The proposed technology is designed to manage traffic congestion and keep track of the number of vehicles on the route. The system administrator has access to the local server and can utilize it to keep the system up to date.

Fig. 11.9
An illustration consists of a vehicle, sensor, microcontroll, and signal. The arrows mark Send the traffic info, set signal, and set signal time.

Sequence diagram of signal control system

A real-time traffic monitoring system based on ultrasonic sensors can detect traffic density on highways. When there is a lot of frequency, it is a green path, and when the density is low, it is red. The technology may also detect users who break the rules and determine whether or not their license has expired. The system can immediately take action against such a guilty person by issuing a fine. The data was transferred to and stored on a cloud server for further analysis.

11.6 Conclusion

The Smart Traffic Management System was made possible by merging various IoT hardware components. The Internet of Things (IoT) is being used to improve traffic flow by giving each traffic light changing timings based on the number of vehicles on the route. To successfully deal with traffic congestion and conduct re-routing at road crossings, the Smart Traffic Management System is used. This study offers a practical solution for the fast-growing traffic flow, in major urban areas, which is increasing every day, and current traffic management systems have some difficulties in successfully controlling current traffic. A smart traffic management system is introduced that uses the most up-to-date traffic management technique to improve the efficiency and effectiveness of road traffic control. It communicates with the local server to adjust signal timing automatically based on traffic density on the specific roadside, allowing it to better regulate traffic flow than ever before. Because the system continues to work even if a central or local server crashes, the decentralized technique optimizes and boosts efficiency. In the event of a catastrophe, the centralized server notifies the nearest fire brigade, ensuring human safety as soon as possible. A user can also find out how much traffic is expected on a particular road, saving time spent stuck in traffic. Higher authorities can use the technology to help with road design, which helps with resource optimization.