Designing an Intelligent Real-Time Public Transportation Monitoring System Based on IoT ()
1. Introduction
Public transportation refers to shared passenger transportation services such as buses, trolleybuses, trains, ferries, and expresses transportation like the metro [1]. Intelligent Transportation Systems (ITS) has a subsystem called Smart Public Transportation (SPT). It can intelligently monitor public transit networks to ensure their operation and to provide clients with information on excursions and system operating conditions [2]. Smart public Design of an intelligent real-time Public Transportation Monitoring System based on IoT transport systems, depending on several technologies, allows SPTS to retrieve data from multiple sensor systems and to manage and control the transportation network. There are many innovative technologies, which promoted the development and implementation of smart public transport systems, such as Geographical Information Systems (GIS), Automatic Vehicle Location Systems (AVLS) and Traveler Information Systems (TIS) [3]. The Internet of Things (IoT) is a network of interconnected physical objects that can be accessed through the internet. As countries aim to improve their citizens’ standard of living, they begin to improve the infrastructure of their cities, towns, and villages. Improving public infrastructure would also require bettering city transit services. In cities, bus services are the backbone of the public transportation system (PTS). Because of many issues such as wait times, traffic congestion, etc., the reliability of public transport is being diminished; SPTS is using IoT to avoid any of these issues [4]. Wireless communication is the transmission of data between two or more points without the use of wires or cables. There are several technologies used to manage and control public transportation systems [5].
Through combining information technology, advanced techniques, and smart sensing systems, previous works show that different wireless technologies manage and monitor smart public transportation systems such as RFID, IR, GPS, Bluetooth, and Wi-Fi, etc.
Parmeshwar et al. (2017) [6] create and introduce a smart bus transport system using GSM, GPS and Arduino. GSM, GPS sends a message to passengers who are waiting for the next bus to arrive. Passengers counted automatically in this scheme.
Kiran et al. (2017) [7] smart bus tracking system based on Wi-Fi and a real-time bus tracking mobile application. The app uses the bus terminal’s address to send data to the cloud, where it is retrieved and shown to the user in a mobile app. Users are also told when the bus is approaching the bus station.
An Android application for vehicle tracking and monitoring [8] has the capability of current passenger count and that count is automatically updated, as is the location of the passengers. Passengers’ wait times and other issues will be reduced, using smartphones and technologies like GPS, public transportation, Android, MySQL, and RFID chips.
As an Android App for tracking buses and calculating distances to stations along their routes [9], the tracking system includes placement of GPS, RTC, and Arduino UNO in a bus, and an Android App installed on any smartphone to track the bus location.
The system includes a GPS and a sensor built into the bus that counts passengers [10]. Obtain this information via Wi-Fi or the Internet at the bus station. A RaspberryPi3 is used to process GPS and sensor data before sending it to a server.
The prototype collects data at the bus station, uploads the updated information to a server via the internet, and displays the data to customers [11]. RFID, GPS, and Wi-Fi built-in into the controller are among the main technologies employed in this work.
A paper suggests a system for tracking public buses using GPS (Global Positioning System), GPRS, IR, and an Android application [12]. The passengers can monitor the location of the bus by using an app installed on their smartphone to track position, bus numbers, routes, bus stops, and bus timings.
An Arduino Uno, Wi-Fi Module, Router, and GPS are used to build and develop a Smart Bus Tracking and Management System that can be controlled and monitored from anywhere using an internet connection and a mobile phone [13].
The system consists of GPS and the Internet of things (IoT) cloud to store data [14]. Monitoring is done by an Android application installed on the officials’ phones. If there is a delay, an alarm will give to the driver and officials regarding the delay.
The biggest problem facing users of public transport is related to the schedule and the availability of seats on the bus [15]. Passengers can track the bus’s real-time location at any time using GPS (Sim808), Arduino UNO, ESP8266, and RFID.
It is a prototype for developing a real-time system capable of monitoring arrivals, departures, and bus data at all bus intersections [16]. The RFID module can be used with the GSM module to design this system. RFID will assist in getting data for a specific bus and storing it at the designated bus station.
A vehicle monitoring and tracking system was created using the Blynk platform as a data transport [17]. Nod MCU ESP8266, Ultrasonic sensors, gas sensors, infrared sensors, temperature sensors, and GPS modules are used. The smartphone application notifies the driver or other passengers in the vehicle.
The system can book tickets automatically and track buses in real-time [18]. RFID (Radio Frequency Identification), GPS will help with the location of the bus. The system will calculate the distance traveled and deduct the money from the passenger’s E-wallet, which can be managed through the mobile app.
The system uses Global Positioning System (GPS), Arduino, and IR (infrared) sensors [19]. An Android app is used to track the bus’s position. The app includes details about the bus, such as its number, routes, bus stops, and arrival and departure times.
The suggested system offers the actual position of the desired bus as well as numerous specifics, such as access time, number of passengers on the bus, bus speed, and departure time [20]. By using the Node MCU, GPS module, Wi-Fi IoT module, Arduino UNO, and Android application.
The suggested proposed system in this paper is a low-cost, IoT-based, real-time, and easy-to-use system. It consists of a GPS module and an ESP32 (microcontroller & Wi-Fi module) that will be installed inside the buses. GPS is used to obtain a real-time bus location, as well as speed, direction, etc. All data collected by ESP32 will be transferred to the Blynk server through Wi-Fi, then displayed on the mobile application. The system aims to reduce the wait time at the bus station.
The paper is organized as follows. Section 2 describes the proposed system methodology. Section 3 presents the implement of the proposed system. Section 4 discusses the results obtained through implementing the proposed system, and finally, the last section provides the conclusion.
2. Proposed System Block Diagram
The prototype of the proposed system is in Figure 1. It consists of an Android application designed for users who want real-time information about the buses. The app will display information about buses such as real-time location on Google Maps, speed, distance, and arrival time of each bus. The proposed system includes an ESP32 with a Wi-Fi built-in module, a GPS module, and an Android app connected to the server. The proposed system is operated by GPS and
Figure 1. Block diagram of prototype of smart public transportation system.
ESP32, which are installed in each bus with a power supply that may be obtained from the bus. GPS receives the satellite signals and then the position coordinates with latitude, longitude and speed are determined for moving buses. After receiving the data, the tracking data can be transmitted using wireless communications systems. In this system, the ESP32 is a microcontroller with a Wi-Fi module. All the information collected by ESP32, such as location (latitude and longitude), speed, etc., will be uploaded to the Blynk Server. Based on IoT, the user can access this information on a bus through the Android application. The Haversine formula is used to calculate the distance and estimated arrival time that will be shown on an Android application.
3. Implement of the Proposed System
The prototype of smart public transportation is in Figure 2. It consists of two parts: The first part is the communication unit, which includes a GPS module and an ESP32 micro-controller with a Wi-Fi built-in module. This unit is used in the public transportation system for vehicle monitoring and tracking. With the help of the GPS module, it can determine the current position and calculate the speed of buses. The GPS data is transferred to the Blynk server with the help of the Wi-Fi module for storage and analysis. Then it is displayed on the mobile phone application. The second part is the mobile application. The android application gets data from the Blynk server and provides the required data to the user based on the information provided in the android application.
3.1. ESP32 Microcontroller
The ESP32 is a microcontroller with a Wi-Fi module, an open-source IoT platform that is characterized by low-cost and low-power system-on-a-chip (SOC). An ESP32 has a dual-core structure and internal modules such as Wi-Fi, Bluetooth, and many Peripheral Interfaces such as IR, SPI, CAN, Ethernet, and temperature sensors [21]. The specifications of the ESP32 are given in Table 1.
Figure 2. Prototype of smart public transportation architecture.
3.2. GPS Module
GPS (Global Position System) used for positioning and tracking buses based on satellite communication. GPS satellites cover the entire earth at all times. To get accurate GPS location data, there should be a minimum of three satellites. The NEO-6M GPS module used in the proposed system is small and works on very low power, making it ideal for tracking applications. The GPS module operates at 3.3 V, as a result, powered by connecting the GPS module to the 3.3 V pin of the ESP32. respectively shown in Figure 3.
3.3. Mobile Application
The Android application is critical to this system’s success. It assists passengers by providing information about the bus they need to take. It works as a link between the user and the server. In this system, the android application is designed by using the Blynk platform. The Blynk platform is an IoT platform, offering a way to design wonderful applications in minutes for Android and iOS smartphones. It can be used to manage different controllers, such as Raspberry Pi, ESP8266, ESP32, etc. The Blynk platform’s architecture includes Blynk libraries, Blynk server, and Blynk apps [22]. The Android app shown in Figure 5 includes a map that will show the passenger’s location, as well as track the present location of the bus. It also provides the estimated time for the bus to arrive, the speed of the moving bus, and displays the nearest bus to the user by calculating the distance between the passenger and the bus location.
3.3.1. Distance Calculation
The Haversine formula was adopted to calculate the distance that will appear in the Android app. It calculates the distance between the passenger and the bus location using the latitude and longitude of the bus and the passenger who is at home, work, or at the bus stop. The following equations can be used to calculate the distance [23].
Figure 3. GPS module to ESP32 connection.
(1)
(2)
(3)
where: (“φ”) = latitude;
(“λ”) = longitude;
(“∆φ”) = latitude 2 − latitude 1;
(“∆λ”) = longitude 2 − longitude 1;
R = earth radius (6371 meters);
d = distance between the two location.
3.3.2. Arrival Time Calculation
The arrival time of each bus, which will appear in the Android app, is calculated based on the following equation.
(4)
where: t = arrival time of bus.
d = distance between the passenger and bus location that get from Equation (3).
s = average speed of bus along route.
To convert the arrival time (t) that will be obtained from Equation (3) from an hour into a minute, it is multiplied by 60 (one hour into a minute).
3.4. Work the Proposed System
The proposed system method is working procedure first; the user must determine his location by activating the location feature in a smartphone. To get the information entered the application will provide the details about buses, bus location, bus speed, bus arrival time, nearest bus from a user by offering the distance between user location and bus. This information will assist the passenger to select their suitable bus. In the flowchart that describes the proposed system work in Figure 4. A GPS module connected to an ESP32 Microcontroller with a built-in Wi-Fi module is placed inside each bus. When the power supply is on, the GPS module communicates continuously with the satellite to get coordinates. The GPS module will initialize itself, then the module will get the coordinates, but if the coordinates are not received, then the module will initialize again. Once the GPS obtains the coordinates, it sends the data, including latitude and longitude, and speed to the IoT Blynk server through the ESP32. At the Blynk server, the latitude and longitude are extracted and used on the visual map in the Blynk application. The live location of the bus can be seen on the Google map. Continuous data digital updates such as speed, distance, and the arrival time of the bus are displayed on the mobile application.
Figure 4. Smart public transportation system flowchart.
4. Results and Discussion
For testing the efficiency of the proposed system, the prototype has been installed (GPS unit and ESP32) inside a vehicle with supplied internet to use the possibilities offered by the Internet of Things. That vehicle roamed through multiple roads in Mosul city for several days and at different times, for collecting and recording data (latitude, longitude, speed, distance, and time of arrival). Depending on the system model, this information will be transmitted via a Wi-Fi internet connection to the Blynk server and then to the Android mobile application. Figure 5 represents the result displayed in the end-users mobile application for the smart public transportation system.
4.1. Location Accuracy Analysis
The proposed system has been tested and Table 2. Display data obtained from several streets in the city of Mosul to determine the level of accuracy of the data obtained through GPS on several days and at different times.
4.2. Distance Accuracy Analysis
Figure 6 presents a graphic comparison of the distance level, the accuracy obtained through the calculation of the great circle distance equation, and the comparison between the total distance obtained from each of the test data and the total distance through real distance.
The Haversine equation used to measure the accuracy of the obtained distance. Based on a study of 4 days with different times, the average difference between the calculated values computed by the Haversine equation compared to the data obtained from a real distance is (177 meters) with an error ratio between 8 to 225 meters. This error is due to the fact that the Haversine equation
(a) (b) (c)
Figure 5. Mobile app for prototype of smart public transportation (a) Buses and passenger location on map, (b) GPS data, (c) Distance and arrival time of each bus.
Table 2. Several locations from the different streets in mosul city.
calculates the distance between two points on the surface of the Earth, assuming that the geometry of the earth is completely spherical (ignoring ellipsoidal effects) with a mean radius of 6.371 Km. Since the earth is not spherical, the earth in reality is elliptical with a radius between 6.378 Km (equatorial) and 6.357 Km (polar). This means the errors from assuming spherical geometry may reach 0.55%.
4.3. Arrival Time Accuracy Analysis
The arrival time between two points calculated based on Equation (4) as shown in Figure 7, where time accuracy depends on the accuracy of the distance in Table 3.
Figure 7 shows the average speed registered along route during 13 minute.
Table 3 displays the some overall results obtained applying the Equations (1)-(4) of the proposed system.
Table 3. Results obtained applying of the proposed System.
Figure 7. Graphic of average speed over the time the GPS-Data.
The proposed system is easy to use than other systems and more cost-efficient. It also provides greater performance than RFID and GPS-GSM systems. The application of this proposed system showed that using three GPS-Data only: latitude, longitude, and speed, it is possible to find information about buses, including arrival time, distance. This proposed system could be a valuable guide for those people involved in the study of GPS-Data gathered from moving buses. In the proposed system, the present location of the bus can be known by the latitude and longitude of the bus. The distance between the location of the bus and the location of the passenger is calculated based on the Haversine equation. The bus’s arrival time is calculated based on Equation (4). All information is loaded onto the Blynk server and displayed on the mobile application.
5. Conclusion and Future Work
This paper introduces a prototype of a smart public transport system that is designed and implemented using IoT technology, GPS, and ESP32. This system shows that it can use GPS-Data only to get real-time information about buses, such as the current location of the bus, speed, arrival time, and distance. This system offers solutions for users of public transport who take a bus to reach their destinations. This system will help them to reduce the waiting time at the bus station because it provides passengers with necessary information about buses, like the current location of buses, the speed of the bus, arrival time, and the distance. The distance between the user and the bus location, which is calculated using the Haversine equation with a minimum error of 8 meters, and the arrival time of each bus is calculated based on the distance and the average speed of the bus registered along the road. The system is practical and reliable for transmitting data using Wi-Fi, compared with other systems that are based on GPS-GSM technology. Future work: The mobile application will be developed by adding additional features, using an IR sensor to count the number of passengers on the bus, and using RFID tags to implement an electronic ticketing system.