<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article  PUBLIC "-//NLM//DTD Journal Publishing DTD v3.0 20080202//EN" "http://dtd.nlm.nih.gov/publishing/3.0/journalpublishing3.dtd"><article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="3.0" xml:lang="en" article-type="research article"><front><journal-meta><journal-id journal-id-type="publisher-id">OALibJ</journal-id><journal-title-group><journal-title>Open Access Library Journal</journal-title></journal-title-group><issn pub-type="epub">2333-9705</issn><publisher><publisher-name>Scientific Research Publishing</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="doi">10.4236/oalib.1107985</article-id><article-id pub-id-type="publisher-id">OALibJ-112889</article-id><article-categories><subj-group subj-group-type="heading"><subject>Articles</subject></subj-group><subj-group subj-group-type="Discipline-v2"><subject>Biomedical&amp;Life Sciences</subject><subject> Business&amp;Economics</subject><subject> Chemistry&amp;Materials Science</subject><subject> Computer Science&amp;Communications</subject><subject> Earth&amp;Environmental Sciences</subject><subject> Engineering</subject><subject> Medicine&amp;Healthcare</subject><subject> Physics&amp;Mathematics</subject><subject> Social Sciences&amp;Humanities</subject></subj-group></article-categories><title-group><article-title>
 
 
  Design an Intelligent Real-Time Public Transportation Monitoring System Based on IoT
 
</article-title></title-group><contrib-group><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Thair</surname><given-names>A. Salih</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Noor</surname><given-names>K. Younis</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref></contrib></contrib-group><aff id="aff1"><addr-line>Technical Engineering College, Northern Technical University, Mosul, Iraq</addr-line></aff><pub-date pub-type="epub"><day>29</day><month>09</month><year>2021</year></pub-date><volume>08</volume><issue>10</issue><fpage>1</fpage><lpage>14</lpage><history><date date-type="received"><day>20,</day>	<month>September</month>	<year>2021</year></date><date date-type="rev-recd"><day>26,</day>	<month>October</month>	<year>2021</year>	</date><date date-type="accepted"><day>29,</day>	<month>October</month>	<year>2021</year></date></history><permissions><copyright-statement>&#169; Copyright  2014 by authors and Scientific Research Publishing Inc. </copyright-statement><copyright-year>2014</copyright-year><license><license-p>This work is licensed under the Creative Commons Attribution International License (CC BY). http://creativecommons.org/licenses/by/4.0/</license-p></license></permissions><abstract><p>
 
 
  In recent years, smart public transportation has become one of the most important things for developing cities and improving people’s quality of life. Public transportation users face many problems, the most important of which is the long wait at the bus station. The proposed system in this paper helps users of public transportation to find public transportation, arrival times, and other information from any place and at any time using a mobile application. The main objective of the prototype is to reduce the wait time at the bus station by knowing the nearest buses to a user, the real-time location of buses on the Google map to help passengers track buses in real-time, the arrival time of buses, and speed. The system was implemented based on Internet of Things (IoT) technology, by using the Global Positioning System (GPS), a microcontroller with a built-in Wi-Fi module (ESP32), and a mobile user interface by the Blynk IoT platform. The proposed system has been implemented and tested in real-time, where all data obtained is displayed by the GPS sensors for bus locations (longitude and latitude) and speed on the smartphone application. The distance between the bus location and the passenger that will appear in the mobile app was calculated by using the Haversine formula. It measured the accuracy of the distance obtained based on a study of several days at different times on multiple roads in Mosul city and compared it with the actual distance. The average difference between the calculated values computed by the Haversine equation compared to the data obtained from the actual distance is (177 meters) with a minimum error of 8 meters. The arrival time of each bus was calculated based on the distance and average speed of the bus registered along the road.
 
</p></abstract><kwd-group><kwd>ESP32</kwd><kwd> Global Position System (GPS)</kwd><kwd> Internet of Things(IoT)</kwd><kwd> Blynk</kwd><kwd> Haversine</kwd></kwd-group></article-meta></front><body><sec id="s1"><title>1. Introduction</title><p>Public transportation refers to shared passenger transportation services such as buses, trolleybuses, trains, ferries, and expresses transportation like the metro [<xref ref-type="bibr" rid="scirp.112889-ref1">1</xref>]. 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 [<xref ref-type="bibr" rid="scirp.112889-ref2">2</xref>]. 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) [<xref ref-type="bibr" rid="scirp.112889-ref3">3</xref>]. 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 [<xref ref-type="bibr" rid="scirp.112889-ref4">4</xref>]. 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 [<xref ref-type="bibr" rid="scirp.112889-ref5">5</xref>].</p><p>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.</p><p>Parmeshwar et al. (2017) [<xref ref-type="bibr" rid="scirp.112889-ref6">6</xref>] 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.</p><p>Kiran et al. (2017) [<xref ref-type="bibr" rid="scirp.112889-ref7">7</xref>] 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.</p><p>An Android application for vehicle tracking and monitoring [<xref ref-type="bibr" rid="scirp.112889-ref8">8</xref>] 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.</p><p>As an Android App for tracking buses and calculating distances to stations along their routes [<xref ref-type="bibr" rid="scirp.112889-ref9">9</xref>], 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.</p><p>The system includes a GPS and a sensor built into the bus that counts passengers [<xref ref-type="bibr" rid="scirp.112889-ref10">10</xref>]. 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.</p><p>The prototype collects data at the bus station, uploads the updated information to a server via the internet, and displays the data to customers [<xref ref-type="bibr" rid="scirp.112889-ref11">11</xref>]. RFID, GPS, and Wi-Fi built-in into the controller are among the main technologies employed in this work.</p><p>A paper suggests a system for tracking public buses using GPS (Global Positioning System), GPRS, IR, and an Android application [<xref ref-type="bibr" rid="scirp.112889-ref12">12</xref>]. 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.</p><p>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 [<xref ref-type="bibr" rid="scirp.112889-ref13">13</xref>].</p><p>The system consists of GPS and the Internet of things (IoT) cloud to store data [<xref ref-type="bibr" rid="scirp.112889-ref14">14</xref>]. 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.</p><p>The biggest problem facing users of public transport is related to the schedule and the availability of seats on the bus [<xref ref-type="bibr" rid="scirp.112889-ref15">15</xref>]. Passengers can track the bus’s real-time location at any time using GPS (Sim808), Arduino UNO, ESP8266, and RFID.</p><p>It is a prototype for developing a real-time system capable of monitoring arrivals, departures, and bus data at all bus intersections [<xref ref-type="bibr" rid="scirp.112889-ref16">16</xref>]. 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.</p><p>A vehicle monitoring and tracking system was created using the Blynk platform as a data transport [<xref ref-type="bibr" rid="scirp.112889-ref17">17</xref>]. 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.</p><p>The system can book tickets automatically and track buses in real-time [<xref ref-type="bibr" rid="scirp.112889-ref18">18</xref>]. 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.</p><p>The system uses Global Positioning System (GPS), Arduino, and IR (infrared) sensors [<xref ref-type="bibr" rid="scirp.112889-ref19">19</xref>]. 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.</p><p>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 [<xref ref-type="bibr" rid="scirp.112889-ref20">20</xref>]. By using the Node MCU, GPS module, Wi-Fi IoT module, Arduino UNO, and Android application.</p><p>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 &amp; 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.</p><p>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.</p></sec><sec id="s2"><title>2. Proposed System Block Diagram</title><p>The prototype of the proposed system is in <xref ref-type="fig" rid="fig1">Figure 1</xref>. 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</p><p>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.</p></sec><sec id="s3"><title>3. Implement of the Proposed System</title><p>The prototype of smart public transportation is in <xref ref-type="fig" rid="fig2">Figure 2</xref>. 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.</p><sec id="s3_1"><title>3.1. ESP32 Microcontroller</title><p>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 [<xref ref-type="bibr" rid="scirp.112889-ref21">21</xref>]. The specifications of the ESP32 are given in <xref ref-type="table" rid="table1">Table 1</xref>.</p><table-wrap id="table1" ><label><xref ref-type="table" rid="table1">Table 1</xref></label><caption><title> ESP32 specification</title></caption><table><tbody><thead><tr><th align="center" valign="middle" >CPU</th><th align="center" valign="middle" >Tensilica Xtensa LX6 32 bit Dual Core at 160/240 MHz</th></tr></thead><tr><td align="center" valign="middle" >SRAM</td><td align="center" valign="middle" >520 KB</td></tr><tr><td align="center" valign="middle" >FLASH</td><td align="center" valign="middle" >2 MB (max. 64 MB)</td></tr><tr><td align="center" valign="middle" >Voltage</td><td align="center" valign="middle" >2.2 V to 3.6 V</td></tr><tr><td align="center" valign="middle" >Operating Current</td><td align="center" valign="middle" >80 mA average Free</td></tr><tr><td align="center" valign="middle" >Programmable</td><td align="center" valign="middle" >Free (C, C++, Lua, etc.)</td></tr><tr><td align="center" valign="middle" >Open Source</td><td align="center" valign="middle" >Yes</td></tr><tr><td align="center" valign="middle" >Wi-Fi</td><td align="center" valign="middle" >802.11 b/g/n</td></tr><tr><td align="center" valign="middle" >Bluetooth</td><td align="center" valign="middle" >4.2 BR/EDR + BLE</td></tr><tr><td align="center" valign="middle" >UART</td><td align="center" valign="middle" >3</td></tr><tr><td align="center" valign="middle" >GPIO</td><td align="center" valign="middle" >32 pins</td></tr></tbody></table></table-wrap></sec><sec id="s3_2"><title>3.2. GPS Module</title><p>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 <xref ref-type="fig" rid="fig3">Figure 3</xref>.</p></sec><sec id="s3_3"><title>3.3. Mobile Application</title><p>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 [<xref ref-type="bibr" rid="scirp.112889-ref22">22</xref>]. The Android app shown in <xref ref-type="fig" rid="fig5">Figure 5</xref> 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.</p><sec id="s3_3_1"><title>3.3.1. Distance Calculation</title><p>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 [<xref ref-type="bibr" rid="scirp.112889-ref23">23</xref>].</p><p>a = sin 2 ( Δ φ / 2 ) + cos φ 1 ⋅ cos φ 2 ⋅ sin 2 ( Δ λ / 2 ) (1)</p><p>c = 2 ⋅ atan 2 ( a ⋅ 1 − a ) (2)</p><p>d = R ⋅ c (3)</p><p>where: (“φ”) = latitude;</p><p>(“λ”) = longitude;</p><p>(“∆φ”) = latitude 2 − latitude 1;</p><p>(“∆λ”) = longitude 2 − longitude 1;</p><p>R = earth radius (6371 meters);</p><p>d = distance between the two location.</p></sec><sec id="s3_3_2"><title>3.3.2. Arrival Time Calculation</title><p>The arrival time of each bus, which will appear in the Android app, is calculated based on the following equation.</p><p>t = d / s ∗ 60 (4)</p><p>where: t = arrival time of bus.</p><p>d = distance between the passenger and bus location that get from Equation (3).</p><p>s = average speed of bus along route.</p><p>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).</p></sec></sec><sec id="s3_4"><title>3.4. Work the Proposed System</title><p>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 <xref ref-type="fig" rid="fig4">Figure 4</xref>. 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.</p></sec></sec><sec id="s4"><title>4. Results and Discussion</title><p>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. <xref ref-type="fig" rid="fig5">Figure 5</xref> represents the result displayed in the end-users mobile application for the smart public transportation system.</p><sec id="s4_1"><title>4.1. Location Accuracy Analysis</title><p>The proposed system has been tested and <xref ref-type="table" rid="table2">Table 2</xref>. 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.</p></sec><sec id="s4_2"><title>4.2. Distance Accuracy Analysis</title><p><xref ref-type="fig" rid="fig6">Figure 6</xref> 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.</p><p>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</p><table-wrap id="table2" ><label><xref ref-type="table" rid="table2">Table 2</xref></label><caption><title> Several locations from the different streets in mosul city</title></caption><table><tbody><thead><tr><th align="center" valign="middle" >No.</th><th align="center" valign="middle" >Date</th><th align="center" valign="middle" >Time</th><th align="center" valign="middle" >Latitude</th><th align="center" valign="middle" >Longitude</th></tr></thead><tr><td align="center" valign="middle" >1</td><td align="center" valign="middle" >17/2/2021</td><td align="center" valign="middle" >10:58 am</td><td align="center" valign="middle" >36.316739</td><td align="center" valign="middle" >43.191141</td></tr><tr><td align="center" valign="middle" >2</td><td align="center" valign="middle" >17/2/2021</td><td align="center" valign="middle" >11:04 am</td><td align="center" valign="middle" >36.350198</td><td align="center" valign="middle" >43.183983</td></tr><tr><td align="center" valign="middle" >3</td><td align="center" valign="middle" >17/7/2021</td><td align="center" valign="middle" >11:10 am</td><td align="center" valign="middle" >36.343765</td><td align="center" valign="middle" >43.182983</td></tr><tr><td align="center" valign="middle" >4</td><td align="center" valign="middle" >17/7/2021</td><td align="center" valign="middle" >11:13 am</td><td align="center" valign="middle" >36.337387</td><td align="center" valign="middle" >43.162712</td></tr><tr><td align="center" valign="middle" >5</td><td align="center" valign="middle" >17/2/2021</td><td align="center" valign="middle" >11:19 am</td><td align="center" valign="middle" >36.310638</td><td align="center" valign="middle" >43.207447</td></tr><tr><td align="center" valign="middle" >6</td><td align="center" valign="middle" >6/3/2021</td><td align="center" valign="middle" >12:30 am</td><td align="center" valign="middle" >36.3015221</td><td align="center" valign="middle" >43.202267</td></tr><tr><td align="center" valign="middle" >7</td><td align="center" valign="middle" >8/3/2021</td><td align="center" valign="middle" >11:38 pm</td><td align="center" valign="middle" >36.30159</td><td align="center" valign="middle" >43.20216</td></tr><tr><td align="center" valign="middle" >8</td><td align="center" valign="middle" >8/3/2021</td><td align="center" valign="middle" >11:39 pm</td><td align="center" valign="middle" >36.301559</td><td align="center" valign="middle" >43.202206</td></tr><tr><td align="center" valign="middle" >9</td><td align="center" valign="middle" >8/3/2021</td><td align="center" valign="middle" >11:40 pm</td><td align="center" valign="middle" >36.310688</td><td align="center" valign="middle" >43.203171</td></tr><tr><td align="center" valign="middle" >10</td><td align="center" valign="middle" >8/3/2021</td><td align="center" valign="middle" >11:43 pm</td><td align="center" valign="middle" >36.295567</td><td align="center" valign="middle" >43.195332</td></tr><tr><td align="center" valign="middle" >11</td><td align="center" valign="middle" >8/3/2021</td><td align="center" valign="middle" >11:55 pm</td><td align="center" valign="middle" >36.389160</td><td align="center" valign="middle" >43.187370</td></tr><tr><td align="center" valign="middle" >12</td><td align="center" valign="middle" >9/3/2021</td><td align="center" valign="middle" >10:05 am</td><td align="center" valign="middle" >36.377155</td><td align="center" valign="middle" >43.149384</td></tr><tr><td align="center" valign="middle" >13</td><td align="center" valign="middle" >9/3/2021</td><td align="center" valign="middle" >10:07 am</td><td align="center" valign="middle" >36.350117</td><td align="center" valign="middle" >43.238834</td></tr><tr><td align="center" valign="middle" >14</td><td align="center" valign="middle" >9/3/2021</td><td align="center" valign="middle" >10:15 am</td><td align="center" valign="middle" >36.376621</td><td align="center" valign="middle" >43.153072</td></tr><tr><td align="center" valign="middle" >15</td><td align="center" valign="middle" >9/3/2021</td><td align="center" valign="middle" >10:16 am</td><td align="center" valign="middle" >36.379650</td><td align="center" valign="middle" >43.153046</td></tr><tr><td align="center" valign="middle" >16</td><td align="center" valign="middle" >9/3/2021</td><td align="center" valign="middle" >10:17 am</td><td align="center" valign="middle" >36.381821</td><td align="center" valign="middle" >43.150658</td></tr><tr><td align="center" valign="middle" >17</td><td align="center" valign="middle" >9/3/2021</td><td align="center" valign="middle" >10.19 am</td><td align="center" valign="middle" >36.382019</td><td align="center" valign="middle" >43.156296</td></tr><tr><td align="center" valign="middle" >18</td><td align="center" valign="middle" >10/3/2021</td><td align="center" valign="middle" >10:07 am</td><td align="center" valign="middle" >36.335922</td><td align="center" valign="middle" >43.202955</td></tr><tr><td align="center" valign="middle" >19</td><td align="center" valign="middle" >10/3/2021</td><td align="center" valign="middle" >10:15 am</td><td align="center" valign="middle" >36.310688</td><td align="center" valign="middle" >43.203171</td></tr><tr><td align="center" valign="middle" >20</td><td align="center" valign="middle" >10/3/2021</td><td align="center" valign="middle" >10:24 am</td><td align="center" valign="middle" >36.301514</td><td align="center" valign="middle" >43.202290</td></tr><tr><td align="center" valign="middle" >21</td><td align="center" valign="middle" >11/3/2021</td><td align="center" valign="middle" >11:32 am</td><td align="center" valign="middle" >36.374424</td><td align="center" valign="middle" >43.147087</td></tr><tr><td align="center" valign="middle" >22</td><td align="center" valign="middle" >11/3/2021</td><td align="center" valign="middle" >11:33 am</td><td align="center" valign="middle" >36.371513</td><td align="center" valign="middle" >43.136124</td></tr><tr><td align="center" valign="middle" >23</td><td align="center" valign="middle" >11/3/2021</td><td align="center" valign="middle" >11:34 am</td><td align="center" valign="middle" >36.370644</td><td align="center" valign="middle" >43.133099</td></tr><tr><td align="center" valign="middle" >24</td><td align="center" valign="middle" >15/3/2021</td><td align="center" valign="middle" >7:15 pm</td><td align="center" valign="middle" >36.301514</td><td align="center" valign="middle" >43.202446</td></tr><tr><td align="center" valign="middle" >25</td><td align="center" valign="middle" >15/3/2021</td><td align="center" valign="middle" >7:16 pm</td><td align="center" valign="middle" >36.302582</td><td align="center" valign="middle" >43.201664</td></tr><tr><td align="center" valign="middle" >26</td><td align="center" valign="middle" >24/3/2021</td><td align="center" valign="middle" >1:25 pm</td><td align="center" valign="middle" >36.370796</td><td align="center" valign="middle" >43.133259</td></tr><tr><td align="center" valign="middle" >27</td><td align="center" valign="middle" >24/3/2021</td><td align="center" valign="middle" >1:27 pm</td><td align="center" valign="middle" >36.365589</td><td align="center" valign="middle" >43.120064</td></tr><tr><td align="center" valign="middle" >28</td><td align="center" valign="middle" >24/3/2021</td><td align="center" valign="middle" >1:28 pm</td><td align="center" valign="middle" >36.358574</td><td align="center" valign="middle" >43.111202</td></tr></tbody></table></table-wrap><p>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%.</p></sec><sec id="s4_3"><title>4.3. Arrival Time Accuracy Analysis</title><p>The arrival time between two points calculated based on Equation (4) as shown in <xref ref-type="fig" rid="fig7">Figure 7</xref>, where time accuracy depends on the accuracy of the distance in <xref ref-type="table" rid="table3">Table 3</xref>.</p><p><xref ref-type="fig" rid="fig7">Figure 7</xref> shows the average speed registered along route during 13 minute.</p><p><xref ref-type="table" rid="table3">Table 3</xref> displays the some overall results obtained applying the Equations (1)-(4) of the proposed system.</p><table-wrap id="table3" ><label><xref ref-type="table" rid="table3">Table 3</xref></label><caption><title> Results obtained applying of the proposed System</title></caption><table><tbody><thead><tr><th align="center" valign="middle" >No.</th><th align="center" valign="middle" >Date</th><th align="center" valign="middle" >Time</th><th align="center" valign="middle" >Distance (Km)</th><th align="center" valign="middle" >Average Speed (Km/h)</th><th align="center" valign="middle" >Arrival Time (minute)</th></tr></thead><tr><td align="center" valign="middle" >1</td><td align="center" valign="middle" >15/3/2021</td><td align="center" valign="middle" >10:58:12 am</td><td align="center" valign="middle" >3.775 Km</td><td align="center" valign="middle" >49 Km/h</td><td align="center" valign="middle" >4.5 minute</td></tr><tr><td align="center" valign="middle" >2</td><td align="center" valign="middle" >15/3/2021</td><td align="center" valign="middle" >11:15:20 am</td><td align="center" valign="middle" >1.494 Km</td><td align="center" valign="middle" >59 Km/h</td><td align="center" valign="middle" >1.98 minute</td></tr><tr><td align="center" valign="middle" >3</td><td align="center" valign="middle" >15/3/2021</td><td align="center" valign="middle" >11:20:33 am</td><td align="center" valign="middle" >4.949 Km</td><td align="center" valign="middle" >60 Km/h</td><td align="center" valign="middle" >4.99 minute</td></tr><tr><td align="center" valign="middle" >4</td><td align="center" valign="middle" >21/3/2021</td><td align="center" valign="middle" >3:06:12 pm</td><td align="center" valign="middle" >9.450 Km</td><td align="center" valign="middle" >42 Km/h</td><td align="center" valign="middle" >11.340 minute</td></tr><tr><td align="center" valign="middle" >5</td><td align="center" valign="middle" >21/3/2021</td><td align="center" valign="middle" >3:12 :30 pm</td><td align="center" valign="middle" >6.618 Km</td><td align="center" valign="middle" >40 Km/h</td><td align="center" valign="middle" >7.94 minute</td></tr><tr><td align="center" valign="middle" >6</td><td align="center" valign="middle" >21/3/2021</td><td align="center" valign="middle" >3:16:33 pm</td><td align="center" valign="middle" >5.229 Km</td><td align="center" valign="middle" >31 Km/h</td><td align="center" valign="middle" >6.275 minute</td></tr><tr><td align="center" valign="middle" >7</td><td align="center" valign="middle" >21/3/2021</td><td align="center" valign="middle" >3:19:50 pm</td><td align="center" valign="middle" >2.237 Km</td><td align="center" valign="middle" >40 Km/h</td><td align="center" valign="middle" >3.63 minute</td></tr><tr><td align="center" valign="middle" >8</td><td align="center" valign="middle" >21/3/2021</td><td align="center" valign="middle" >3:23:13 pm</td><td align="center" valign="middle" >1.928 Km</td><td align="center" valign="middle" >49 Km/h</td><td align="center" valign="middle" >2.314 minute</td></tr><tr><td align="center" valign="middle" >9</td><td align="center" valign="middle" >24/3/2021</td><td align="center" valign="middle" >1:25:15 pm</td><td align="center" valign="middle" >10.500 Km</td><td align="center" valign="middle" >59 Km/h</td><td align="center" valign="middle" >12.6 minute</td></tr><tr><td align="center" valign="middle" >10</td><td align="center" valign="middle" >24/3/2021</td><td align="center" valign="middle" >1:25:50 pm</td><td align="center" valign="middle" >10..442 Km</td><td align="center" valign="middle" >64 Km/h</td><td align="center" valign="middle" >12.503 minute</td></tr><tr><td align="center" valign="middle" >11</td><td align="center" valign="middle" >24/3/2021</td><td align="center" valign="middle" >1:26::18 pm</td><td align="center" valign="middle" >10.398 Km</td><td align="center" valign="middle" >47 Km/h</td><td align="center" valign="middle" >12.478 minute</td></tr><tr><td align="center" valign="middle" >12</td><td align="center" valign="middle" >27/4/2021</td><td align="center" valign="middle" >11:35:24 am</td><td align="center" valign="middle" >2.229 Km</td><td align="center" valign="middle" >37 Km/h</td><td align="center" valign="middle" >3.6 minute</td></tr><tr><td align="center" valign="middle" >13</td><td align="center" valign="middle" >27/4/2021</td><td align="center" valign="middle" >11:36:26 am</td><td align="center" valign="middle" >2.130 Km</td><td align="center" valign="middle" >37 Km/h</td><td align="center" valign="middle" >2.972 minute</td></tr><tr><td align="center" valign="middle" >14</td><td align="center" valign="middle" >27/4/2021</td><td align="center" valign="middle" >11::37:17 am</td><td align="center" valign="middle" >1.432 Km</td><td align="center" valign="middle" >45 Km/h</td><td align="center" valign="middle" >1.998 minute</td></tr><tr><td align="center" valign="middle" >15</td><td align="center" valign="middle" >27/4/2021</td><td align="center" valign="middle" >11:37:58 am</td><td align="center" valign="middle" >0.938 Km</td><td align="center" valign="middle" >47 Km/h</td><td align="center" valign="middle" >1.309 minute</td></tr></tbody></table></table-wrap><p>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.</p></sec></sec><sec id="s5"><title>5. Conclusion and Future Work</title><p>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.</p></sec><sec id="s6"><title>Conflicts of Interest</title><p>The authors declare no conflicts of interest.</p></sec><sec id="s7"><title>Cite this paper</title><p>Salih, T.A. and Younis, N.K. (2021) Design an Intelligent Real-Time Public Transportation Monitoring System Based on IoT. Open Access Library Journal, 8: e7985. https://doi.org/10.4236/oalib.1107985</p></sec></body><back><ref-list><title>References</title><ref id="scirp.112889-ref1"><label>1</label><mixed-citation publication-type="other" xlink:type="simple">Sutar, S.H., Koul, R. and Suryavanshi, R. (2016) Integration of Smart Phone and IOT for Development of Smart Public Transportation System. International Conference on Internet of Things and Applications, Pune, 22-24 January 2016, 73-78.  
https://doi.org/10.1109/IOTA.2016.7562698</mixed-citation></ref><ref id="scirp.112889-ref2"><label>2</label><mixed-citation publication-type="other" xlink:type="simple">Jalaney, J., et al. (2019) Review on IoT Based Architecture for Smart Public Transport System. International Journal of Applied Engineering Research, 14, 466-471.  
http://www.ripublication.com</mixed-citation></ref><ref id="scirp.112889-ref3"><label>3</label><mixed-citation publication-type="other" xlink:type="simple">Elkosantini, S. and Darmoul, S. (2013) Intelligent Public Transportation Systems: A Review of Architectures and Enabling Technologies. 2013 International Conference on Advanced Logistics and Transport, Sousse, 29-31 May 2013, 233-238.  
https://doi.org/10.1109/ICAdLT.2013.6568465</mixed-citation></ref><ref id="scirp.112889-ref4"><label>4</label><mixed-citation publication-type="other" xlink:type="simple">Apsara, S., Rashmi, G.A., Mohan Kumar, K.V., Anitha, L. and Jyothi, B. (2017) Internet-of-Things (IOT), Navigation System (NS), Micro Navigation (MN), Crowd-Aware Route Recommendation (CARR), Bus Arrival Time Estimation (Bate). International Journal of Advance Research, Ideas and Innovations in Technology, 3, 1163-1170. https://www.IJARIIT.com</mixed-citation></ref><ref id="scirp.112889-ref5"><label>5</label><mixed-citation publication-type="other" xlink:type="simple">Divekar, S.N., Patil, S.R. and Shelke, S.A. (2018) Smart Bus System. International Journal of Scientific Research in Science, Engineering and Technology, 4, 585-588.</mixed-citation></ref><ref id="scirp.112889-ref6"><label>6</label><mixed-citation publication-type="other" xlink:type="simple">Farooq, M.U., Shakoor, A. and Siddique, A.B. (2017) GPS Based Public Transport Arrival Time Prediction. https://doi.org/10.1109/FIT.2017.00021</mixed-citation></ref><ref id="scirp.112889-ref7"><label>7</label><mixed-citation publication-type="other" xlink:type="simple">Kiran, R., et al. (2017) Implementation of Smart Bus Tracking System Using Wi-Fi. International Journal of Innovative Research in Science, Engineering and Technology, 6, 12940-12946.</mixed-citation></ref><ref id="scirp.112889-ref8"><label>8</label><mixed-citation publication-type="other" xlink:type="simple">Raut, P.P., Mahato, A., Nagane, A., Kuwar, A.M. and Chip, R. (2017) Public Transportation System Using IoT. International Journal for Scientific Research and Development, 5, 240-242. https://www.ijsrd.com</mixed-citation></ref><ref id="scirp.112889-ref9"><label>9</label><mixed-citation publication-type="journal" xlink:type="simple"><name name-style="western"><surname>Sridevi</surname><given-names> K. </given-names></name>,<etal>et al</etal>. (<year>2017</year>)<article-title>Smart Bus Tracking and Management System Using IoT</article-title><source> International Journal for Research in Applied Science and Engineering Technology</source><volume> 5</volume>,<fpage> 372</fpage>-<lpage>374</lpage>.<pub-id pub-id-type="doi"></pub-id></mixed-citation></ref><ref id="scirp.112889-ref10"><label>10</label><mixed-citation publication-type="other" xlink:type="simple">Vakula, D. and Raviteja, B. (2018) Smart Public Transport for Smart Cities. Proceedings of the 2017 International Conference on Intelligent Sustainable Systems (ICISS), Palladam, 7-8 December 2017, 805-810.  
https://doi.org/10.1109/ISS1.2017.8389288</mixed-citation></ref><ref id="scirp.112889-ref11"><label>11</label><mixed-citation publication-type="other" xlink:type="simple">Geetha, S. and Cicilia, D. (2018) IoT Enabled Intelligent Bus Transportation System. Proceedings of the 2nd International Conference on Communication and Electronics Systems, Vol. 2018, 7-11. https://doi.org/10.1109/CESYS.2017.8321235</mixed-citation></ref><ref id="scirp.112889-ref12"><label>12</label><mixed-citation publication-type="other" xlink:type="simple">Kadam, A.J., Patil, V., Kaith, K., Patil, M.D. and Bendre, M.S. (2018) Smart Bus for Smart City Using IOT Technology. 180-184.  
https://doi.org/10.1109/ICECA.2018.8474819</mixed-citation></ref><ref id="scirp.112889-ref13"><label>13</label><mixed-citation publication-type="other" xlink:type="simple">Madhur, I., et al. (2018) Smart Bus Tracking and Management System. Iconic Research and Engineering Journals, 1, 80-84.</mixed-citation></ref><ref id="scirp.112889-ref14"><label>14</label><mixed-citation publication-type="other" xlink:type="simple">Karthikeyan, G. and Jawahar, M.L. (2018) Smart Bus Management System. International Journal of Engineering Research and Technology, 6, 1-4.  
https://www.ijert.org</mixed-citation></ref><ref id="scirp.112889-ref15"><label>15</label><mixed-citation publication-type="other" xlink:type="simple">Sawant, Y.V., et al. (2019) Smart Bus System Using IoT. International Journal of Innovative Research in Electrical, Electronics, Instrumentation and Control Engineering, 7, 105-112. https://doi.org/10.17148/IJIREEICE.2019.7418</mixed-citation></ref><ref id="scirp.112889-ref16"><label>16</label><mixed-citation publication-type="other" xlink:type="simple">Godge, P., Gore, K., Gore, A., Jadhav, A. and Nawathe, A. (2019) Smart Bus Management and Tracking System. International Journal of Latest Engineering Science, 2, 20-25. https://www.ijlesjournal.org</mixed-citation></ref><ref id="scirp.112889-ref17"><label>17</label><mixed-citation publication-type="other" xlink:type="simple">Padmaja, B.V.S., Kolluru, V.R. and Kota, S.S. (2019) IoT Based Implementation of Vehicle Monitoring and Tracking System Using Node MCU. The International Journal of Innovative Technology and Exploring Engineering, 8, 446-450.</mixed-citation></ref><ref id="scirp.112889-ref18"><label>18</label><mixed-citation publication-type="other" xlink:type="simple">Shah, M.J., Prasad, R.P. and Singh, A.S. (2020) IOT Based Smart Bus System. 3rd International Conference on Communication System, Computing and IT Applications (CSCITA), Mumbai, 3-4 April 2020, 130-134.  
https://doi.org/10.1109/CSCITA47329.2020.9137816</mixed-citation></ref><ref id="scirp.112889-ref19"><label>19</label><mixed-citation publication-type="other" xlink:type="simple">Harini, B.K., Parkavi, A., Supriya, M., Kruthika, B.C. and Navya, K.M. (2020) Increasing Efficient Usage of Real-Time Public Transportation Using IOT, Cloud and Customized Mobile App. SN Computer Science, 1, Article No. 159.  
https://doi.org/10.1007/s42979-020-00161-8</mixed-citation></ref><ref id="scirp.112889-ref20"><label>20</label><mixed-citation publication-type="other" xlink:type="simple">Kumar, V.M., Shobana, N.C., Kumar, P.P., Valentine, N.K., et al. (2020) Smart Bus Tracking System. Journal of Critical Reviews, 7, 1672-1677.  
https://www.researchgate.net</mixed-citation></ref><ref id="scirp.112889-ref21"><label>21</label><mixed-citation publication-type="other" xlink:type="simple">Maier, A., Sharp, A. and Vagapov, Y. (2017) Comparative Analysis and Practical Implementation of the ESP32 Microcontroller Module for the Internet of Things. Internet Technologies and Applications (ITA), Wrexham, 12-15 September 2017, 143-148. https://doi.org/10.1109/ITECHA.2017.8101926</mixed-citation></ref><ref id="scirp.112889-ref22"><label>22</label><mixed-citation publication-type="other" xlink:type="simple">Htwe, H.N., Mon, Z.Z., Mya, A. and Aung, M. (2019) Design and Implementation of IOT Based Vehicle Tracking System. International Journal of Science, Engineering and Technology Research, 8, 374-379.  
https://www.academia.edu/42909622/Design_and_Implementation_of_IOT_Based_Vehicle_Tracking_System</mixed-citation></ref><ref id="scirp.112889-ref23"><label>23</label><mixed-citation publication-type="other" xlink:type="simple">Prasetya, D.A., Nguyen, P.T., Faizullin, R., Iswanto, I. and Armay, E.F. (2020) Resolving the Shortest Path Problem Using the Haversine Algorithm. Journal of Critical Reviews, 7, 62-64.</mixed-citation></ref></ref-list></back></article>