Internet of Things System for Monitoring and Comprehensive Security for Public Transport Risk Monitoring and Operational Safety with Real-Time Analysis and Automated Alerts
Abstract:
Public transport plays a key role in urban mobility, yet it continues to face persistent safety challenges, particularly in Latin American cities where speeding, traffic accidents, and drunk driving remain frequent. This study presents an Internet of Things (IoT)-based monitoring system built around an ESP32 microcontroller and a set of low-cost sensors, including a NEO-6M GPS module, an MQ-3 alcohol sensor, an MQ-2 gas sensor, and an HC-SR04 ultrasonic sensor. The system monitors critical operational variables such as vehicle speed, driver sobriety, the presence of hazardous gases, and short-range collision risk. Alert messages are generated automatically and delivered through a Telegram bot, while operational data are stored and visualized using a cloud-based platform. The prototype was deployed and tested under real public transport operating conditions. The results show that the system is capable of detecting speeding events, alcohol presence, and abnormal gas concentrations in a timely manner. In addition to vehicle-level monitoring, the collected data can support basic operational safety management by providing information that may assist transport operators in preventive decision-making. Due to its modular design, low implementation cost, and use of widely available technologies, the proposed system offers a practical solution for risk monitoring in public transport systems operating in resource-limited urban environments.1. Introduction
Urban transportation, whether personal or commercial, has grown excessively in recent decades, generating increasing challenges for cities by progressively overloading local and intercity road networks. Public transport systems play a central role in ensuring territorial accessibility and enabling dynamic economic activity; however, this transport flow is often highly exposed to current problems related to the safety of drivers and passengers, negatively affecting the quality of life of all users. In many urban contexts, especially outside Europe, public transport vehicles operate under conditions characterized by passenger overcrowding, insufficient surveillance, and limited technological support. These weaknesses not only contribute to service inefficiency but also increase exposure to crime and traffic-related incidents [1], [2].
In Latin America, the situation of public transport is even more critical, as it relies heavily on bus-based systems, which face persistent challenges linked to operational safety and passenger protection. Traffic accidents, robberies, and unsafe driving practices remain frequent, highlighting the need for practical and scalable technological interventions. In Peru, this situation is particularly severe. Several studies indicate that more than half of public transport users perceive their journeys as unsafe, yet they are forced to rely on urban transport for commuting to work or educational centers, while victimization levels continue to rise above regional averages [3]. Likewise, traffic accidents remain a serious public health problem, with thousands of fatalities reported annually, many involving vulnerable road users such as pedestrians [4].
Recent statistics confirm the magnitude of this problem. In Metropolitan Lima, traffic accidents increased by approximately 10% in 2023, reaching more than 41,000 reported cases [5]. At the same time, insecurity incidents inside public transport vehicles, including theft and harassment, have been recurrently recorded by authorities [6]. Similar challenges are observed in the city of Trujillo, located in northern Peru. With a high dependence on urban bus transport and a growing number of daily trips, Trujillo has experienced a significant increase in crime rates, exceeding 30,000 reported offenses in 2023 alone [7]. At the same time, studies indicate that safety and security concerns, including crime exposure, lack of perceived safety inside vehicles, and insufficient enforcement, significantly reduce user confidence and willingness to use public transport in developing contexts [8].
In this context, Internet of Things (IoT) technologies offer a viable alternative for improving road safety and operational monitoring in public transport. Through the integration of low-cost sensors, wireless communication, and real-time data processing, IoT-based systems can facilitate the early detection of risky driving conditions and environmental hazards. Previous studies have demonstrated the potential of these technologies to reduce accident rates and strengthen vehicle-level monitoring. The present study proposes an IoT-based monitoring system centered on the ESP32 microcontroller, designed to supervise critical variables in public transport operation, such as vehicle speed, driver alcohol consumption, the presence of hazardous gases, and collision risks due to proximity. Real-time alerts are transmitted via a Telegram bot, while operational data are visualized through a cloud platform, providing continuous situational awareness.
The main research objectives of this study are:
(1) to evaluate the stability of an ESP32-based multisensor monitoring system under real public transport operating conditions;
(2) to analyze the reliability of alcohol, gas, and speed detection in the presence of vehicle vibration, noise, and movement;
(3) to examine the feasibility of real-time alerts through Telegram and cloud platforms for transport safety management.
From a broader perspective, the proposed system aligns with recent developments in Intelligent Transportation Systems (ITS), which enable the use of real-time data and the integration of multiple sensors to promote safer and more efficient urban mobility [9]. Recent bibliometric studies highlight the growing role of data-driven approaches and intelligent monitoring in improving road safety and transport system reliability [10]. Furthermore, research on ITS adoption in developing cities emphasizes the importance of cost-effective and context-aware solutions, reinforcing the relevance of the approach presented in this work [11].
2. Literary Review
Several studies have examined the use of IoT technologies in vehicle safety and protection through real-time monitoring and automated intervention mechanisms. A significant portion of this research has focused on theft prevention and vehicle tracking. For example, Arellano-Zubiate et al. [12] integrated GPS, RFID, and GSM technologies within a mobile application that enables vehicle localization and ignition control under unauthorized situations. Similarly, the works of Supriyono and Amali [13] and Aryatama and Samsugi [14] proposed ESP32-based solutions aimed at motorcycle security, incorporating remote alarms, engine shutdown mechanisms, and smartphone connectivity to reduce theft in urban environments.
Other studies have addressed accident prevention through the monitoring of driver behavior and environmental conditions. Sabri et al. [15] and Alsayaydeh et al. [16] integrated alcohol sensors, speed monitoring, and GPS modules to detect risky driving conditions, such as driving under the influence or overspeeding, enabling real-time alerts or engine blocking mechanisms. Although these approaches show high detection accuracy, they are generally designed for private vehicles and do not directly address the specific operational requirements of public transport systems.
Additional research has explored more advanced monitoring solutions that incorporate extended sensing and data processing capabilities. Bhaskar et al. [17] and Kumar et al. [18] proposed systems oriented toward school buses and intelligent vehicles that include driver fatigue detection, air quality monitoring, and, in some cases, machine learning techniques executed at the edge. While these systems improve detection reliability, they rely on higher-cost components and more demanding computational resources, which limit their scalability in budget-constrained public transport contexts.
Camera-based approaches for vehicle authentication and surveillance have also been investigated. Madhuri et al. [19] introduced a facial recognition system using an ESP32 camera to restrict vehicle ignition exclusively to authorized drivers, whereas Monica et al. [20] combined camera modules with Telegram bots for remote vehicle monitoring and control. Although effective for individual vehicle security, these proposals tend to prioritize surveillance rather than integrated monitoring of operational safety risks.
Finally, other works focus on continuous vehicle tracking and logistics optimization. Goyal et al. [21] and Idris et al. [22] developed ESP32-based tracking systems with cellular connectivity, capable of ensuring reliable localization and speed monitoring even under adverse network conditions. Ramadan et al. [23] proposed an IoT-based system for real-time monitoring of environmental pollutants using multiple sensors and AI models. These solutions demonstrate robustness in asset management applications but generally lack mechanisms to detect in-vehicle safety risks, such as exposure to hazardous gases or driver intoxication.
In contrast to the existing literature, most previous studies concentrate on isolated safety or protection functions, such as theft prevention, vehicle tracking, or driver authentication. There remains a limited number of works addressing the integrated monitoring of driver condition, environmental hazards, and vehicle operation within a single low-cost system specifically oriented to public transport applications. This gap motivates the integrated approach proposed in the present study.
To clarify the technical and application-level novelty of the proposed system with respect to existing ESP32-based vehicle safety solutions [13], [14], Table 1 presents a comparative analysis in terms of sensor integration, alert mechanisms, real-time communication, cloud support, and transport context.
Study | Sensors | Alerts | Real-Time | Cloud | Transport Context |
|---|---|---|---|---|---|
[13] | GPS, GSM | Speed | Yes | No | Private vehicle |
[14] | MQ-3, GPS | Alcohol | Yes | No | Generic |
This work | GPS, MQ-2, MQ-3, HC-SR04 | Speed, alcohol, gas, collision | Yes | Telegram + Cloud | Public transport |
3. Method
The methodology used in this project follows a Waterfall approach, structured in six main stages. These stages range from the identification of the work area to the variables. The second block describes the design of the system’s operation. The third block details the materials used, while the fourth block develops both the circuit and the algorithm. The user interface is then presented, and the process concludes with the implementation and testing of the system. Figure 1 illustrates the diagram of this methodology, providing a clear view of the activities and objectives at each stage.

The city of Trujillo, Peru, has high crime rates on public transport. Recent studies indicate that 48.5% of people over 15 years of age have been victims of robbery on buses, while 20.2% reported attempted theft and 21.9% reported the theft of money, wallets, or cell phones [24]. These statistics justify the selection of this problem for the development of the proposed system. See Figure 2.

The variables considered in the system include the detection of alcohol, dangerous gases, smoke, speed, and possible collisions. These variables are monitored by specific sensors with predefined thresholds based on local regulations and technical studies. The following Table 2 shows the sensors and the respective variables that measure and control the project’s operation.
Sensor/Component | Type | Voltage Operation | Measurement Variables | Description |
|---|---|---|---|---|
MQ-2 | Gas sensor | 5 V | Gas concentration (300–10,000 ppm) | Detects gases such as LPG, propane, hydrogen, CO, and alcohol. |
GPS NEO–6M | GPS module | 3.3 V or 5 V | Geographic location | Provides location, speed, and time information. |
MQ-3 | Alcohol sensor | 5 V | Alcohol concentration (0.05–10 mg/L) | Designed to detect alcohol in the air. |
Alcohol consumption, even in small quantities, affects the driver's coordination and judgment. According to the legislation, the permissible limit for public transporters is 0.25 mg/L, and for private drivers, 0.50 mg/L [25]. In this program, an alert is triggered if 0.25 mg/L is exceeded.
Liquefied petroleum gas (LPG), composed of propane and butane, is highly flammable and harmful. Concentrations above 2000 ppm pose a significant health risk and can cause asphyxiation and loss of consciousness [26].
A toxic gas that, at concentrations above 1200 ppm, can cause brain damage and heart problems. The program generates alerts if levels above 200 ppm are detected [27].
Generated by the incomplete combustion of materials, smoke can contain CO$_2$ at dangerous levels. Values above 200 ppm are considered harmful, with alerts being triggered if they exceed 1100 ppm [28].
The limit established by the Government of Peru is 30 km/h on streets and 50 km/h on avenues. This program’s maximum speed allowed is 35 km/h [29].
The system architecture, depicted in Figure 3, is designed in a modular way, divided into five integrated stages: acquisition, using sensors such as MQ-3, MQ-2, HC-SR04, and GPS NEO-6M to capture data from the environment; control, managed by the ESP32 Devkit V1 that processes the data and makes decisions; actuation, with a buzzer that emits acoustic alerts; communication, using WiFi to transmit information; and visualization, which uses Telegram and Arduino Cloud for remote monitoring. This modular design allows for efficient, real-time monitoring with high adaptability and low cost.

To facilitate the system’s physical design, a connection diagram was developed in KiCad software, as shown in Figure 4. An optimized printed circuit board (PCB) was then designed (Figure 5), and its 3D version (Figure 6) shows the final arrangement of the electronic components ready for assembly. The algorithm, called “CODIGO_SISTEM,” was developed in Arduino IDE so that the ESP32 controls all the system’s functions. Part of the code is in Figure 7.




This section describes the mathematical equations implemented to process the data collected by the sensors integrated into the system. These equations were selected based on the required accuracy and the nature of each electronic component.
The distance is calculated by:
where, Duration: The ultrasonic pulse takes to reach the object and return; Distance: Distance measured between the sensor and the object in centimeters; Explanation: Factor 58.2 is derived from the speed of sound in air (343 m/s) and takes into account the double echo path. Comparing 70% of the previous speed with the current one to detect dangerous patterns, to identify rapid decelerations, the following is used:
The alcohol concentration is determined by:
Calculation of sensor resistance (Rs):
where, RL = 20 k$\Omega$R, $V_{supply}$ = 5 V, and $V_{out}$ is the measured voltage.
Calculation of alcohol concentration (mg/L):
where, Ro is the previously calibrated resistance in clean air. The coefficients are derived from the sensor datasheet.
Calculation of sensor resistance (Rs):
LPG, composed of propane and butane, is highly flammable and harmful. Concentrations above 2000 ppm pose a significant health risk and can cause asphyxiation and loss of consciousness [30].
With RL = 1 $\Omega$ and the digitized value of the ADC in a range of 0–4095.
where, pcurve[]: These are coefficients obtained from the calibration of the sensor for specific gases.
| Parameter | Legal Limit | Health Risk | System Alert |
|---|---|---|---|
| Alcohol | 0.25 mg/L [31] | 0.5 mg/L | 0.25 mg/L |
| Speed | 30 km/h [31] | - | 35 km/h |
| CO | 35 ppm [32] | 200 ppm | 200 ppm |
The system differentiates between legal driving limits, health risk thresholds, and alert activation levels, as summarized in Table 3. For alcohol concentration, the Peruvian legal driving limit of 0.25 mg/L [31] is used as the system alert threshold, while 0.5 mg/L is considered a severe health risk. For carbon monoxide, although low concentrations may occur in traffic, the system triggers alerts only when levels exceed 200 ppm, which represents a dangerous exposure [32]. For vehicle speed, the urban legal limit of 30 km/h [31] is considered a regulatory reference. However, based on preliminary field tests, the alert threshold was set at 35 km/h in order to reduce spurious activations associated with brief accelerations and minor GPS measurement variability. This separation between reference limits and alert activation allows the system to prioritize operationally relevant risk events during real-world driving conditions.
Table 4 presents the notation used in the mathematical models and signal processing equations applied in this work, including sensor parameters and system variables required for implementation and reproducibility.
Symbol | Meaning | Unit |
|---|---|---|
Rs | Sensor resistance | $\Omega$ |
Ro | Reference resistance in clean air | $\Omega$ |
RL | Load resistance | $\Omega$ |
pcurve | Calibration coefficients of MQ sensors | - |
$V_{out}$ | Sensor output voltage | V |
$V_{supply}$ | Supply voltage | V |
Distance | Measured distance | cm |
Speed$_{A}$ | Vehicle speed at the previous time step | km/h |
The MQ-2 and MQ-3 sensors were calibrated before installation on the vehicle to establish a stable reference resistance value (Ro) for each sensing unit. Calibration was carried out indoors with the sensors exposed to ambient clean air, avoiding the presence of combustible gases or alcohol vapors.
For each sensor, 20 consecutive readings were recorded after an initial warm-up period until the output signal reached steady behavior. The resulting resistance values were averaged and stored as the Ro reference used in the concentration estimation model during system operation.
This procedure was selected to limit baseline variability and to improve measurement consistency once the system was exposed to vibration, airflow, and temperature fluctuations typical of public transport environments.
Figure 8 presents the wiring layout used during system assembly, derived from the general architecture shown in Figure 5. The diagram includes all sensing modules and the single actuator implemented in the prototype. During testing, the ESP32 was used as the primary power source for all connected sensors. Nevertheless, the MQ-2 and MQ-3 modules allow the use of an external DC supply when higher current stability is required.

Regarding analog signal acquisition, the A0 output of the MQ-3 sensor was connected to GPIO 35 of the ESP32, while the A0 output of the MQ-2 sensor was connected to GPIO 34. Both sensors shared a common ground connection with the microcontroller to enable stable analog readings.
In the case of the buzzer, its positive terminal (+) is connected to PIN 15, which is responsible for sending activation/deactivation pulses, and its negative terminal (-) to the GND of the ESP32. For its part, the ultrasonic sensor connects its VCC pin to the 5 V output of the ESP32, the Trig pin to PIN 4, the Echo pin to PIN 7, and the GND pin to the GND of the ESP32, allowing the reading of digital signals to calculate the duration time of the pulses. Finally, the NEO-6M GPS module connects its VCC pin to the 3.3 V of the ESP32, the RX pin to PIN 16, the TX pin to PIN 17, and the GND pin to the GND of the ESP32, ensuring the proper reception and reading of the data in NMEA format by the microcontroller.

Figure 9 illustrates the operational logic implemented in the proposed system during real-time vehicle monitoring. At startup, the ESP32 initializes the input–output pins associated with the ultrasonic sensor and the audible alert actuator, followed by the establishment of the WiFi connection required for remote communication. Once connectivity is confirmed, the MQ-2 sensor is stabilized and the GPS module is activated to begin position and speed acquisition.
During normal operation, the system executes a continuous processing cycle in which GPS data are validated before being used for speed estimation. When the calculated speed exceeds the predefined threshold of 35 km/h, a warning event is generated. In parallel, the HC-SR04 ultrasonic sensor is used to estimate short-range distances, allowing the detection of abrupt proximity changes that may indicate sudden deceleration or collision risk.
Gas and alcohol levels are periodically evaluated using the MQ-2 and MQ-3 sensors. If concentrations associated with hazardous gases or alcohol exceed the established alert thresholds, the system issues specific warnings. After completing each sensing and evaluation cycle, the system introduces a short delay of approximately 5 s before repeating the process, enabling continuous monitoring and timely notification through the Telegram-based alert mechanism.
Alerts are received in the system through a Telegram bot, which acts as an automated program capable of interacting with users on this platform. This bot allows you to automate tasks such as sending and receiving messages and executing specific, previously programmed actions. The integration of the bot with the ESP32 is carried out through a process that includes creating the bot using the BotFather tool and configuring the microcontroller to manage communication. In addition, Arduino Cloud visualizes the behavior of the monitored variables in real time. This platform allows you to create a “thing,” which is a project in which dashboards are integrated to present the metrics of the variables in real time. Combining these tools guarantees a fluid user experience and facilitates system monitoring from any connected device.
The system prototype was designed to be integrated inside a bus, taking a housing design shown in Figure 10 as a guide. This virtually modeled 3D design allows the housing of the electronic circuit and all components, including inputs for power and proper ventilation. Strategically placed holes ensure that the sensors operate without restrictions while the system is in operation. The housing also provides enough space to contain the ESP32 and the integrated sensors, protecting the electronic components from external factors such as dust and excessive heat.

The physical implementation of the system and the operational tests performed to verify its performance are described in detail in Section IV, including the evaluation of the effectiveness of the alerts and the accuracy of the data displayed in real time on the Arduino Cloud dashboard.
4. Results
The developed prototype was installed on a public transport bus operating under real service conditions in the city of Trujillo, Peru. The evaluation was carried out during regular vehicle operation, under dynamic urban driving conditions. Sensor data were collected related to traffic congestion, speed variations, frequent stops, passenger boarding and alighting events, vehicle position, alcohol presence, hazardous gas detection, and short-range distance measurements. This information flow generated a total of 312 valid records, reflecting both normal conditions and anomalous driving situations observed during routine bus operation. In parallel, the system generated 47 alert events associated with speeding, alcohol or gas detection, and proximity-based risk situations, which were transmitted in real time through the Telegram communication channel.
Table 5 presents the reported response time, which corresponds to the interval between the detection of a critical event at the sensor level and the reception of the corresponding alert by the remote user. Some false alerts were observed, mainly associated with transient variations in the GPS signal that did not represent a real risk. Likewise, a small number of undetected events were recorded, linked to very short-duration situations that did not exceed the defined activation thresholds. Despite these limitations, the system exhibited stable behavior and consistent alert delivery under real public transport operating conditions.
Metric | Value |
|---|---|
Average response time | 2.3 s |
False alerts | 3/47 |
Missed detections | 2 |
The experimental validation focused on analyzing the system behavior under real operating conditions inside the vehicle. Figure 11 and Figure 12 show the physical placement of the monitoring unit and the ultrasonic sensor within the bus cabin. The arrangement of these elements was selected to maintain proximity to the driver area while minimizing any interference with vehicle operation or passenger movement. This configuration enabled appropriate detection of gas concentrations and variables associated with the driver. Figure 13 presents the internal layout of the electronic components and the power supply of the developed prototype.



System operation was evaluated through data visualization using Arduino Cloud dashboards, allowing real-time observation of sensor readings during vehicle operation. Upon system startup, the WiFi connection was established automatically, followed by the transmission of system status messages and geolocation data. As shown in Figure 14, latitude, longitude, and speed values were transmitted periodically and automatically. Figure 15 presents the vehicle trajectory displayed on the map interface, which was accompanied by simultaneous notifications delivered through the Telegram bot.


For proximity detection combined with abrupt deceleration events, the system generated warning messages when nearby objects were identified at short distances, as illustrated in Figure 16. Distance measurements recorded over time are shown in Figure 17, indicating that alerts were activated only when the predefined conditions were met. Speed monitoring tests revealed that the system issued alerts when the vehicle exceeded the configured threshold, as depicted in Figure 18, while Figure 19 shows the progressive speed variation that led to the activation of the warning.



Regarding alcohol detection, tests were carried out by exposing the MQ-3 sensor to controlled conditions. When the measured concentration exceeded the established limit of 0.25 mg/L, the system generated an alert message, as shown in Figure 20. The corresponding sensor response is presented in Figure 21, where the relationship between concentration peaks and alert generation can be observed. Similarly, hazardous gas detection was validated through exposures to LPG, carbon monoxide, and smoke. Figure 22, Figure 23, Figure 24, and Figure 25 show the temporal evolution of the detected concentrations, where the recorded peaks coincide with the activation of system alerts, evidencing its responsiveness to potentially hazardous conditions.






Although the experimental validation of the system was conducted on a single vehicle, the developed prototype is inherently scalable. It can be replicated across a public transport fleet, since each equipped bus can be considered a distributed sensing unit capable of continuously reporting safety-related events. From a fleet management perspective, the consolidation of alerts associated with speeding, alcohol detection, hazardous gas presence, and collision risk enables the identification of recurrent patterns that are not evident when analyzing an individual vehicle in isolation. Over time, these records may reveal routes with persistently elevated risk levels, time periods linked to unsafe driving practices, and zones where specific preventive interventions are required. Such information is valuable for supporting evidence-based decisions related to route planning, driver supervision, and the implementation of targeted safety measures.

Through real-time monitoring, transport operators can use alert records as input for driver training and retraining programs, to identify vehicles requiring preventive maintenance, or to evaluate compliance with internal safety policies. By enabling early corrective actions before risk situations evolve into accidents, the system potentially contributes to reducing costs associated with incidents, service interruptions, and unplanned vehicle downtime, thereby strengthening the overall reliability of public transport services.
In terms of service performance, the early detection of events such as speeding or driving under the influence of alcohol may indirectly influence driver behavior by discouraging abrupt maneuvers and unsafe practices. More uniform and controlled driving is associated with improved schedule adherence, reduced passenger discomfort, and lower conflict rates within the vehicle, all of which are key indicators in the evaluation of public transport systems.
This fleet-level perspective is particularly relevant in the context of the city of Trujillo, Peru, where public transport services operate in an environment characterized by high levels of insecurity and limited incorporation of monitoring technologies. According to official statistics, the city registers tens of thousands of criminal incidents annually, including a significant number of robberies that directly affect public transport users [7], [8]. In this scenario, the implementation of a low-cost and scalable monitoring system capable of providing continuous feedback on safety conditions represents a practical alternative for strengthening operational supervision.
The results obtained show that the proposed system goes beyond basic vehicle monitoring by addressing safety conditions that directly affect both drivers and passengers in public transport environments. The solution simultaneously integrates multiple critical variables, such as driving under the influence of alcohol, exposure to hazardous gases, excessive speed, and proximity to potential collisions. This integration allows a broader and more realistic interpretation of operational safety in urban bus services.
Compared with previous works, such as the system presented in study [12], which is mainly oriented toward theft prevention through identification and access control mechanisms, the proposed approach extends beyond asset protection. While such strategies are effective for vehicle security, they do not consider aspects related to driver behavior or in-vehicle environmental conditions. In contrast, the present study incorporates continuous monitoring of both driver status and immediate environmental risks, which responds more directly to the safety requirements of public transport operations. Similarly, although accident detection systems based on vibration and proximity have been reported in research [13], the incorporation of georeferenced alerts and real-time communication through Telegram in this work enhances response capability and situational awareness during service operation.
Likewise, the system proposed in study [16], designed for school transport, emphasizes driver fatigue detection and environmental monitoring. The present work adapts these approaches to high-density urban environments, where exposure to toxic gases and frequent speed variations are more common. Furthermore, wireless air quality monitoring in public transport, as explored in research [19], highlights the relevance of environmental sensing; however, those studies do not establish a direct link between such measurements and the immediate generation of operational alerts or driver-related risk factors.
From a technological perspective, the use of the ESP32 contributes to the scalability and economic feasibility of the system, distinguishing it from more specialized and costly alternatives, such as facial recognition-based ignition control systems [18]. Although such solutions may be suitable for private vehicles, their deployment in public transport fleets is often constrained by high costs and greater operational complexity. In contrast, the proposed design prioritizes accessibility and functional integration, which are key aspects for large-scale adoption in cities with limited resources, such as Trujillo, Peru.
Nevertheless, certain limitations must be acknowledged. Sensor performance may be affected by environmental variability, including temperature changes, airflow, and vehicle vibrations, which can influence gas and alcohol measurements. Likewise, GPS accuracy may decrease in highly urbanized areas with signal obstruction. These constraints suggest that future implementations could benefit from signal filtering techniques, such as Kalman filter-based methods, as well as from the incorporation of higher-precision sensing modules. In addition, improvements in communication reliability, through backup power sources and cellular technologies such as LTE-M or 4G, would further strengthen system robustness.
Finally, the proposed system is aligned with recent developments in Intelligent Transportation Systems (ITS), which emphasize real-time data integration and continuous analysis as fundamental tools for improving safety and operational decision-making in public transport [9]. Research on big data applications in ITS highlights their potential to optimize traffic management and reduce risks in complex urban environments [10]. Moreover, studies on ITS adoption in developing cities confirm the need for cost-effective and context-aware solutions, reinforcing the relevance of the approach presented in this work [11].
5. Conclusions
The results of this study show that IoT-based monitoring solutions can make a significant contribution to improving safety conditions in public transport systems when they are conceived within an operational and management-oriented framework, rather than merely as isolated onboard devices. The proposed system demonstrates that real-time detection of unsafe driving behaviors and hazardous environmental conditions can support preventive decision-making processes in urban transport services, particularly in contexts where accident rates and security problems are high.
In this way, the timely availability of safety information allows transport operators to strengthen driver supervision mechanisms, anticipate risk situations, and apply corrective measures before incidents occur. This preventive capability helps to improve service continuity, user confidence, and the overall reliability of the system. Unlike approaches focused exclusively on post-event analysis, the solution presented prioritizes early risk identification, which is a key aspect for reducing service disruptions and enhancing everyday operational performance.
At the urban and public policy level, the implementation of this system across public transport fleets provides municipalities with an important source of evidence-based information. Access to safety data facilitates the identification of recurrent risk patterns, critical corridors, and time-dependent issues, contributing to the formulation of more targeted road safety policies and the prioritization of infrastructure interventions. In cities such as Trujillo, where public transport safety remains a persistent challenge and technological resources are often limited, scalable and low-cost monitoring systems represent a viable alternative for advancing toward safer and more resilient mobility networks.
Furthermore, the applicability of the approach at the fleet level promotes centralized supervision and coordinated safety management. By improving visibility of driving behavior and environmental risks across multiple vehicles, operators can optimize schedule compliance, reduce accident-related costs, and allocate operational resources more efficiently. These benefits are particularly relevant in budget-constrained environments, where technological adoption must balance effectiveness, sustainability, and affordability.
As future work, the incorporation of predictive analytics techniques, fleet-level data aggregation, and integration with broader intelligent transportation system platforms is proposed. These developments would allow IoT-based monitoring to be consolidated as a strategic tool for sustainable urban transport management, contributing not only to improved safety but also to operational efficiency and long-term public policy planning.
Conceptualization, V.L.S. and C.C.V.; methodology, V.L.S., E.R.F., and C.C.V.; software, V.L.S., E.R.F., and M.O.T.; validation, V.L.S., E.R.F., M.C.Z., and C.C.V.; formal analysis, C.C.V. and M.C.Z.; investigation, V.L.S., E.R.F., M.C.Z., S.C.R., and M.O.T.; resources, V.L.S. and E.R.F.; data curation, V.L.S. and M.C.Z.; writing-original draft preparation, V.L.S. and C.C.V.; writing-review and editing, C.C.V.; visualization, C.C.V. and M.C.Z.; supervision, C.C.V.; project administration, C.C.V.; funding acquisition, C.C.V. All authors have read and agreed to the published version of the manuscript.
The data used to support the findings of this study are available from the corresponding author upon request.
The authors declare that they have no conflicts of interest.
| ESP32 | Espressif Systems ESP32 microcontroller |
| NEO-6M | u-blox NEO-6M Global Positioning System (GPS) receiver module |
| MQ-2 | Metal Oxide Semiconductor (MOS) gas and smoke sensor |
| MQ-3 | Metal Oxide Semiconductor (MOS) alcohol gas sensor |
| HC-SR04 | Ultrasonic distance measurement sensor module |
| IoT | Internet of Things |
| GPS | Global Positioning System |
