Introduction

In India, transportation is mainly classified into three modes, namely airways, landways and waterways. Public transportation is of primary importance for Indian citizens. Nowadays, due to some of the inconvenience, people stopped using public transportation. Our proposed system deals with the landways, i.e. bus transportation. Bus was invented by Blaise Pascal. First bus service was launched in Paris on 18 March 1662 and was called by the name “carriage”. The horse-drawn omni bus service was first started by a business man named Stanislas Baudry in the French city of Nantes in 1823 [1]. This omni bus was used for transportation purpose before invention of motor vehicles. For example, in offices, schools, universities, the passengers are employees, students, lecturers, respectively. All the above-mentioned public face a lot of issues regarding the late arrival to the school, college, etc. To reduce this type of issues to some extent, smart transportation system is developed. Our system would help in the travelling plans [2].

Tracking of the bus can be considered as the main functionality of our application. Other than this, our main objective is to make people to use public transportation to a greater extent.

Literature Survey

Around the world, there are many vehicle tracking systems been developed. Each and every system has their own purpose and uniqueness in them. For example, GPS tracker has been installed in the buses to give the location of bus. There are systems developed not only for location even for the purpose of security, stolen vehicle recovery, fuel monitoring, distance calculation, etc. But this system not efficiently working or can be called as not in proper usage. The awareness about these is not reached to the public. Some of the similar kind of existing system and their short comings are discussed below.

Commercial Bus Tracking and Alert System

Giridhar M, Sharmistha M, Soumya S and Narayan C proposed a system to implement smart bus system using IOT. They mainly concentrated on embedding IOT in city buses to track the bus location and providing some authentication to daily travelers in city buses like students, workers etc. so this can be helpful to track bus location and also to identify valid passengers in bus where this can be helpful for checking daily passes and tickets [2]. Fleischer et al. proposed a tracking and alert system for commercial buses for traveling inter-state. In [3], the author is mainly focusing on the status of the bus. Status of the bus includes the location, any accidental issues and robbery. The GPS and GSM technology are been implemented. The location of the bus is identified by the GPS and stored either in tracking unit or the database, and these data are been forwarded to the administrator. The GSM is used to notify the administrator in case of any accidents or robbery. The location of the bus is displayed on the on-board display in the bus stops. Finally, the author successfully delivers a system with driving speed limit of the drivers, response to the accidents quickly and also effectively helps to communicate with administrators.

GPS Bus Tracking System

The author Pradip suresh and vaishali D.K mainly concentrates on the retrieval of the bus location coordinated using GPS [1]. Leeza and Parteek proposed bus tracking system using GPS. The author mainly concentrates on the retrieval of the bus location coordinated using GPS. These coordinates are sent through GPRS using GSM networks or SMS or RFID to control unit or directly to RF receivers which are installed in bus stops. Based on the history of the bus speed, the arrival time of the bus is computed using K means and ANN algorithm. This bus information can also be retrieved by the LED’s in the bus stops, SMS, web application and android systems. By using these algorithms, accuracy for the bus arrival time increases. This application runs efficiently if the accessibility of the internet is good [4].

Mobile Enabled Tracking System

Suresh Sankarananrayanan and Paul Hamilton implemented the bus tracking and ticketing system enabled through mobile. The author has developed a tracking and smart ticketing application. The application has a list of routes where the user can select the route required. After the selection process, we can retrieve the location of the buses with the estimated time of arrival. If any delay due to traffic, the estimated arrival of the bus changes accordingly. Smart cards have been swiped to buy the tickets with respect to the travel distance and will be notified with the SMS to the mobile user with the transaction details. The drawback is that this application is limited for the specific city and is not user friendly [5].

Bus Tracking System Using QR Codes

Suleyman and Ahmet worked on the bus tracking using the location service and QR codes. The users with the smartphones can scan the QR code placed in the bus stops. Once after the scanning process, the users get the list of buses. Then, the required bus information can be retrieved by selecting the respective bus. If the user wants to get the updates about the required bus, then they can sign up. So that they can get the updates regularly through electronic mail and short message service. Using C4.5 algorithm, the estimated arrival time of the bus is computed. This application has the accessibility only in the bus stops. Hence, this application is not flexible for the usage [6].

In India, till today, we are not with an accurate bus tracking system which provides bus location to passengers. In this paper, we introduce a concept of SBTS (smart bus transportation system) to overcome problems faced in bus transportation system using mobile app.

IOT-Enabled connected navigation system for urban bus riders

Mohammad Y. M and Lukman Audah used arduino board to connect GPS and circuitry connections in the bus using the fetched longitude and latitude values to database through arudino board. [7] The main concept of author Handte M et al in this paper is to satisfy the citizen demand of public transportation service with the help of the emerging technology internet of things. IOT has the ability to overcome the drawbacks of the existing transportation system. This system provides two major contributions for the urban areas by providing the navigation by tracking the journey progress of the individuals and the crowded route recommending system by suggesting the best possible route without more crowd. This system proves to be highly efficient for the urban area transportation system [8].

Wireless networks: New meaning to ubiquitous computing

Here, Wilfred (Bill) Drew et al mainly concentrate on the wireless technology, its usage security and its advantages. Moreover, people are getting evolved from wired to wireless technology by its main feature of connecting everything without any physical connection. The authors mainly address the library management by converting them into wireless and they even describe a scenario where the students can easily identify books by logging into the library database. Nowadays all the educational institutions are coming up with wireless technology for efficient and easy usage. The authors conclude that using the wireless technology is more advantageous [9].

Smartphone-based system to improve transportation for the cognitively impaired

Here, the author is concerned about the people who have a problem in remembering things, which affects their day-to-day life and transportation. The entire project deals with two major components where the first component deals with the notifications and location details so that these people can be helped with the transportation and the second one is for maintaining their program and function through the interconnected network. This is a very useful system for the cognitively impaired and their family. Even a study on this project was initiated and completed to test the mobility and efficiency. Finally, this system can result in a guide for impaired people [10].

Programming with android studio

Vikky A W et al proposed a method to identify the land by connecting GPS and displaying it in android application. In this paper, they explained how to use GPS coordinates values and usage of APIs to build interface between android and IOT and then to display coordinates on maps [11]. Dimarzio gave explanation of android user interface, design of user interface and views, menus, displaying figures and pictures, making data more persistent, content viewing, messaging and many things that are given with proper syntax and examples. In each of the above-listed topics, there are so many subtopics that are also explained in detail. Sending and receiving messages, creating warnings, sending e-mails, loading all data, saving all data to files and creating database, managing with different types of views and menus, usage of fragments and lists, sharing data, projecting and filtering data and so many other things which are related to android application development are explained, and also for better understanding, some examples are explored [12].

Real-time bus tracking

Manish et al proposed a system to track buses in real time. They explained the existing system where in each bus stop RF transceivers are installed; when the bus signals the coordinates of its location, the nearest transceivers will receive it. Once they receive the signals, the coordinates are marked on map and displayed on LCD screens placed in bus stops. But this is not user–friendly, so an android application software is proposed that when the bus sends its coordinates to a satellite instead of sending it to the nearest RF transceivers, it can mark easily on maps and accurate location of bus can be displayed on android application software only. This proposed system is more user-friendly than the explained existing system [13].

Monitoring speed and weight of vehicles using wireless sensing network

Wenjing et al worked on monitoring the speed and weight of vehicles using wireless sensing network where pavement and traffic both can be integrated and monitored at a time. They used the back-calculation method to estimate the speed, configuration and weight of vehicles passing based on response collected by in situ pavement sensors. As they mentioned, this proposed system is still in the preliminary stage, but once it has been successfully completed, it will very helpful to monitor the real-time motion and traffic in future [14].

Implementation Details

Problem Definition

Trustworthiness in public transport is of great importance today. But a huge amount of time is wasted by people who are making use of public transportation; because without knowing the status of bus, people waits for buses in bus stops for long period of time which may bring a very big losses to the bus users. By the drawbacks in the public transportation, people started to prefer private transportation facilities. So that by the usage of the private transportation traffic, fuel consumption increases and causes pollution. So, if they get exact location and crowd in the bus, they can make their own decision or any alternative way to reach their destination in time so that we can overcome this problem. Since there is no accuracy being maintained in bus tracking applications up to date, we are proposing an application with high rate of accuracy.

Methodology

Our system consists of several modules:

Module 1 Android app is an interface for users. The app will provide the information about bus availability, source, destination and arrival time. Using the app, the passenger can check whether the bus has passed a particular station or not. So that any other alternative can be taken.

Module 2 It is the server which needs to maintain all the information regarding buses which are registered like bus number, location, number of passengers, arrival time, etc., and serves for all the devices which are requesting through Module 1 (app).

Module 3 It is an embedded hardware (Arduino board) in bus where GPS and IR sensors are connected so that all the information sensing from sensors will be transmitted to Arduino board and that will be updated frequently in server.

In our system, we will develop mobile application for passengers. The app will provide the information about availability, source, destination, arrival time in each bus station. Using this application, the passenger can check whether the bus has passed a particular station or not. So, any other alternative can be taken. For this, we will use API of Google maps. By selecting the bus, the passenger can retrieve the present location of bus, waiting time for arrival of bus and number of passengers in bus. Using GPS and IR sensors, we have tracked this information and placed into the cloud storage.

Our system will provide customized notification for passengers based on the history of his travelling in buses. Our system will help the passengers to identify the crowded days. So, it helps children and senior citizens to make alternate transportation arrangements.

Architecture Design

To track the exact location of bus, we are making use of very advanced techniques like GPS, Android application, etc., where the GPS gives the coordinates of bus and that intern is connected to Arduino board which is embedded and placed in the bus.

Doors of bus will be connected with the four infrared sensors where each pair at entry and exit. The function of infrared sensor is to present the object count; so we are using it to count passengers getting in and out.

But we are modifying it as when passengers get in, the count will be increased and when they get out from the bus, the count will be decremented; so by doing this, we can get the passenger count travelling in bus.

All these data (location and count of passengers) will be sent to the Arduino Uno through Bluetooth, and from there, data will get updated to server. Then from the server, users can get the information regarding their buses by android application.

Users can get this detail only once after they have mentioned the source and destination. Once they enter their source and destination, it will display the list of available buses which are arriving towards the source, and then when they select a bus in which they can travel based on their requirements, it displays the whole details of bus like bus number, current location of bus, estimated arrival time of bus to their source, number of passengers currently travelling in that bus, etc.

We are going to find the bus arrival time to the specified source by using the Euclidean distance formula which considers two values to calculate EAT (estimated arrival time); bus one is longitude and latitude value of bus which is fetched from GPS and other one is longitude and latitude value of app user, i.e. this value we can fetch from user’s mobile GPS who is standing near bus stop. So, by getting these values and by using the stated formula, we can calculate the arrival time of bus to that user specified source.

By using longitude and latitude values, we can calculate the estimated bus arrival time, and the details would be delivered to the passenger who is looking for the bus in the bus stop.

Euclidean formula for calculating the distance.

$$D = {\text{squareroot}}\;((x_{2} - x_{1} )^{2} + (y_{2} - y_{1} )^{2} )$$
(1)

We will take the latitude as x and longitude as y, and here, x2 is latitude of bus and x1 will be latitude of passenger who is standing on bus stop. Same as that y2 is the longitude of bus and y1 is the longitude of passenger who is standing on bus stop. So by applying this formula, we can get our estimated arrival time of the bus.

The location of the bus will be updated to the cloud server. Then, all the information of the bus will be processed in the server and displayed on the android app. By making data to be uploaded in server frequently when user is requesting for information regarding some bus, we can provide response directly from server rather than start processing when request is sent, so this reduces the delay to users and congestions on network.

Because of updating the real-time data like location of bus, count of passengers, etc., to the cloud server frequently, we can reduce the maximum delay to the users and also here instead of starting the process when request is sent to the server and then fetching the data from bus like location, count of passengers, etc., in real world which results in huge network congestion and also consumes a lot of resources which is very difficult to implement. So, to overcome all these problems while implementing, we can continuously keep updating the data to cloud server by specifying some time limit in the code which is used to transfer the data from raspberry pi to cloud server. So, this results in easy implementation, and reduces the network congestion and delay.

At the user end, we are providing the android application software which is capable of getting input from user like their source and destination, and then the server will send back the response to the app by fetching the required details of that particular route from the database.

So to increase the bus users by eliminating the current big disadvantages of using public buses like waiting for bus in bus stations for long period of time without knowing the status of bus which simply wastes the time of passengers and also causes delay in reaching their destination; so that we can implement smart bus tracking system to use the public transportation efficiently without causing any unnecessary delays to passengers which help for all bus users like students, workers, etc.

The main thing which we have to concentrate here is by travelling in public transportations, we can save a lot of fuel. We can decrease the traffic level which is a daily routine and also it reduces the pollution also. So, these are the huge factors in which we can bring a great change in society which helps people. To provide all these advantages in efficient manner to the passengers, this idea’s implementation works well.

Hardware Requirements

The radio navigation system based on satellite is called as global positioning system. The main goal of this in our system is detecting the location of bus in real time. An infrared sensor is an electronic device, and we used this sensor to count the number of passengers in bus.

We are making use of pair of IR sensor in bus door as IR1 and IR2; when a person gets in, IR1 will enable first and then IR2 will be enabled so that we can conclude it as passenger is stepped into the bus, so increment count by one and, if IR2 is enabled first and then IR1 is enabling, then we say it as passenger is stepped out so decrement the count by 1. By doing this process, we can keep the count of passengers in bus.

The GPS fetches the bus location, and IR sensor counts the number of passengers in bus. Then from IR sensor and GPS, the data will be transferred to Arduino board which is embedded in bus, and then that information will be updated in cloud server. Cloud computing platform developed a logical server, which is used to store the information real-time data through internet.

The data which we are getting from bus through Arduino board will be updated in cloud server, and when user requests for information of some specific bus, the stored data in cloud server will be conveyed to the user’s through our android application (Figs. 1, 2).

Fig. 1
figure 1

Public bus tracking system using android application

Fig. 2
figure 2

Flow diagram for smart bus system

Software Requirements

We are using android operating system which is developed by Google. It is used for touch screen mobiles, and this is an updated version of Linux Kernel. Since our system is all about developing an android application, to develop an android application, we require an IDE called as Android studio.

We are using Android studio to develop an application software which is needed at user end to code the application we are making use of Java programming language which as its own better features to code easily and efficiently and also it gives a good outlook and user-friendly access to the mobile user.

Results

In Fig. 3, the count of the passenger is been displayed. Once the passenger enters into the bus, the count will be incremented; similarly, if the passenger is out of the bus, the count will be decremented. As shown in figure, the 11 passengers are in the bus. Since one passenger gets down, the count is decremented. The count from 11 passengers is now decremented to ten passengers as shown in Fig. 3. By this data obtained from the two set of sensors, we are going to compute and manipulate the passenger count. All these data obtained are further loaded into the think speak server and displayed in the graphical format as shown in Fig. 6.

Fig. 3
figure 3

Passenger count

In Fig. 4, the latitude and longitude of the bus are retrieved and displayed. The GPS is connected to the Arduino board. After the successful connection, we can retrieve the location coordinates. The coordinates obtained are successfully displayed on the serial monitor as shown in Fig. 4. Further, those coordinates are loaded into the think speak server and displayed in the form of graph as shown in Fig. 5.

Fig. 4
figure 4

Coordinates of the bus using GPS

Fig. 5
figure 5

Updating coordinates to the think speak cloud server

In Fig. 5, the coordinates which are retrieved from GPS and displayed on serial monitor are uploaded to cloud server. The data retrieved from the GPS module are loaded into the cloud, and they are been displayed accordingly in the cloud in the graph format. The latitude graph is displayed towards the right-hand side and longitude graph is displayed in the left-hand side.

In Fig. 6, the count of the passengers retrieved from the IR sensor is uploaded to the cloud server. The passenger count as retrieved from the server is been loaded in the cloud server. The passenger count is obtained from these to IR sensors as shown in Fig. 3. After the data retrieval, they are stored in the cloud and displayed in the cloud server in the graph format.

Fig. 6
figure 6

IR data to cloud

Future Enhancement

Presently, we are concentrating on tracking public buses in real time with high rate of accuracy because till today, there is no public transportation tracking application which runs with accurate results. So, we provide the application which runs on smart phone which is very easy to use by all public transportation users in daily life and that makes their travelling very easy and comfortable. And addition to this, we are also displaying the number of passengers currently travelling in bus by using IOT technology. So that they can get an idea about can we travel in coming bus or else can we move by making any other alternative arrangements instead of waiting for a bus in which we cannot travel by standing for long period of time and so on. So, these are all the areas where we implemented it till now; but in future, we can provide an extra feature which allows the passengers to request for a bus through this application only. To do so, we have to provide an option in app like when a passenger clicks on that button or option, by fetching the current GPS location of user, it should send a message to the nearest bus stops which contains administrative office. The message will contain the current location of passenger who requested for a bus to the particular route. So, in crowded days, anyone can raise a request for bus from anywhere, and they can get a bus for that route if the number of requests is more than some threshold value that may be set by bus management team. This overcomes many issues in travelling in public transportation like waiting a long time in bus stops and struggling in bus while travelling because of heavy rush which irritates more to the old age people, children, girls, etc. So this work in future uses a smart technology and makes it very comfortable to travel in public transportation without any fears and worries. So that we can make people to use public transportation very easily for their daily needs which results in more advantages like reducing usage of vehicles, pollution, fuel, traffic, etc.

Conclusion

In this paper, we are proposing a system which is very helpful to the public transportation users to reach their destination in time. Because this system provides exact location of bus in which GPS is placed and total number of passengers in bus who are travelling currently, the users can easily get to know the status of bus, i.e. whether the required bus which reaches their destination can take them in time without any delay and also, they can know about the number of passengers travelling in bus which helps to know the crowd in the public transportation system. This system is not only limited for the bus but can also be implemented for railways for the unreserved compartments. By this system, seniors and children can get the information about seating and move with the alternative if required. To implement this project, we are mainly focusing on android and data mining domain. By using the GPS system, we can track the location and can display it on the maps. Before that, these data should be uploaded to the cloud server at every movement of time so that we can maintain the accuracy. Then from cloud, we are retrieving their requested bus information to the user’s android app based on their search, and also by getting search history of each user, we can notify them about their buses. So, all this helps a lot to the bus users and saves their time and reduces the pressure.