Abstract
Advanced Driver Assistance Systems (ADAS) require the acquisition of environmental information, the identification of hazardous conditions, and the execution of local responses to support driving tasks. This work presents the design and validation of a low-cost ADAS prototype for scale vehicles, featuring a hybrid architecture that separates local safety-critical processing from remote LoRaWAN-based telemetry. While traditional IoT (Internet of Things) solutions often depend on cloud connectivity, this system executes safety-related actions for hazards such as collisions and rollover conditions directly through an ESP32-S3 microcontroller, independently of the remote communication infrastructure. To optimize bandwidth, a 16-byte binary payload was developed, avoiding the overhead associated with JSON-based transmissions. Experimental results in a laboratory environment yielded an average Packet Delivery Ratio (PDR) of 91% and high sensor reliability, with mean errors below 3.25% for distance measurements and 5.30% for inclination estimation. The system successfully detected and managed seven distinct hazardous scenarios. Furthermore, a bill of materials analysis showed a documented vehicle-side prototype cost of USD 87.20, supporting the low-cost characterization of the proposed platform.
1. Introduction
Road traffic accidents are a critical global challenge, significantly impacting public health and urban mobility. In Ecuador, more than 21,000 traffic accidents were reported during 2022, resulting in 19,006 injuries and 2202 deaths. Furthermore, approximately 75% of these incidents were associated with risky driving behaviors, including speeding, using mobile phones while driving, driving under the influence of substances and not complying with traffic regulations [1]. To mitigate these risks, Advanced Driver Assistance Systems (ADAS) have emerged as essential tools for active safety, utilizing sensors and processing units to perceive the environment and execute corrective actions [2,3].
Within an ADAS, proximity sensors enable the detection of nearby objects, whereas inertial measurement units (IMU) provide information regarding acceleration, orientation, and inclination. For cost-constrained applications in controlled environments, the combination of ultrasonic sensors and an IMU represents a suitable alternative for implementing basic vehicular perception functions [4].
In addition to executing actions directly on the vehicle, data generated by an ADAS can be transmitted to an external platform for monitoring, storage, and analysis. These applications do not necessarily require high bandwidth because the information can be organized into small data packets containing system-state variables, measurements, and detected events.
Standard IoT protocols like MQTT over Wi-Fi or cellular networks often face range limitations or high operational costs. Low-Power Wide-Area Networks (LPWAN), specifically LoRaWAN, offer a compelling alternative due to their long communication range and low power consumption [5]. Nevertheless, LoRaWAN’s limited bandwidth and potential for packet loss necessitate an architecture where safety-critical decisions are decoupled from the network’s latency [6].
This work addresses this gap by implementing a functional ADAS prototype for scale vehicles that integrates edge-based event detection with a specialized 16-byte binary payload for LoRaWAN telemetry.
The main contributions of this research include: (i) a robust local response logic that operates independently of network availability, (ii) an optimized data transmission strategy to minimize airtime, and (iii) a modular visualization framework using The Things Network (TTN) [7], MQTT [8], and Node-RED [9] for real-time fleet monitoring.
The paper is organized as follows. Section 2 defines the methodology and the functional architecture summarized in Figure 1. Section 3 describes the physical and software implementation, whereas Section 4 evaluates the experimental findings.
Figure 1.
General architecture of the ADAS prototype.
2. Methodology
The research follows a quantitative and experimental approach, centered on the design and validation of a functional vehicular prototype using controlled test scenarios.
The methodology is structured into four main pillars: the definition of a multi-stage functional architecture, the mathematical framework for sensor perception, the hierarchical logic for event detection, and the optimization of the telemetry strategy.
2.1. Functional Architecture
The system is modeled as a continuous processing pipeline to ensure modularity and reliability. As illustrated in Figure 1, the architecture comprises six interconnected stages:
- Data Acquisition: Capturing physical variables via ultrasonic (HC-SR04) and inertial sensors (MPU6050).
- Local Processing: Signal conversion and noise filtering using the ESP32-S3 core integrated into the Heltec WiFi LoRa 32 V3 board [10]. Measurements acquired by the sensors are converted into distance, temperature, Pitch and Roll variables.
- Event Detection: Real-time comparison of variables against experimental thresholds to identify collision conditions, obstacles, rollover risk, right- and left-side lateral inclinations, uphill slopes, and downhill slopes.
- LoRaWAN Transmission: Encoding of system states into an optimized binary format.
- Data Reception: Management and authentication through The Things Network (TTN).
- Visualization and Analysis: Real-time monitoring and logging via Node-RED through MQTT, where the information is processed and displayed on a dashboard.
2.2. Perception Framework and Data Processing
To ensure accuracy in environmental perception, the prototype implements specific physical-mathematical models. Distance (d) is determined by the time-of-flight of ultrasonic pulses, vehicle body orientation—Pitch and Roll—is estimated using tri-axial accelerometer data to identify slopes and rollover risks.
The integration of the MPU6050 [11] and HC-SR04 sensors allows the system to build a comprehensive state vector, covering both external obstacles and internal stability. Table 1 summarizes the main components used in the prototype. The selection process considered compatibility, availability, ease of integration, and the ability of each component to satisfy the required perception, processing, control, and communication functions.
Table 1.
Main components of the prototype.
The HC-SR04 sensors determine the distance to an obstacle by measuring the elapsed time between the emission of an ultrasonic pulse and the reception of its echo. The distance is calculated as:
where represents the echo return time, and a speed of sound of approximately 0.034 cm/μs was used.
Measurements less than or equal to zero and measurements greater than 400 cm were considered outside the valid operating range of the sensor. In such cases, the latest valid measurement was retained.
To estimate the orientation of the prototype, the accelerations measured by the MPU6050 along the , , and axes were used. The Pitch and Roll angles were estimated as:
Since the inclination angles are estimated exclusively from accelerometer measurements, the implemented method assumes that gravitational acceleration is the dominant component of the measured acceleration vector. Consequently, longitudinal or lateral acceleration, abrupt braking, vehicle vibration, and other dynamic effects may introduce transient errors in the estimated Pitch and Roll angles. The proposed approach is therefore primarily intended for the low-speed and quasi-static conditions considered in the laboratory experiments. For operation under more dynamic conditions, accelerometer and gyroscope data could be combined using sensor-fusion techniques, such as a complementary or Kalman filter, to obtain a more robust orientation estimate.
In this work, Roll-based lateral events do not represent changes in vehicle heading or steering direction. Instead, they characterize the lateral inclination of the scale-vehicle body with respect to its reference position. During the experimental validation, these conditions were reproduced by applying controlled lateral inclinations to the vehicle body rather than by driving the prototype along curved trajectories. Therefore, the positive and negative Roll thresholds used in the event-detection logic should be interpreted as right- and left-side body-inclination conditions, respectively.
2.3. Event Detection and Local Response
Event identification was performed by comparing the acquired variables against thresholds experimentally established for the scale vehicle. Table 2 summarizes the conditions considered and their associated local responses.
Table 2.
Implemented event thresholds and local responses.
Critical events were assigned higher priority than informative events. Therefore, when a potential collision or rollover condition is detected, the microcontroller executes the corresponding response before continuing with the evaluation of other events.
3. Implementation and Communication Strategy
3.1. Physical Integration and Power Supply
The prototype features a 3D-printed chassis and a custom PCB designed to minimize electromagnetic interference (EMI). The ultrasonic sensors were positioned at the front and rear of the vehicle, whereas the MPU6050 was installed near the center of the chassis to obtain representative measurements of vehicle orientation.
The Heltec WiFi LoRa 32 V3 board, HC-06 Bluetooth module, L298N H-bridge driver, visual indicators, and buzzer were integrated through a printed circuit board specifically designed for the prototype.
The physical assembly and the implemented PCB are shown in Figure 2. The PCB design reduced loose wiring, organized the system components, and improved the mechanical stability of the assembly during vehicle motion.
Figure 2.
Implemented ADAS prototype and PCB used for the integration of the electronic components.
The power supply of the control stage was separated from the power stage. The Heltec board, sensors, and Bluetooth module were powered through a 5 V power bank.
The traction system was powered by a battery pack consisting of three 3.7 V batteries connected to the L298N H-bridge driver. Both stages share a common ground reference to ensure the correct interpretation of digital and PWM signals.
3.2. Prototype Cost Assessment
To quantitatively support the low-cost characterization of the proposed ADAS platform, a bill-of-materials analysis was performed based on the materials acquired during the implementation of the scale-vehicle prototype. The assessment considers the mechanical structure, sensing, control, communication, power supply, and integration components used for the vehicle-side implementation. The detailed breakdown of components, quantities, unit costs, and subtotals is presented in Table 3.
Table 3.
Bill of materials and documented cost assessment of the implemented vehicle-side prototype.
The documented cost of USD 87.20 corresponds to the vehicle-side prototype implementation. Components without an available purchase cost in the project budget, including the Heltec WiFi LoRa 32 V3 board, LEDs, buzzer, and power bank, were excluded from this calculation. Therefore, this value represents the minimum documented hardware cost of the implemented prototype rather than the complete acquisition cost of all components.
3.3. Embedded Software Implementation and LoRaWAN Communication
The embedded software was organized into modules for sensor acquisition, motor control, light management, buzzer operation, Bluetooth communication, OLED display visualization, and LoRaWAN transmission.
During each execution cycle, sensor measurements are acquired, system variables are updated, events are evaluated, and the corresponding safety actions are executed. These actions are performed locally and do not depend on TTN or the monitoring dashboard.
To transmit telemetry through LoRaWAN, a 16-byte binary payload was designed. This structure reduces the message size and avoids transmitting complete JSON objects directly from the device.
The payload contains information related to vehicle motion, speed, distance measurements, inclination, temperature, actuator states, detected events, a frame counter, and a checksum. Its structure is summarized in Table 4.
Table 4.
Summary of the telemetry payload structure.
The LoRaWAN node was configured using Over-the-Air Activation (OTAA), Class A operation, Adaptive Data Rate (ADR), and application port 2. The USA915 regional frequency plan with the FSB2 sub-band was used for communication.
TTN receives the uplink messages transmitted by the prototype and uses a JavaScript payload formatter to transform the binary data into readable variables.
3.4. Integration with TTN, MQTT, and Node-RED
Node-RED was connected to the TTN MQTT broker using an mqtt in node. The received messages contain both communication metadata and the decoded payload variables.
A function node was used to normalize the information and extract only the variables required by the dashboard: device identifier, motion, speed, distances, Pitch, Roll, temperature, actuator states, events, frame counter, and checksum status.
The complete integration process is shown in Figure 3. Figure 3a shows the reception of the uplink message in TTN. The information is subsequently transferred through MQTT to Node-RED, as shown in Figure 3b. Figure 3c shows the decoded payload in TTN, whereas Figure 3d presents the final monitoring interface.
Figure 3.
Information flow implemented in the ADAS system. (a) LoRaWAN uplink received by TTN. (b) MQTT flow implemented in Node-RED. (c) Payload decoded in TTN. (d) Monitoring dashboard developed in Node-RED.
4. Results and Discussion
4.1. Distance and Inclination Measurements
The HC-SR04 ultrasonic sensors were evaluated using reference distances of 10, 20, 30, 50, and 100 cm. Measurements obtained by the prototype were compared against manually established reference values.
The front sensor exhibited an average error of 2.73%, whereas the rear sensor exhibited an average error of 3.25%. These variations may be attributed to sensor positioning, the angle of the target surfaces, vehicle vibrations, and the intrinsic characteristics of ultrasonic measurements.
Despite these differences, the measurements enabled the system to correctly distinguish among the normal, caution, and critical zones used by the detection algorithm.
The MPU6050 was evaluated on a level surface and under controlled inclinations of approximately . The resulting average angular error was 5.30 %. The measurements were sufficient to identify orientation changes associated with lateral body inclinations, slopes, and critical inclination conditions under the controlled experimental conditions.
Table 5 summarizes the main experimental validation results.
Table 5.
Summary of the experimental results.
4.2. Event Detection and System Response
To validate the ADAS logic, seven conditions were evaluated: collision, obstacle, rollover, right-side inclination, left-side inclination, uphill slope, and downhill slope.
In all test scenarios, the event identified by the system matched the condition generated during the experiment.
When a front distance of 18 cm was measured, the collision condition was activated and the vehicle braking procedure was executed. When an obstacle was placed at a distance of 65 cm, the system identified a caution zone and reduced the vehicle speed.
Likewise, a Roll value of approximately 43° generated a critical inclination condition and caused the prototype to stop.
These results demonstrate that the event-priority hierarchy enables the system to prioritize higher-risk conditions. Because the corresponding actions are executed locally, the prototype response does not depend on LoRaWAN transmission time or on the availability of the remote infrastructure.
4.3. LoRaWAN Communication
The performance of the LoRaWAN communication link was assessed through five experimental tests, each consisting of twenty transmitted packets. The detailed results for packet delivery and loss are summarized in Table 6.
Table 6.
LoRaWAN packet delivery results.
The prototype achieved an average Packet Delivery Ratio (PDR) of 91%, while the average packet loss was 9%. These losses are typically associated with wireless-link conditions, including gateway coverage, environmental interference, channel selection, and the intrinsic behavior of the USA915 frequency plan in a laboratory setting.
These findings confirm that LoRaWAN is a robust and effective protocol for periodic telemetry monitoring and long-range data logging for scale vehicles. However, the observed 9% packet loss rate reinforces a core design principle of this framework: safety-critical ADAS functions must be decoupled from network availability. By ensuring that emergency responses—such as collision braking and rollover stops—are executed locally at the vehicle’s edge processing unit, the system maintains high operational safety even when real-time message reception by the remote infrastructure is not guaranteed.
4.4. Remote Visualization
The remote monitoring layer was successfully validated through the integration of The Things Network (TTN) and Node-RED. As shown in the experimental results, TTN correctly decoded the incoming 16-byte binary messages using a specialized JavaScript formatter, ensuring that all telemetry variables were available for the application layer.
As illustrated in Figure 4, the monitoring interface was developed to provide a dual-purpose view: immediate status supervision and historical event logging.
Figure 4.
Monitoring interface implemented in Node-RED: (a) Main monitoring dashboard; visualization of telemetry variables and prototype status; (b) history of events detected during the experimental tests.
The main dashboard shown in Figure 4a enables the real-time visualization of critical vehicle parameters, including motion state, front and rear distance measurements, and dynamic orientation variables (Pitch and Roll). Additionally, it displays auxiliary data such as ambient temperature and current actuator states, while providing a clear visual alert system for active hazards.
Figure 4b, serves as a digital log, recording every hazardous condition identified during the testing phase. By archiving these events, the system facilitates comprehensive post-event analysis and supports long-term fleet monitoring tasks.
The successful implementation of this remote interface demonstrates a robust functional separation within the ADAS framework. While primary safety functions are executed at the vehicle’s edge to ensure a deterministic response, the remote infrastructure provides an essential layer for visualization, storage, and analysis. This modular architecture is designed for scalability, allowing for the future integration of additional sensors and the monitoring of more complex vehicular variables without compromising the local safety-critical processing.
5. Conclusions
This research successfully designed and implemented a functional ADAS prototype for scale vehicles, integrating a multi-stage architecture that spans from data acquisition to remote cloud visualization.
The system demonstrated the viability of using accessible hardware components, including the ESP32-S3, HC-SR04 ultrasonic sensors, MPU6050 IMU, and motor-control modules, to create a reliable perception framework for basic driving assistance. The documented vehicle-side prototype cost was USD 87.20, excluding components without an available purchase record. The reported cost corresponds exclusively to the vehicle-side node implemented in this work. The LoRaWAN gateway infrastructure was not included because an existing laboratory gateway was used during the experimental validation.
A key contribution of this work is the functional decoupling of safety-critical responses from network availability. Experimental results confirmed that local processing enables a deterministic response to hazards—such as collisions and rollovers—regardless of the communication infrastructure’s latency. This is particularly relevant given the observed average Packet Delivery Ratio (PDR) of 91% in LoRaWAN. While the 9% packet loss is acceptable for periodic telemetry and logging, it underscores the necessity of maintaining primary safety actions at the vehicle’s edge.
The implementation of an optimized 16-byte binary payload proved to be an effective strategy for vehicular telemetry, minimizing bandwidth consumption and facilitating seamless integration with The Things Network (TTN) and Node-RED. The sensors provided sufficient accuracy for assistance tasks, with average errors remaining below 3.25% for distance and 5.30% for angular orientation.
Future work will focus on evaluating the system’s performance in high-mobility scenarios and diverse urban topographies to further characterize the wireless link. Additionally, we aim to incorporate higher-precision sensors, such as LiDAR or computer vision, and explore Edge AI models to enhance the prototype’s capability for complex obstacle classification and predictive safety maneuvers.
Author Contributions
Conceptualization, J.B.P., S.L.S.M., L.F.U. and M.C.P.; methodology, J.B.P.; software, J.B.P.; validation, J.B.P.; formal analysis, J.B.P.; investigation, J.B.P.; supervision, S.L.S.M.; writing—original draft preparation, J.B.P.; writing—review and editing, J.B.P., S.L.S.M., L.F.U. and M.C.P. All authors have read and agreed to the published version of the manuscript.
Funding
This research received no external funding.
Institutional Review Board Statement
Not applicable.
Informed Consent Statement
Not applicable.
Data Availability Statement
The experimental data and developed source code are available from the corresponding author upon reasonable request.
Acknowledgments
The authors acknowledge Escuela Politécnica Nacional for providing access to the equipment and resources used during the development of the prototype. During the preparation of this manuscript, ChatGPT GTP-5 by OpenAI was used as a supporting tool for information organization, language revision, and LATEX formatting. The authors reviewed and edited the resulting content and take full responsibility for the manuscript. This research was conducted within the framework of the institutional research project PIGR-24-02, “SmartCityNet: IoT and Vehicular Networks for Urban Optimization and Transformation,” at Escuela Politécnica Nacional.
Conflicts of Interest
The authors declare no conflicts of interest.
Abbreviations
| ADAS | Advanced Driver Assistance Systems |
| ADR | Adaptive Data Rate |
| IoT | Internet of Things |
| LPWAN | Low-Power Wide-Area Network |
| MQTT | Message Queuing Telemetry Transport |
| OTAA | Over-the-Air Activation |
| PCB | Printed Circuit Board |
| PDR | Packet Delivery Ratio |
| TTN | The Things Network |
References
- La Hora. La Imprudencia al Volante y su alto Costo en Vidas. 6 June 2024. Available online: https://www.lahora.com.ec/loja/La-imprudencia-al-volante-y-su-alto-costo-en-vidas-20240606-0014.html (accessed on 14 December 2025).
- Rattan, A.; Rudra Pal, A.; Gurusamy, M. Composition and Application of Current Advanced Driving Assistance System: A Review. arXiv 2021, arXiv:2105.12348. [Google Scholar] [CrossRef] [Scilit]
- Neumann, T. Analysis of Advanced Driver-Assistance Systems for Safe and Comfortable Driving of Motor Vehicles. Sensors 2024, 24, 6223. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Nesti, T.; Boddana, S.; Yaman, B. Ultra-Sonic Sensor Based Object Detection for Autonomous Vehicles. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops, Vancouver, BC, Canada, 17–24 June 2023. [Google Scholar]
- LoRa Alliance. LoRaWAN L2 1.0.4 Specification; LoRa Alliance: Fremont, CA, USA, 2020. [Google Scholar]
- LoRa Alliance. LoRaWAN Regional Parameters; RP002-1.0.4; LoRa Alliance: Fremont, CA, USA, 2022. [Google Scholar]
- The Things Industries. The Things Stack Documentation. Available online: https://www.thethingsindustries.com/docs/ (accessed on 23 August 2026).
- OASIS. MQTT Version 5.0; OASIS Standard; OASIS: Burlington, MA, USA, 2019. [Google Scholar]
- OpenJS Foundation. Node-RED Documentation. Available online: https://nodered.org/docs/ (accessed on 28 August 2026).
- Heltec Automation. WiFi LoRa 32 V3 Documentation; Heltec Automation: Chengdu, China, 2022. [Google Scholar]
- TDK InvenSense. MPU-6000 and MPU-6050 Product Specification; TDK InvenSense: San Jose, CA, USA, 2013. [Google Scholar]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.





