1. Introduction
In recent years, increasing attention has been paid to the monitoring of indoor air quality and airborne chemical pollution due to their impact on human health, safety, and productivity. This is particularly relevant in automated laboratories and industrial environments, where hazardous chemicals and gases are routinely handled. Accidental leaks of such substances may lead to severe health risks, environmental contamination, and damage to infrastructure, highlighting the need for reliable monitoring and early warning systems. In addition, increasing regulatory and industrial environments further emphasize the importance of continuous and intelligent environmental monitoring solutions.
Traditional environmental monitoring systems typically rely on high-precision equipment, which is often complex and expensive, limiting their scalability and widespread deployment. In contrast, recent research in this field has focused on the development of low-cost sensor networks capable of real-time air quality monitoring and anomaly detection. These systems commonly integrate gas sensors, particulate matter sensors, and environmental sensors to identify indoor pollution sources and detect abnormal environmental events. Sensor nodes have thus become key components of smart building monitoring and control systems, enabling continuous observation and early detection of hazardous conditions, such as chemical leaks, smoke, or fire.
Driven by advances in sensor technology and communication electronics, modern sensor nodes have evolved from simple data acquisition units into intelligent systems capable of multi-sensor data processing, wireless communications, and integration with Internet of Things (IoT) and edge computing frameworks. This evolution enables not only real-time monitoring but also local data processing and decision-making, reducing latency and dependence on centralized infrastructure. More recently, the increasing use of mobile robots and autonomous platforms in laboratories and industrial environments has created a demand for mobile sensor nodes that can detect hazardous substances and simultaneously determine their spatial location. Accurate localization of such events is essential for effective risk mitigation and targeted intervention, particularly in dynamic or large-scale indoor environments [
1,
2,
3].
Baseline deviation analysis is widely used in environmental monitoring systems, where real-time measurements are compared against reference values to detect any anomalies. For example, elevated levels of volatile organic compounds (VOC), particulate matter (PM), or carbon dioxide equivalent (eCO
2) may indicate chemical leaks, smoke generation, or combustion processes. Due to its computational efficiency, this approach is well-suited for real-time applications [
4,
5]. In addition, rule-based event detection frameworks have widely been employed to classify environmental conditions based on threshold exceedances and temporal trends, enabling the identification of events such as smoke emissions, chemical emissions, or fire incidents [
6,
7,
8].
Several studies have addressed the development of sensor systems and localization approaches in indoor environments. Ge et al. proposed a machine learning-based indoor localization system that utilizes environmental and temporal sensor data, such as temperature, humidity, and light intensity, to classify indoor locations using algorithms including Random Forest, support vector machine, K-nearest neighbor, Decision Tree, and Adaptive Boosting [
9].
Tan et al. introduced a magnetic induction-based localization system designed for environments with limited line-of-sight (LoS), demonstrating improved robustness in complex indoor scenarios [
10].
Pham et al. developed a sensor fusion approach combining passive infrared sensor (PIR) and inertial measurement units (IMU) with particle filtering for indoor human localization, achieving high positioning accuracy [
11].
Furthermore, LiDAR-based approaches have been explored for simultaneous localization and mapping (SLAM), providing high accuracy but typically at a higher cost and system complexity [
12]. In the context of gas detection, Kumar et al. proposed an IoT-based system integrating gas sensor arrays with machine learning (ML) techniques for hazardous gas identification, achieving high classification accuracy in a controlled environment [
13].
Recent studies have also explored advanced gas-sensing strategies for environmental and hazardous substance monitoring. In particular, plasmonic and material-engineered sensing approaches have demonstrated high sensitivity under controlled measurement conditions. However, such solutions typically rely on specialized sensing structures and more complex instrumentation, which may limit their direct integration into compact, low-cost, and mobile sensor platforms [
14].
Other recent works have further highlighted the importance of accurate gas- and air-quality monitoring in safety-oriented applications. These studies confirm the increasing demand for reliable detection of hazardous environmental conditions. However, their primary focus remains on sensing performance itself, whereas the present work emphasizes the joint integration of environmental event detection and real-time indoor localization within a portable embedded architecture [
15].
Beyond the co-existence of sensing and positioning modules, an important research gap remains in the interaction mechanism between these subsystems. In many existing implementations, environmental sensing and localization are treated as loosely connected processes, where detection results and positioning outputs are combined only at a superficial level. This often neglects critical aspects such as temporal alignment between sensor measurements and position estimates, as well as the potential for mutual awareness between environmental anomalies and localization uncertainties. For instance, sudden changes in environmental sensor readings caused by an event may coincide with reduced positioning accuracy under non-line-of-sight (NLoS) conditions, highlighting the need for a tighter coupling between environmental event detection and localization, rather than independent processing. Addressing this interaction requires deeper system-level integration, where sensor and positioning data are processed within a unified processing framework that supports consistent spatial and temporal data interpretation. This goes beyond hardware-level integration and enables coherent spatiotemporal alignment of environmental measurements and position estimates [
16,
17,
18].
Despite these advances, existing approaches typically focus either on environmental sensing or on localization, while only a limited number of systems address the combined problem of real-time hazard detection and accurate indoor positioning in a unified low-cost architecture. In addition, many localization approaches suffer from reduced accuracy in indoor environments due to non-line-of-sight (NLoS) conditions and signal attenuation caused by obstacles such as walls and laboratory equipment. Moreover, the integration of reliable event classification with robust localization remains a significant challenge, particularly in dynamic and cluttered indoor settings.
To address these challenges, this work proposes a low-cost, portable sensor node that integrates multi-sensor-based environmental monitoring with high-precision indoor localization. Unlike many existing systems that treat sensing and localization as loosely coupled processes, the proposed approach emphasizes coordinated operation within a unified processing framework. This enables consistent spatiotemporal interpretation of environmental events, ensuring that sensing and localization data are jointly interpreted in both spatial and temporal domains.
The main contributions of this work can be summarized as follows:
Development of a modular IoT-based sensor node for detecting hazardous gases, particulate matter, and environmental parameters;
Design of a dynamic multi-zone indoor tracking system based on ultra-wideband (UWB) technology with adaptive anchor selection;
Implementation and comparison of Kalman filter-based localization approaches (KF, EKF, and UKF), including sensor fusion with IMU data for improved robustness under NLoS conditions;
Development of a rule-based multi-sensor environmental event detection framework for classifying VOC leaks, smoke, and fire events.
The remainder of this paper is organized as follows.
Section 2 describes “Methods and Materials”, including the hardware and software components and system architecture.
Section 3, “Work Description” presents the system design and the implemented algorithms.
Section 4, “Experimental Tests and Results”, discusses the experimental setup and results.
Section 5, “Discussion and Conclusions”, provides a detailed discussion of the findings, and concludes the paper and outlines directions for the future.
2. Materials and Methods
The proposed system consists of two main components: (i) the hardware platform and (ii) the monitoring software. The hardware comprises a prototype sensor node equipped with multiple environmental sensors and a positioning unit. The software is responsible for data processing, visualization, and event detection.
The sensor node is designed as a modular platform that integrates different types of sensors for measuring gas concentrations, particulate matter (PM), temperature, and relative humidity. In addition, the sensor node incorporates an ultrawideband (UWB) tracking unit that operates in conjunction with multiple fixed anchors deployed within the building. The following subsections describe the individual system components in detail.
Figure 1 illustrates the sensor node used in this work.
2.1. UWB Module
Ultra-wideband (UWB) technology forms the backbone of the positioning and tracking system, enabling precise indoor localization in real-time. UWB units can be deployed as mobile tags or carried by laboratory personnel, and can also be integrated into robotic platforms or autonomous systems operating in hazardous environments.
In this work, the MaUWB_ESP32S3 (Makerfabs, Shenzhen, China) was selected for system implementation. The module integrates several functional units. It is based on the DWM3000 transceiver (Qorvo, Greensboro, NC, USA), which provides key functionalities such as an integrated ceramic antenna, a real-time clock, RF front-end, and power management system. The transceiver supports two-way ranging (TWR) as well as time difference of arrival (TDoA) methods for distance estimation.
The DWM3000 is controlled via AT commands using an integrated STM32F103RCT6 microcontroller (STMicroelectronics, Geneva, Switzerland), which allows low-level access to internal registers and configuration parameters. In addition, the module included an ESP32-S3 IoT microcontroller (Espressif Systems, Shanghai, China), which provided Wi-Fi and Bluetooth 5 connectivity. In the proposed system, the ESP32-S3 is used for processing UWB data and readings from various sensors, as well as for transmitting data to the monitoring and tracking server. The module further includes a 1.3-inch OLED display for local visualization and a set of input/output interfaces for sensor integration. Owing to its functionality and relatively low cost (approximately €50), the module represents a suitable solution for real-time indoor tracking applications.
Figure 2 shows the UWB module used.
2.2. Gas and Environmental Sensors
To enable a reliable detection of chemical leaks, smoke, and fire-related events, the sensor node integrates multiple gas and environmental sensors. The SGP41 gas sensor (Sensirion AG, Stafa, Switzerland) is used to measure the volatile organic compound (VOC) index and the Nitrogen oxides (NO
x) index. Both indices are unitless and range from 0 to 500, representing air quality levels from excellent to poor. These parameters provide important indicators for the detection of chemical leaks (VOC index) and combustion-related events (NO
x index). In addition, the SGP30 sensor (Sensirion AG, Stafa, Switzerland) is used to measure total VOC (TVOC) concentration and the carbon dioxide equivalent (eCO
2) concentration [
19,
20].
Environmental conditions are further monitored using the SHT41 sensor (Sensirion AG, Stafa, Switzerland), which measures temperature and related humidity in the operational ranges of −40 to 125 °C and 0 to 100% RH, respectively. Rapid changes in temperature and humidity can indicate abnormal conditions such as fire or smoke. However, these parameters alone are insufficient for reliable detection, as they may also be influenced by other environmental factors. Therefore, their integration with gas and particulate matter sensors is essential to improve the detection robustness [
21].
Two particulate matter sensors are employed to measure PM1 (1-micron diameter), PM2.5 (2.5-micron diameter), and PM10 (10-micron diameter) concentrations in the air: the PMSA003I (Nanchang Panteng Technology Co., Ltd., Nanchang, China) and the BMV080 (Bosch Sensortec, Reutlingen, Germany). The BMV080 is a compact sensor with a measurement range of 0 to 1000 μg/m
3 and a resolution of 1 μg/m
3, which makes it well-suited for portable applications. In addition, it can be hosted with any processor with an I2C or SPI bus [
22]. The PMSA003I operated based on the laser scattering principle and communicates via an I
2C interface [
23].
2.3. BNO085 Inertial Measurement Unit
The BNO085 (CEVA Technologies, Inc., Rockville, MD, USA) inertial measurement unit (IMU) integrates a triaxial accelerometer, magnetometer, and gyroscope, providing nine degrees of freedom for the inertial measurement unit. These sensors are coupled with an embedded ARM Cortex M0 processor running the Hillcrest SH-2 sensor fusion firmware (Hillcrest Labs, Inc., Rockville, MD, USA). The IMS provides processed motion data, including yaw, pitch, and roll angles, quaternion, rotation vector, linear acceleration, and gravity vectors. In this work, IMU data are used to support the localization process by enabling sensor fusion with UWB measurements. Specifically, the IMU contributes to mitigating the effects of signal degradation and non-line-of-sight (NLOS) conditions, which commonly occur in indoor environments due to obstacles such as walls and equipment. The integration of IMU data with UWB measurements is performed within the unscented Kalman filter (UKF) framework described in
Section 3 [
24].
Table 1 summarizes the main sensors and hardware components integrated into the proposed system.
3. Work Description
The current project aims to design a low-cost, indoor chemical leak detection system with multi-tag, multi-zone tracking and location capabilities, utilizing commercially available components. It is important to note that the algorithms employed in this work are based on established methods. However, their integration, coordination, and adaptation within a dynamic multi-zone indoor environment represent the main contribution of the proposed framework. The system architecture consists of fixed anchors that continuously transmit UWB signals. These signals are received by a mobile tag, which calculates the distances from the eight nearest anchors in the operating environment and wirelessly transmits the sensor array data via Wi-Fi to a monitoring server. The moving tag sends data in the form of five JSON arrays, representing the tag number, distances from the nearest eight anchors, anchor numbers, environmental sensor data, and inertial measurement unit data. The transmission uses the UDP protocol to ensure high-speed, uninterrupted data flow along the tracking path.
On the monitoring server side, a Python 3.12 program receives, sorts, and processes the incoming data, applying algorithms to determine the tag positions and sensor readings with an initial guess of the expected environmental event based on the measurements.
The main tracking tasks of the monitoring program are summarized as follows:
Continuously receive UWB data via UDP for each tag.
For each tag,
Identify the active room (zone/room) based on the distances to anchors in the received UDP message.
Select the top three anchors (usually the closest/nearest within the room).
Calculate an initial position using Least Squares (LSQ) (three anchors).
Update smoothing/tracking filters (KF/UKF/EKF) using appropriate measurements.
Map the results:
Display only the anchors within the active rooms.
Highlight the three anchors currently in use.
Color tag points according to filter type.
Calculate the dynamic GDOP for active room(s) based on selected anchors and current tag position.
Store the results in a log file for analysis and performance evaluation.
The following sub-sections will describe the main algorithms in the monitoring and tracking program in detail.
3.1. Multi-Zone Room Selection
The monitoring program dynamically selects the active room/zone for each tag, regardless of the number of tags or zones. It does not assume a fixed room; instead, the active room is determined by calculating a weight score based on anchors that appeared in the received message. The anchors are predefined and operate in a single room only.
The active room is selected by summing the inverse values of the distances of anchors in each room:
where the ε value is a small amount, 0.001, and provides additional protection against division by zero when the distance is very small, which is a rare occurrence.
Hysteresis is applied to avoid “flickering” of a room or zone when a tag crosses boundaries. The system only switches the active zone if the new room achieves the highest score in consecutive frames (e.g., 3). This process ensures the selection of the three closest anchors in the room or zone for localization.
Figure 3 shows a flowchart of the active room/zone selection process. The proposed weighting and hysteresis mechanism is designed to ensure stable zone selection during transitions between adjacent rooms, where signal conditions and anchor visibility may change rapidly.
3.2. Anchor Selection
After defining the room, three anchors are selected for trilateration.
Valid measurements are collected for each anchor. If fewer than eight anchors are active, missing distances are replaced with (0) for distance and missing anchor numbers with (−1).
Anchors belonging to the selected room are preferred.
If fewer than three anchors are available, the system falls back to the nearest three anchors to prevent the program from crashing or obtaining inaccurate results during trilateration.
The selected anchors are stored in the active anchors matrix for the current tag and are used for
Dynamic GDOP is calculated per frame based on the current tag position. If multiple tags occupy the same room, the average GDOP for the room is used, which causes the GDOP index to change as the tag moves from one area to another.
3.3. Least Squares Algorithm (LSQ)
The Least Squares Estimation method (LSQ) estimated tag coordinates (
x,
y) by selecting three distance measurements from the three nearest anchors with predefined coordinates within the monitoring program (
xi,
yi) and real-time distance measurements (di). The model is based on the circle equation for each anchor:
Subtracting the first anchor equation from the others eliminates the quadratic terms (
x2,
y2), resulting in a linear system:
The “
p” value (tag coordinates) is estimated by solving the LSQ:
when (
AT A) is reversible, which is implemented by the tracking program code via the numpy.linalg.lstsq function, the resulting coordinates are measurements for subsequent Kalman filtering [
25].
3.4. Linear Kalman Filter (KF)
A linear Kalman filter was used to smooth and track the position of the moving tag using a four-state model, x = [x, y, v
x, v
y]
T, by assuming constant velocity. With a time step of dt, the transition equation is
Position is measured only from the LSQ in the monitoring software via
where
vk∼
N(0,
R). KF undergoes two standard stages:
The KF provides a smooth estimate of tag position (P) and tag speed (v). The instantaneous tag speed is calculated based on the velocity components produced by the Kalman filter using the equation v = √(
vx2 +
vy2). The adopted linear Kalman filtering framework follows the standard discrete-time formulation widely used in tracking applications [
26,
27].
3.5. Extended Kalman Filter (EKF)
The EKF handles the nonlinear relationship between UWB ranges and tag position, accounting for NLoS and multipath propagation. Instead of using the initial coordinates in LSQ, the moving tag coordinates are calculated using distance measurements from the three selected anchors in the effective region. When the measurement is the range measurement vector to the anchors
z = [
r1,
r2,
r3]
T and not the position directly, the system state is defined for the KF as
x = [
x,
y,
vx,
vy]
T with a linear motion model F (constant velocity). The nonlinear measurement function is
where
i = 1, 2, 3,
The EKF linearizes this function using the Jacobian matrix:
where the anchor row
i is approximately equal to
using
where a small ε may be added in implementation to avoid division by zero to ensure numerical stability. Then, the same Kalman linear update equations are implemented, but using H
k. The innovation is computed as
In this way, EKF deals with the nonlinearity of UWB (distance) measurements through a local linear approximation around the expected state [
28,
29,
30].
3.6. Unscented Kalman Filter (UKF)
The UKF is employed to estimate the tag position by fusing UWB range measurements with IMU data. Unlike the EKF, the UKF avoids explicit linearization by propagating a set of deterministically chosen sigma points through nonlinear system dynamics. The system state is defined as
where (x
k, y
k) represents the position and (v
x,k, v
y,k) the velocity.
For a state of dimension nnn, a set of 2n + 1 sigma points is generated:
where
i = 1, …,
n, with weights
In contrast to a standard constant-velocity model, the proposed approach incorporates IMU acceleration as an external input to the motion model. The continuous-time dynamics are defined as
After discretization, the state evolution becomes:
The acceleration components ax, ay are derived from the IMU through
Coordinate transformation (body → world frame):
Bias estimation (during quasi-static conditions):
Thus, the IMU contributes directly to the state transition function:
which improves short-term motion prediction (dead-reckoning).
The measurement vector consists of distances to anchors:
with
Each sigma point is projected into measurement space:
The predicted measurement mean and covariance
The Kalman gain is derived using the unscented transform as
, and the state update is expressed as follows
The proposed framework performs loosely coupled sensor fusion: IMU data are integrated in the prediction step as control inputs, and the UWB measurements are used in the update step for absolute position correction. This complementary structure enables
Finally, the system performs integrated sensing and localization through a time-synchronized processing pipeline, where environmental measurements and localization estimates are aligned in real time. This enables direct spatial association of detected events with their corresponding positions, forming a unified spatiotemporal representation of the environment [
31,
32,
33].
3.7. Environmental Events Analysis and Detection Algorithm
The environmental event analysis and detection algorithm employs a rule-based event prediction approach that transforms multi-sensor readings into a probabilistic description of the environmental condition, such as normal conditions, VOC leaks, smoke, or fire.
3.7.1. Definition of Weights Used for Measured Factors
Decision-making in the detection and analysis algorithm relies on the weighting coefficients assigned to environmental sensor features relevant to a given event. The weights were determined based on a series of practical experiments and observations of the algorithm’s response under different scenarios. In particular, the impact of different weight configurations was evaluated with respect to decision accuracy and the avoidance of misclassification or false alarms. This considers the expected characteristics of each event type, including VOC leaks, smoke, and fire. Fixed weights were assigned to each feature-event combination and remain constant during operation, while being adjustable based on system performance if required. Higher weights were assigned to features strongly associated with a particular event (e.g., particulate matter for smoke and temperature for fire). In addition, negative weights were introduced to reduce the influence of misleading or non-discriminative signals (e.g., the effect of particulate matter alone on VOC events).
Table 2 illustrates the weights used in the weighting functions.
3.7.2. Feature Extraction
The process begins with real-time acquisition of environmental sensor data, including temperature, humidity, VOC index, NO
x index, total volatile organic compound (TVOC) concentration, carbon dioxide equivalent (eCO
2), and particulate matter concentrations (PM2.5). Sensors used are PMSA003I and BMV080. The algorithm does not rely solely on raw sensor values; instead, it constructs a dynamic baseline for each variable under normal conditions and calculates the relative deviation from this baseline:
where
x is the current measurement and
b is the baseline. Absolute baseline values below 1 are ignored to prevent division by zero and avoid inflated deviations. This metric indicates how much the current measurement deviates from normal environmental conditions. Additionally, the algorithm calculates the time rates of change for each parameter to capture rapid variations that may be more indicative of an event than absolute values:
Critical parameters include , , , , and .
The program creates weighted scores for each possible event type, combining multiple indicators into a single score for VOC leakage, smoke, and fire.
VOC leaks are characterized by high TVOC concentrations and VOC index, with low particulate matter. The event score increases with Δr (TVOC) and Δr (VOC index) over time and decreases if fine particles rise significantly.
Smoke is indicated primarily by a rapid increase in PM2.5 rate of change, with minor contribution from TVOC.
Fire is considered a complex combustion event, with intensity increasing when multiple parameters rise simultaneously, including PM2.5, eCO2, and temperature over time.
The event scoring logic can be expressed as
where
wi represents the experimental weights,
xI are measured variables (e.g., TVOC, PM2.5, or eCO
2),
is the time derivative of
xi, and
fi incorporates both the relative deviation and the rate of change.
Each feature
fi combines multiple components derived from sensor data:
where
w1, w2, and w3 are weighting coefficients that determine the relative contribution of each feature;
w1 corresponds to the weight of the relative change Δr(xi);
w2 corresponds to the weight of the rate of change ;
w3 corresponds to the weight of the absolute deviation from baseline (xi − bi).
This formulation follows established principles in time-series anomaly detection, where multiple complementary features are combined to capture deviations from normal behavior [
34,
35,
36].
An environmental event is identified when the resulting score surpasses a predefined threshold.
Here, τ denotes an empirically determined threshold specific to each event, derived from experimental observations. The index e indicates the category of the environmental event (such as a VOC leak, smoke, or fire). These thresholds are event-specific (VOC leak, smoke, and fire) and remain fixed during system operation.
For each event category, an independent score is calculated: . The final decision is obtained by selecting the event with the highest score, provided that the required activation condition is satisfied. In cases of overlapping signals, priority is given to fire detection due to its critical safety relevance, followed by smoke detection, and finally VOC leakage.
To avoid rapid oscillation in event classification, the system employs a two-state time-stabilization mechanism:
The system transitions from steady state to candidate state only if the same candidate event is detected for a user-defined number of consecutive cycles. This allows the user to adjust sensitivity before final classification. Otherwise, the previous state remains unchanged. This logic reduces false alarms and prevents positive errors. Once confirmed, the system provides a visual warning indicating the event type, event color, approximate confidence level, and precise location of the detected event.
3.7.3. Thresholds and Baseline Adaptation Strategy
The selected thresholds and weighting factors were determined empirically based on experimental observations under controlled indoor scenarios. In addition to the assessment mechanism described in the previous section, the proposed algorithm incorporates indicative threshold levels and an adaptive baseline update mechanism to ensure robust performance under varying environmental conditions. The detection process uses thresholds that can be adjusted based on user feedback and the baseline level of the operating environment. These thresholds are derived from empirical observations and typical indoor air quality ranges. The current threshold values are VOC index = 150 and NO
x index = 5, TVOC = 67 ppb, and PM2.5 level = 150 mg/L, which significantly exceed normal background conditions and act as trigger levels for event detection. However, these thresholds are not used as strict binary decision boundaries but rather as soft trigger conditions within the assessment framework, allowing gradual transitions instead of abrupt classifications. The baseline for each environmental parameter is initialized from the first valid measurements, requiring a warm-up period of approximately 5 min after the first operation of the sensor node to ensure the completion of the heating phase. After initialization, the baseline is continuously updated using a low-rate exponential moving average:
where α is a small smoothing coefficient (set to 0.01 in this work). This formulation enables slow adaptation to long-term environmental changes while maintaining sensitivity to transient events. Importantly, baseline updating is performed only under stable “normal” conditions and is temporarily suspended when abnormal events are detected. This prevents contamination of the reference baseline during hazardous situations and improves the robustness of anomaly detection.
5. Discussion and Conclusions
The practical tests conducted on the proposed system provide strong evidence of its effectiveness in both environmental event detection and indoor tracking. The environmental event analysis algorithm demonstrated robust performance, achieving full detection of ethanol leaks and fire events, while smoke detection showed a slightly lower success rate with occasional misclassification. These results indicate that the algorithm can reliably identify hazardous events using real-time sensor data, while the integration of dynamic baselines and time-derivative analyses allows it to account for both absolute and rapid changes in environmental conditions. The use of a two-stage stabilization mechanism further reduces false alarms, ensuring that transient fluctuations in sensor readings do not trigger unwarranted alerts. In addition, the observed performance highlights the suitability of combining multiple low-cost sensors to achieve robust detection capabilities without relying on expensive analytical instrumentation, which is particularly relevant for scalable deployment scenarios.
The tracking and positioning system also exhibited promising results. The active room anchor selection algorithm effectively mitigates the influence of anchors from adjacent rooms, which could otherwise introduce errors due to signal propagation through walls. While the least squares and linear Kalman filter approaches provide baseline tracking performance, significant improvements were observed when nonlinear filtering techniques were applied. The extended Kalman filter (EKF) reduced errors caused by nonlinearity in UWB distance measurements, and the unscented Kalman filter (UKF) further enhanced accuracy and smoothness by fusing UWB and inertial measurement unit data. Even under challenging NLoS conditions, the UKF-based system maintained reliable positioning, highlighting the value of sensor fusion in indoor localization. In addition to the qualitative trajectory comparison shown in
Figure 8, the quantitative evaluation based on 23 manually surveyed reference points confirms the superiority of the nonlinear filtering approaches over LSQ and KF. The UKF achieved the best overall performance, with a mean error of 39.72 cm and an RMSE of 43.03 cm, followed closely by the EKF. These results indicate that the improvement is not only visual, but also supported by objective numerical error metrics under representative indoor LoS/NLoS conditions. These results emphasize that incorporating motion dynamics and inertial information is essential for achieving stable localization in complex indoor environments.
Unlike simple post-processing approaches, the proposed system maintains a continuous spatiotemporal coupling between sensing and localization, enabling real-time mapping of environmental events. Although the current implementation does not employ fully joint probabilistic fusion, it provides a practical integration framework that combines motion-aware localization with environmental context. This work demonstrates that a low-cost system can simultaneously achieve environmental event detection and precise indoor tracking, offering real-time hazard identification and localization. From an application perspective, this approach is particularly beneficial for automated laboratories, smart industrial environments, and safety-critical infrastructures, where rapid and reliable response to hazardous events is required. The modular architecture of the proposed system further supports its adaptability and integration into existing IoT-based monitoring frameworks. For future research, expanding the detection tests to a broader range of volatile organic compounds and optimizing the algorithmic weighting of environmental factors will help to further enhance prediction accuracy. Additionally, while UKF improves resilience to NLoS errors, some residual positioning errors remain, suggesting the need for further refinement of the system architecture and filtering strategies, for example, through advanced fusion methods or adaptive filtering techniques. Overall, the presented approach provides a scalable and practical solution for chemical safety in laboratory and industrial environments, integrating predictive analytics and sensor-fusion localization in a cohesive framework. Future work will investigate tighter coupling between sensing and localization, including joint probabilistic estimation and cross-module feedback.