Vehicle tracking system using working sensors of a partially functional android mobile phone

Vehicle tracking has found its applications in a variety of domains. Most of the currently available vehicles tracking systems are based upon using some expensive tracking units that employ only GPS signals to determine position and have very high monthly subscription charges from their service providers. To reduce the cost for such applications, this paper proposes the use of a partially damaged or low-cost android device with GSM capability and some other useful working sensors to periodically report the location and then display and monitor the determined location set on a remote digital map. This device can be integrated with a vehicle and made to boot up and start tracking automatically as soon as the vehicle’s ignition is turned on and stop tracking and shutdown automatically after the vehicle’s ignition is turned off. These devices may find application in fleet management, public transport systems, etc. as discussed inside this paper.


Introduction
In today's world of technology, mobile devices are no longer the devices used only for voice communication or short messaging service, but the evolution of various technologies like smaller integrated circuits; compact and fast processors; multimedia output-input capability, etc. has brought about a revolution in the field of mobile technology [1]. The cell phones today can deliver most of the services offered by the traditional computers and the integration with various other sensors like GPS antenna, Digital compass, and Gyroscope etches further enhanced their utility [2][3]. These devices are often termed as Smart Phones. Different operating systems have been designed to operate on these devices in order to optimize their battery life, responsiveness, etc.
Android platform is a new generation of smart mobile phone platform launched by Google [5][6]. Android supports GPS, Video Camera, compass, and 3d-accelerometer and provides rich APIs for map and location functions, which is probably the concern of vast numbers of developers now a days. Users can flexibly access, control and process the free Google map and implement location based mobile service in his mobile systems at low cost. But owing to their sophisticated hardware, these devices are even more vulnerable to crashes. A simple drop may leave the device bricked and it may then seem useless to normal user, however it has been observed that in most cases only some of the hardware like screen, outer surface, speaker, camera etc. are damaged leading to the malfunctioning of the overall system. These partially functional android devices can be employed as a vehicle tracking device after examining whether the required hardware like GPS antenna, Network receptor, gyroscope etc. are properly functional or not [4]. The paper introduces various sensor combinations and generic algorithms for location reporting that comes under the study of Telematics [7]. This paper contributes to the field of vehicle tracking systems by proposing a novel approach that leverages the working sensors of a partially functional Android mobile phone to track the location and driving behavior of vehicles. The paper presents a system that uses the GPS and accelerometer sensors of a mobile phone to track the vehicle's location and speed and analyzes the data to detect aggressive driving behaviors. The system is designed to be low-cost and accessible, as it uses existing hardware and software that are widely available.
One of the main contributions of the paper is that it shows the feasibility of using a mobile phone's built-in sensors to track vehicles accurately. This is significant because it opens up the possibility of implementing vehicle tracking systems in a wide range of applications where specialized hardware and software may not be available or practical. For example, the proposed system could be used in developing countries where the cost of specialized tracking systems may be prohibitive.
Overall, the paper makes an important contribution to the field of vehicle tracking systems by proposing a novel approach that is low-cost, accessible, and effective. The proposed system has the potential to be implemented in a wide range of applications, from fleet management to personal vehicle tracking, and could help improve safety, reduce emissions, and save costs.
The use of working sensors of a partially functional Android mobile phone for vehicle tracking systems is a novel approach that has the potential to revolutionize the way vehicle tracking systems are implemented. Additionally, the use of a camera sensor allows the detection of road signs and other objects, which could be used to further enhance the system's capabilities.
The studies in the section 2, shows that there are few areas where the existing work could be improved or extended to make it even more innovative. One area that could be explored further is the integration of additional sensors to improve the accuracy of the tracking system. For example, the use of a magnetometer sensor could help improve the accuracy of the system in areas where the GPS signal is weak or unreliable. Another area where innovation could be added is in the development of algorithms to analyze the data generated by the sensors. The use of machine learning techniques has already been explored in some of the existing work, but there is potential for the development of more sophisticated algorithms that could improve the accuracy of the system even further. For example, the use of deep learning algorithms could enable the system to learn from previous data and make more accurate predictions about the vehicle's behavior. The existing work lacks in demonstrating the potential for using machine learning techniques to analyze the data generated by the sensors and detect aggressive driving behaviors. By detecting aggressive driving behaviors such as sudden acceleration and harsh braking, the system could help reduce fuel consumption, improve safety, and reduce emissions.
This could involve the use of visualizations to help users better understand the data generated by the sensors, or the development of a mobile app that allows users to access the data and track their vehicles in real-time. There are many opportunities for innovation in the development of vehicle tracking systems using the working sensors of a partially functional Android mobile phone. By exploring these opportunities, it may be possible to develop a system that is even more accurate, efficient, and user-friendly than the existing approaches.

Literature Review
Vehicle tracking systems have become increasingly important in recent years for managing and monitoring vehicle fleets. Traditionally, these systems have relied on specialized hardware and software to track the location of vehicles. However, with the advancement of technology, it is now possible to leverage the sensors of a partially functional Android mobile phone to track vehicles. In this literature review, we will explore the existing research on the use of working sensors of a partially functional Android mobile phone for vehicle tracking systems.
The study by Brahim, S.B et al., 2022,[8] focused on driver behavior profiling, which is important for insurance industries and fleet management. The use of mobile applications to classify driver behavior is in the spotlight of autonomous driving, but using mobile sensors may raise security, privacy, and trust issues. To address these challenges, the authors proposed using the Carla Simulator available on smartphones to collect data from sensors such as accelerometer, gyroscope, and GPS, which will help to classify driver behavior based on speed, acceleration, direction, and 3-axis rotation angles. The authors also explored different machine learning algorithms for time series classification to evaluate the one that results in the highest performance.
Lindow and Kashevnik, 2019 [9], investigated the use of smartphone sensors and machine learning to detect abnormal driving behavior. The authors conducted a literature review to explore current studies in this area and found that different machine learning approaches and sensor data were used. Based on their findings, the authors proposed a driver decision support system that uses neural networks for classification and smartphone-based sensor data. This approach allowed the system to be accessible to a wider range of people, regardless of their car type.
The paper by Jahan et al. 2019 [10], proposed an easy system for tracking real-time bus location using the GPS and SMS features of mobile devices. The system consisted of a server device and a client device, with the server device installed on the bus to provide its exact location to the server or the user in case of an SMS query. The client device can find the bus location either through SMS or a mobile application, and experiments showed that the proposed system outperformed other similar vehicle tracking systems.
Another study by Júnior J. F. et al. 2017 [11] focused on driver behavior profiling and its impact on traffic safety, fuel consumption and gas emissions. It also explored the automated collection of driving data and the application of computer models to generate a driver aggressiveness profile. The paper investigated the usage of different Android smartphone sensors and classification algorithms to achieve high-performance classification. The results showed that specific combinations of sensors and intelligent methods allow classification performance improvement.
Chaudhary et al., 2017, [12] explained that a vehicle tracking system is an Android-based mobile application that uses GPS to track nearby vehicles and help people find them quickly, especially during emergencies. The system connects drivers and passengers, reducing travel time and energy consumption. The development of mobile applications has been made possible by the mobile trend and 3G network. The authors proposed a system that used Java programming language, Android OS, PHP web server, and GPS location provider to provide a smooth and hassle-free user experience.
The article by Saha S et al. 2015 [13], discussed the battery life toll of GPS tracking on mobile devices and proposes a low-power and low-cost location tracking system that utilizes the accelerometer, magnetometer, and gyroscope sensors in a smartphone to track continuous locations of a mobile device with good accuracy. The system was tested on both indoor and outdoor locations and has generated an accuracy level of as low as 2 meters distance. The system offered huge savings in terms of battery power consumption, up to 20% for a run of 3 hours, and can be a good alternative to the costly GPS system for location tracking.
If the sensors can be extracted from the partially damaged mobile phone, they provide an alternative to the expensive sensors. By using the built-in sensors of a partially damaged mobile phone, vehicle tracking systems can be implemented at a lower cost, making it accessible to a wider range of users. Additionally, machine learning techniques can be used to analyze the data and improve the accuracy of the tracking system. Overall, the existing research has shown that leveraging the sensors of a partially functional Android mobile phone for vehicle tracking systems is a promising approach.

Cheapest Vehicle Tracking System Currently in use
There are various vehicle tracking system available but some of them which are currently in use have been shown in figure 1.

Passive tracking devices
 Devices such as Tracking key, tracking key Pro, GPS 3100 etc. are the smallest available GPS devices in the market.  Secretly placed in the car, where it sits idle until the car is started and placed in motion. Motion sensors activate the covert GPS tracker data recorder which stores data in a flash drive that can be plugged into any Windows based computer later and downloaded.  Passive in nature.  No provision for indoor tracking.  The ever so increasing demand of cost-efficient vehicle tracking systems dealing with almost all aspects of security and privacy is the major motivation behind our work. The paper proposes the use of a partially functional or low-cost Android device as a vehicle tracking unit. It is easy to implement self-location, to draw the driving trace, to perform queries and to flexibly control the real-time map on Android [14]. The actual system also achieves high running performance. The proposed system combines the features of active and passive tracker with database API in Android, records path even when GSM signals are not available and sync them when connected, boots up and turns off automatically in compliance to the vehicle's ignition, and can even use SMS functionality in case of an emergency. Moreover, there is no third-party interference thus relieving the client from high subscription charges and ensuring privacy of data as well. Functionalities of the android devices and features such as camera, microphones etc. can be used to communicate or interact with the current driver. Sensors such as gyroscope can be used to detect the sudden collisions (collision detection of vehicles) or sudden change in the inertial activity of vehicle in case of accidents when the driver is unable to communicate. More extensibility and easy automatic client application updating is possible with androids [15].

Features of current tracking systems:
 Alerts are sent to you via, such as when your vehicle moves from a stationary position or when your car is moving faster than a preset speed. Basically, you will know where your vehicle is, where it is likely going, how fast it is going and more, meaning you will have full knowledge and control over your vehicles when you are not in it.  Cost efficient but the proposed system is inexpensive in comparison to this one.  No provision for indoor tracking.  No provision for path tracing, only displays the current location. 

Proposed Work
In this section the sensors and common positioning methods used in this research work have been discussed followed by proposed method. The sensors used for positioning in android runtime environment are given below:

Useful Sensors Combination for Positioning
Normally an android device has the following sensors that can be used alone or in combination with one another to determine the location of the device: GPS antenna (measures most accurate position up to 3 meter), Wi-Fi adapter (for Wi-Fi positioning), GSM signal receptor (for cell-ID positioning), gyroscope (for sensing orientation), magneto-meter (used as digital compass), Accelerometer (motion sensor),USB OTG (a specification to add USB devices ) and Barometer (for altitude calculation) [16][17][18][19][20]. In figure2, a screenshot of an android device is shown and running of an application "phone tester" demonstrating the use of various sensors in programming interface.

GPS Positioning:
The Global Positioning System (GPS) is a precise satellite-based navigation system providing three-dimensional positioning, velocity and time information all on a twenty-four-hour basis [20][21][22][23][24]. The tracking unit receives the GPS signal and calculates how far the satellite is and then determines its own position based upon this distance. Now a day's another type of satellite system named as GLONASS is also being used for the same purpose. Most of the new devices use signals from both systems for high accuracy. Some new devices also use barometer to reduce the time to fix first as altitude is provided quickly, leading to faster positioning. One of the systems that use the combination of different satellite system and barometer has been discussed in [27].

Wi-Fi Positioning:
Based upon the MAC address of various hotspots, an open source database is created online for MAC to Position mapping. On the basis of various signals and signal strength available, the approximate location of a device is determined. Accuracy is within the range of about a100 meters [25].

Cell-ID Positioning:
Similar to Wi-Fi Positioning but the database in this type of positioning is maintained using GSM BTS ids. Accuracy is within the range of about 1 to 1.5 kilometers [19-20].

Gyroscope with Accelerometer:
Determining the orientation and speed of motion the continuous change in location can be monitored [1]. This system thereby calculates its current position very quickly and hence used in missile science. However, because the sensors in mobile device are weak, it may generate huge error when used for a long duration. The use of these inertial sensors integrated with GPS can give us an all-time reliable positioning technology [24][25].

Laser Mouse Optic Sensor with magnetometer
A combination of an optical mouse microprocessor and an electronic compass (magnetometer) may be used to measure speed and direction. The optical mouse is a very low-cost sensor and has the advantage that the measured displacement is independent from the kinematics of the vehicle because the optical sensor uses external natural microscopic ground landmarks to obtain the effective relative displacement. This algorithm is used for implementing odometer in Robotics [20]. This combination can also be used to determine the current position when GPS signals are weak. For this system, the focal length of a camera lens is to be adjusted and this device can then be attached to the device using USB OTG [26] port. The approach is better illustrated in figure3 below. Both the generic techniques require a high precision reference point to start with, which is provided via GPS positioning.

Proposed Tracking System
The Vehicle Tracking System Using Working Sensors of a Partially Functional Android Mobile Phone" was built using the working sensors of an Android mobile phone, specifically the GPS and accelerometer sensors. The system was designed to be low-cost and accessible, using widely available hardware and software. Here are the basic components and steps involved in building the system:  Mobile phone with working GPS and accelerometer sensors: The first step was to develop an Android mobile phone with working GPS and accelerometer sensors. The GPS sensor was used to track the location and speed of the vehicle, while the accelerometer sensor was used to detect sudden acceleration and harsh braking.  Data collection and processing: The system collects data from the GPS and accelerometer sensors using a custom-built mobile application. The data was collected continuously and transmitted to a server for processing.  Server-side data processing and analysis: On the server, the data was processed and analyzed to detect aggressive driving behavior. The system uses machine learning algorithms to analyze the data and detect sudden acceleration, harsh braking, and other driving behaviors that may indicate aggressive driving.  Visualization and reporting: The analyzed data was then visualized and reported to the system's users. This allows users to track the location and driving behavior of their vehicles in real-time and identify areas where improvements can be made The complete working of proposed system is shown in figure 4. Depending upon which available sensors combination to use in addition to GPS for optional indoor position estimation (when GPS signals are not available), the client application is designed. The application reports location on regular intervals or when significant displacement from old reported position is achieved. These Geo-coordinates are sent using mobile data in a GSM network. To receive and store these coordinates either cloud storage services are used or a dedicated server is set up (recommended) that sync the location of various location reporting devices mounted on different vehicles. A web application that enables vehicle owners or authorities to view the position of vehicle on digital maps is also needed to be developed.
The Eclipse IDE with ADT plug-in is normally used for android application development which requires a profound knowledge of Java programming language in addition to the knowledge of various APIs provided for using various resources of the system. On server side, the coordinate data along with the time stamps is stored in a database and the web application is designed using any of the technologies like JSP, PHP, etc. To display the path trace of the vehicle a digital map API is required, which usually have very expensive private license. Thus, a popular open source map API known as Google Map API [22][23] which offers the most updated maps and easy to use programming interface is recommended. The overall scenario is depicted in figure 4.

Integrating with Vehicle
Integration here refers to the automatic boot up and turning off the initially off Android device in accordance to the vehicle's ignition being turned on or off. The function requires kernel level modifications to the android software running on the device. Thus, we either need to root the device or compile a custom ROM for it in which we remove the malfunctioning hardware drivers so that Android doesn't recognize them anymore and make it boot when charger is connected instead of displaying the charging battery sign. An application "NoMoarPowah" [27] needs root access on phone and it enables user to automatically boot up and shutdown some Samsung devices at defined timing. It also replaces the default charging screen of a switched off android device.
Some of the mobile devices from Sony (XPERIA mini), Spice have this automatic boot feature in their stock ROM, but for a normal mobile this feature is obsolete and hence has been removed in later firmware updates [28]. Almost all vehicles have a battery and a 12-volt DC source inside them normally termed as cigarette lighter slot. This slot is powered up when the engine is ready for ignition and stops the supply when the ignition is turned off. A good quality USB charger (1000 mA, as tracking applications drains battery heavily) is attached to the power slot to power up the android device so it can recognize the engine's ignition being turned on or off. Next a service that can automatically start the tracking application and turn on mobile data is implemented on device. This service also monitors the charger connection status for at least 60 seconds after power is unavailable in order to determine whether the engine has been turned off or not.

Map Trace Improvement Algorithm
While tracking the vehicle live from a remote location, location reporting frequency needs to be high. But in case when no one is observing the vehicle in real-time, continuous location reporting is done after a certain time interval. This may lead to inaccurate path trace on digital maps as depicted in figure 5&6.
Instead of using reporting location at fixed time intervals, a variable reporting time can be used. This is based upon the prediction of turns and curves in a track using various sensors like gyroscope or magnetometer with accelerometer. If a device equipped with gyroscope is kept horizontal (parallel to ground), the measure of angular velocity in Z direction can help determine changes in track. In fact, the following equation relates reporting time with rotation of vehicle: ∝ Here ' ' is the frequency of taking GPS coordinate reference and ' ' is the absolute angular velocity recorded by the vehicle in direction perpendicular to the plane of motion.

Experimental Results
The proposed tracking system described in the paper is designed to track the location of vehicles using a combination of sensors, including GPS and potentially other sensors for indoor position estimation when GPS signals are not available. The system works by collecting and reporting the vehicle's location at regular intervals or when there is a significant displacement from the previously reported location. The location data is transmitted using mobile data in a GSM network to a server for storage and processing. The system can use cloud storage services or a dedicated server to store and sync the location data from different reporting devices mounted on various vehicles.
To display the vehicle's position on digital maps, a web application is developed using technologies like JSP, PHP, etc. The web application would use a digital map API to display the vehicle's position and path trace. The paper recommends using the Google Map API, which is a popular and widely used open-source map API that provides updated maps and an easy-to-use programming interface.
The proposed method can record track with better accuracy as shown in figure 6. Good path trace may assist in lane detection at various geographical locations where automatic lane detection is not possible with the help of satellite images. It may also help in marking temporary paths in deserts, mountains etc. for special purpose tours and travels.

Conclusion
The paper describes an approach for live vehicle tracking making use of a partially functional and low-cost Android device with various useful working sensors and built-in GPS & web capabilities. The generic architecture discussed in the paper presents an approach towards indoor positioning. The map trace optimization method suggested above records track with a better accuracy and can be employed in automatic lane detection. Therefore, the proposed system incorporates most of the functionalities offered by the existing tracking devices along with its own and reports location even more accurately and that too at an affordable & comparatively low factory price. Moreover, Android being a productive and growing technology, the work has even better scope for future enhancements.
Following are the future scope of proposed work:  An efficient low cost dedicated tracking device can be built on scenario of low-cost AKASH TABLET [28] by adding the required and removing the unnecessary sensors from the existing device.  Taxi Management System: people can request a taxi pick up and a centralized system can help avail the nearest possible taxi service.  Intelligent Public Transportation System: Centralized public transport vehicle routing on the basis of number of passengers waiting at the stop and their destined location.  Entertainment purpose: the system alleviates the need of additional entertainment system such as music player; radio etc. if application framework is utilized accordingly.  "Text to speak" API of android may be used for sending messages and instructions to the vehicle driver over the network in textual form.
Apart from the above future scope, the further research is required to address challenges such as battery life, signal reception, and data security.