Real-time GPS Tracking System for IoT-Enabled Connected Vehicles

. This paper presents a real-time GPS tracking solution for connected vehicle networks, leveraging IoT, V2X communication, and VANET technologies. The system uses Arduino Uno R3, SIM800L, NEO6M GPS, Node.js, socket, and Firebase for seamless real-time GPS data collection, storage, and visualization. Users can access and monitor GPS data on a web interface. Integration of Node.js and sockets ensures efficient hardware-software communication, while Firebase enables real-time data storage and synchronization for resource management and tracking. The paper explores the system's applications in dynamic routing for energy efficiency, eco-driving feedback, smart charging stations, environmental data collection, intelligent traffic management, and fleet emissions reduction. These applications highlight the system's versatility, promoting energy efficiency and sustainability across industries. By incorporating IoT, VANET, and V2X communication, the system enables seamless connectivity and data exchange among vehicles, infrastructure, and the cloud, enhancing decision-making and system efficiency. Insights into system implementation, including IoT, VANET, and real-time GPS integration, are provided. The paper discusses transportation, logistics, and vehicule tracking as potential application domains, which hold promise for optimizing energy consumption. The presented solution offers an efficient, reliable platform for real-time GPS tracking in connected vehicle networks, harnessing IoT, VANET, and V2X communication for enhanced decision-making and sustainable transportation systems.


Introduction
In recent years, the convergence of Internet of Things (IoT) [1, 2] and Global Positioning System (GPS) technology has revolutionized various industries, particularly transportation. The integration of IoT-enabled connected vehicles [3] with GPS tracking systems has unlocked new possibilities in terms of efficiency [4], safety [5], and convenience. This paper aims to explore the transformative potential of real-time GPS tracking systems for IoT-enabled connected vehicles [6], shedding light on their significance in modern transportation [7]. The IoT has transformed the way physical objects interact with the digital world, enabling seamless communication and data exchange. By integrating GPS technology into this IoT ecosystem [8], connected vehicles can accurately determine their geographical position, track their movements, and transmit real-time data to remote servers [5,9]. Prior research has highlighted the importance and benefits of integrating IoT and GPS technology in connected vehicle systems [10]. For instance, previous studies have emphasized the role of GPS technology in enabling real-time monitoring [11][12][13], route optimization [14], and predictive maintenance, ultimately enhancing fleet management, reducing fuel consumption [15][16][17][18], and improving operational efficiency. GPS data [19], combined with IoT-based sensors, has also been shown to improve driver safety by detecting and alerting drivers about potential risks. Furthermore, the integration of IoT and GPS technology in smart cities has demonstrated its effectiveness in traffic management, optimizing traffic flow [20], and alleviating congestion [2,21]. While existing studies highlight the potential of IoT and GPS technology in connected vehicle tracking systems [22,23], further research is needed to address integration challenges, security concerns, and scalability issues associated with such systems. This paper aims to contribute to the existing literature by providing a comprehensive analysis of the functionalities, benefits, and challenges of real-time GPS tracking systems [24,25] for IoT-enabled connected vehicles. In conclusion, this paper focuses on the development of a real-time GPS tracking solution for connected vehicle networks [26], leveraging IoT technologies to enhance resource management and tracking in real-time. The paper will discuss the implementation process, highlighting the utilization of the Arduino Uno R3 [27], SIM800L module [28], NEO6M GPS module [29], Node.js, socket, and Firebase [30], highlighting the utilization of specific hardware and software components. Furthermore, it will explore the potential applications of this real-time GPS tracking solution across various industries. The paper aims to provide valuable insights into the capabilities and benefits of integrating real-time GPS tracking with IoT-enabled connected vehicles, paving the way for more efficient and sustainable transportation systems.

2
Methodology and Implementation

Description of the system architecture for the real-time GPS tracking solution
This study focuses on the implementation of a real-time GPS tracking solution for connected vehicle networks, employing a combination of diverse technologies and frameworks. Specifically, the Arduino Uno R3 microcontroller, SIM800L GSM module, and Neo6M GPS module were utilized to acquire and process real-time location data. The system architecture, depicted in Figure 1, illustrates the components and their interactions within the proposed solution. The GPS module transmitted the data to the Arduino Uno R3 board, which then communicated with the SIM800L module to send the data over the GPRS protocol to a cloud-based backend server.

Fig. 1. hardware architecture
The physical implementation of the real-time GPS tracking system involves wiring the components, including the Arduino Uno R3, SIM800L module, and NEO6M GPS. The connections are established as follows:  NEO6M GPS module: VCC pin connected to the Arduino's 3.3V pin, GND pin to GND, TX pin to RX, and RX pin to TX.  SIM800L module: VCC pin connected to the Arduino's 5V pin, GND pin to GND, TX pin to RX, and RX pin to TX. These connections facilitate communication between the modules and the Arduino Uno R3 board, while the board itself is powered using a USB cable connected to a power source.
For efficient data storage, the Firebase Realtime Database was employed on the backend server to store the received location data. To handle the frontend server functionalities, a cloud-based architecture was established using Node.js and Express.js. These frameworks facilitated seamless communication with the Firebase Realtime Database and efficient handling of incoming data. Additionally, a WebSocket connection was integrated into the frontend server, enabling real-time data transfer between the frontend and backend servers. To visualize the real-time location data, the Leaflet library was implemented on the frontend server. This library provided an interactive web map interface that dynamically updated as new location data was received from the GPS module and stored in the Firebase Realtime Database. The combination of Leaflet, GPRS protocol, Firebase Realtime Database, and WebSocket connection yielded a robust and effective real-time GPS tracking system. This system allows users to conveniently access and monitor the tracked vehicles' locations through a web application. The seamless integration of these technologies and frameworks ensures reliable performance and efficient data handling for real-time tracking, as illustrated in Figure 2.

Implementation Process
The implementation process of the real-time GPS tracking solution for connected vehicle networks involves several key components and technologies. This section describes the implementation process in detail.

Socket.IO
Socket.IO, a JavaScript library, is utilized in this project to establish a WebSocket connection between the web application and the backend server. The library enables real-time and bidirectional communication between the two entities, facilitating the seamless transmission and updates of GPS coordinates of the vehicle.

Leaflet
Leaflet, an open-source JavaScript library, is utilized to display the vehicle's location on the web application. The library provides mobile-friendly and interactive maps, offering ease of use, flexibility, and customizable map styles.

Firebase
Firebase, a cloud-based platform, serves as the backend database for storing GPS coordinates and other relevant data. It is selected for its real-time database capabilities, seamless integration with Node.js, and ability to handle large amounts of data.

Establishing an HTTP connection
To establish an HTTP session with the SIM800L module, a series of AT commands must be executed. These commands are transmitted to the module through serial communication using the Arduino Uno R3 microcontroller. Figure 3 illustrates the system workflow for this process. The workflow involves sending a sequence of AT commands from the Arduino Uno R3 microcontroller to the SIM800L module via serial communication. This procedure enables the module to establish an HTTP session by connecting to the network, configuring the connection type, specifying the Access Point Name (APN), opening a GPRS context, initializing the HTTP service, and setting the URL for data transmission. The session can be terminated using the AT+HTTPTERM command. It is crucial to consult the module's datasheet and the documentation provided by the network provider to ensure the correct commands are used. Figure 4 depicts the schema of the software workflow. In the context of connected vehicles and GPS technology, the backend server plays a pivotal role in managing and processing data. The backend server receives GPS coordinates from the connected vehicle via the frontend web application. These coordinates are transmitted through an HTTP request and processed by the backend server, which is built using technologies such as Node.js and Express.js. Leveraging the power of GPS data, the backend server performs various operations, including real-time tracking, route optimization, and geofencing. It interacts with the connected vehicle using Socket.IO, facilitating seamless and efficient communication. Moreover, the backend server integrates with other system components, such as the Firebase Realtime Database, to store and retrieve GPS-related information. This integration enables the backend server to provide real-time updates and notifications to users, ensuring accurate tracking of the connected vehicle's location and movements. As the backbone of the system, the backend server orchestrates the flow of GPS data, facilitating the effective utilization of location-based services within the connected vehicle ecosystem.

Web Development
The frontend of the web application is developed using HTML, CSS, and JavaScript. HTML is employed for structuring the content, CSS is used for styling the web page, and JavaScript enables interactive functionality. Tailwind CSS, a utility-first CSS framework, accelerates the development process by providing pre-defined utility classes that style HTML elements, eliminating the need for extensive custom CSS and generating class names. Next.js, a React-based server-side rendering framework built on React and Node.js, empowers developers to build scalable and optimized web applications with features such as server-side rendering, automatic code splitting, static site generation, and performance optimization. Node.js, an open-source JavaScript runtime environment, is chosen for its fast I/O capabilities and ability to handle multiple connections simultaneously, making it ideal for developing both the web application and backend server.

Results and Discussion
The utilization of cloud-based deployment on Vercel offers significant benefits to the system, particularly in terms of scalability and availability. This deployment approach ensures that the system can seamlessly accommodate a larger user base and remains accessible without interruptions. Users can conveniently access the system from various internet-connected devices, guaranteeing a smooth user experience. Figure 6 provides a sample dataset used in the analysis.

Fig. 5. sample dataset used in the analysis
Analyzing the provided data, the following fields are described: • Time: The "Time" field represents the timestamp indicating when the GPS data point was recorded. It provides specific information about the date and time of data collection. • Latitude: The "Latitude" field indicates the geographic coordinate of the location where the GPS data point was recorded. It specifies the north-south position relative to the equator, measured in degrees. • Longitude: The "Longitude" field represents the geographic coordinate of the location where the GPS data point was recorded. It indicates the east-west position relative to the Prime Meridian, measured in degrees. • Altitude (m): The "Altitude" field denotes the elevation above sea level at the location of the GPS data point. It is measured in meters (m) and provides information about the vertical position or height. • Speed (km/h): The "Speed" field indicates the velocity or rate of movement of the GPS device or object at the given location. It is measured in kilometers per hour (km/h) and reflects the speed at which the device or object is traveling.
In summary, the provided dataset consists of the following fields: Time (timestamp), Latitude (geographic coordinate), Longitude (geographic coordinate), Altitude (elevation above sea level), and Speed (rate of movement). These fields collectively provide valuable insights into the time, location, elevation, and speed associated with each GPS data point. The Real-Time GPS Tracking System, employing Arduino Uno R3, SIM800L, Neo6M GPS, and integrated with a web application using sockets and Firebase, demonstrates its potential as an efficient and reliable vehicle tracking solution. Figure 7 illustrates the web application, which enables users to visualize the real-time location of their vehicles on a map. Additionally, the web application offers supplementary features such as historical location tracking, speed monitoring, and geo-fencing. The integration with Firebase facilitates cloud storage for location data and ensures real-time data synchronization between the web application and the backend server.

CONCLUSION
The Realtime GPS Tracking System presented in this paper demonstrates its effectiveness as a robust and accurate solution for real-time vehicle tracking. By utilizing Arduino Uno R3, SIM800L, NEO6M GPS, and integrating web applications with Socket and Firebase technologies, the system enables seamless data collection, analysis, and visualization. The incorporation of connected vehicle technology facilitates comprehensive monitoring of engine diagnostics, fuel consumption, and speed, providing users with valuable insights for enhancing efficiency, safety, and decision-making processes. The cloud-based deployment on Vercel, combined with Firebase integration, ensures scalability, security, and effective real-time data management. The successful testing and demonstration of the system validate its ability to accurately track connected vehicles, making it a reliable tool for various industries. Specifically, logistics, transportation, and emergency services can benefit from its potential to optimize fleet management and operations. Looking ahead, implementing recommended enhancements and expanding integration capabilities can further improve the functionality of the Realtime GPS Tracking System. By catering to the evolving needs of businesses and industries, it can continue to deliver data-driven optimizations, enhance operational efficiency, reduce costs, and improve overall fleet management.