Next Article in Journal
Optimal Channel Selection of Multiclass Motor Imagery Classification Based on Fusion Convolutional Neural Network with Attention Blocks
Previous Article in Journal
Efficient IoT-Assisted Waste Collection for Urban Smart Cities
Previous Article in Special Issue
Transfer Learning for Indoor Localization Algorithm Based on Deep Domain Adaptation
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Combined Filtering Method for ZigBee Indoor Distance Measurement

School of Computer Science, Civil Aviation Flight University of China, Guanghan 618307, China
*
Author to whom correspondence should be addressed.
Sensors 2024, 24(10), 3164; https://doi.org/10.3390/s24103164
Submission received: 7 April 2024 / Revised: 12 May 2024 / Accepted: 14 May 2024 / Published: 16 May 2024
(This article belongs to the Special Issue Indoor Positioning Technologies for Internet-of-Things)

Abstract

:
Indoor distance measurement technology utilizing Zigbee’s Received Signal Strength Indication (RSSI) offers cost-effective and energy-efficient advantages, making it widely adopted for indoor distance measurement applications. However, challenges such as multipath effects, signal attenuation, and signal blockage often degrade the accuracy of distance measurements. Addressing these issues, this study proposes a combined filtering approach integrating Kalman filtering, Dixon’s Q-test, Gaussian filtering, and mean filtering. Initially, the method evaluates Zigbee’s transmission power, channel, and other parameters, analyzing their impact on RSSI values. Subsequently, it fits a signal propagation loss model based on actual measured data to understand the filtering algorithm’s effect on distance measurement error. Experimental results demonstrate that the proposed method effectively improves the conversion relationship between RSSI and distance. The average distance measurement error, approximately 0.46 m, substantially outperforms errors derived from raw RSSI data. Consequently, this method offers enhanced distance measurement accuracy, making it particularly suitable for indoor positioning applications.

1. Introduction

In recent years, with the rapid development of Wireless Sensor Networks (WSNs) [1,2], indoor positioning and distance measurement have become one of the hot topics in the research field. Indoor positioning [3,4,5] has a wide range of application prospects in indoor navigation, object tracking, environmental monitoring, and other fields. However, due to the complexity and diversity of the indoor environment, indoor distance measurement faces a series of challenges, such as multipath effects, signal attenuation, signal blocking, etc. Therefore, how to achieve high-precision, real-time indoor positioning has become a hot spot and challenge in current research.
In indoor distance measurement, the distance measurement method based on ZigBee [6,7,8] has received widespread attention due to its advantages of low power consumption, low cost, and easy deployment. However, the existing ZigBee indoor distance measurement method has problems such as low distance measurement accuracy, large positioning error, poor robustness, etc., which limits its promotion and application in practical applications. Therefore, it is necessary to conduct in-depth research on the existing indoor distance measurement method based on ZigBee to improve the accuracy and reliability of indoor distance measurement.
This study aims to rectify the shortcomings of current indoor ranging methodologies relying on ZigBee by introducing a combined filtering approach, alongside conducting pertinent theoretical analysis and experimental validation. Initially, it investigates the impact of Zigbee’s indoor transmission power and channel on the RSSI value. Subsequently, it applies linear fitting to the RSSI data to quantify errors in unfiltered conditions. Following this, an indoor ranging scheme employing a combined filtering algorithm is proposed to mitigate these errors. Finally, through a blend of experimental simulations and real-world scenario testing, the efficacy and performance advantages of this method are validated. Through the research conducted in this study, it is anticipated to offer novel insights and methodologies for the advancement of indoor distance measurement technology, thereby fostering the adoption and application of indoor positioning technology based on ZigBee in practical scenarios.
The remainder of this research is structured as follows: Section 2 delves into the related work. In Section 3, the proposed KDGM combined filtering algorithm is elaborated upon. Section 4 provides a detailed description of the experimental procedure and an analysis of the results. Section 5 outlines future directions, while Section 6 concludes this work.

2. Related Work

Advancements in positioning technologies have surged in recent years, with a primary focus on enhancing accuracy and precision across diverse applications. Within this dynamic landscape, numerous studies have emerged, each contributing unique methodologies and insights to the field. For instance, ref. [9] introduces a collaborative positioning method tailored primarily for underground mining applications. While its scope may appear specific, its methodology offers insights applicable to refining algorithms and bolstering precision in the design of indoor positioning systems. In a similar vein, ref. [10] directly addresses indoor positioning, employing a diverse array of algorithms integrating Time of Arrival (ToA) and Inertial Measurement Units (IMUs) to achieve high-precision indoor positioning. This study serves as an important resource for guiding the selection and optimization of sensor fusion algorithms in indoor positioning. Moreover, ref. [11], while not directly centered on indoor positioning, introduces a rapid advancement method that provides techniques for enhancing positioning speed and optimizing algorithm performance—crucial elements for the development of indoor positioning systems aiming to deliver efficient and real-time services. Furthermore, ref. [12] delves into an enhanced vehicle-tracking scheme, taking into account environmental factors in driving motions. This scheme effectively tracks moving vehicles on the road using at most two successive base stations (BSs), enabling the associated data analysis platform to promptly furnish up-to-date information about the position of each vehicle.
While existing studies have made significant strides in improving positioning accuracy and precision, our study takes a closer look at indoor distance measurement. In the following discussion, we delve into the related models and methods related to our proposed method.

2.1. Path Loss Model

The principle of RSSI distance measurement is based on a certain relationship between the received signal strength and the distance. When the signal propagates from the transmitter to the receiver, it will be attenuated due to various factors, including free-space transmission loss, multipath effects, obstacles, signal attenuation, etc. RSSI distance measurement uses this attenuation relationship to estimate the distance between communication devices by measuring the received signal strength. The common RSSI signal propagation models currently include the Free-Space Path Loss (FSPL) [13], Log-Distance Path Loss Model [14], and Shadowing Model [15]. In indoor environments, the Log-Distance Path Loss Model is more commonly used and applicable. This is because the indoor environment has a more complex structure, with many obstacles, walls, furniture, etc., which cause multipath propagation and reflection of the signal, leading to random fluctuations in signal strength. The formula for the Log-Distance Path Loss Model is as follows:
P L d = P L 0 + 10 n lg d d 0 + X σ ,
where P L d is the RSSI between the transmitter and receiver when the distance is d , P L 0 is the RSSI at the reference distance d 0 , n is the path loss factor, which is affected by the actual site environment, and X σ is a Gaussian random variable with a mean of 0 and a standard deviation of σ (usually taken as 4–10 dB) [16]. In actual use, d 0 is often taken as 1 m, so the model can be simplified as follows:
R S S I ( d ) = A 10 n l g d ,
where A represents the received signal strength at a distance of 1 m from the position node, and R S S I ( d ) is the signal strength value at a distance of d m. Based on this formula, the distance equation can be derived as follows:
d = 10 A R S S I ( d ) 10 n .

2.2. Mean Filtering

Mean filtering [17] is a simple and low-cost computational technique, which involves summing and then averaging the data set collected at a specific location. This method is very suitable for implementation on the resource-limited CC2530 microcontroller, as its 256 KB of storage space and 32 MHz clock frequency are sufficient to handle the computational requirements of average filtering. The formula is as follows:
R S S I = 1 n i = 1 n   R S S I i ,
where R S S I represents the strength of the received signal, n is the number of samples of signal strength, and R S S I i represents the signal strength value of the i -th sample. This model can smooth the signal well for certain Gaussian white noise and retain the general trend of the signal. However, when the value of n is large enough, there is a certain lag in the filtering of RSSI, which slows down the overall response speed of the system.

2.3. Kalman Filtering

Kalman filtering [18] is a recursive method used to estimate the state of dynamic systems. It updates the state estimate and state covariance matrix by integrating the system model with observed data to produce an optimal estimate. This capability is essential for processing signals in environments that are dynamic and constantly changing. Implementing the Kalman filter on the CC2530 microcontroller is completely viable. The CC2530 offers sufficient computational power and memory (8 KB RAM) to manage the basic matrix operations essential for Kalman filtering. Despite its limited resources, by strategically simplifying and optimizing the algorithm—for instance, by utilizing streamlined data structures and processes—the filter can be executed both efficiently and stably. Kalman filtering operates through two principal stages: prediction and update.
In the prediction stage, the dynamic model is used to predict the system’s state through the following equation:
1.
State prediction:
x k = A k x k 1 + B k u k ,
where x k represents the estimated state at time k , A k is the state transition matrix, B k is the control input matrix, and u k is the control input.
2.
Error covariance prediction:
P k = A k P k 1 A k T + Q k .
This equation predicts the error covariance, where P k is the current error covariance matrix, and Q k represents the process noise covariance matrix.
In the update stage, the prediction is fused with the observed data by calculating the Kalman gain and then correcting the state and error covariance by using the following equations.
3.
Calculate the Kalman gain:
K k = P k H k T ( H k P k H k T + R k ) 1 ,
where H k is the observation matrix, and R k is the observation noise covariance matrix.
4.
State correction:
x k = x k + K k ( z k H k x k ) ,
where z k represents the observed value.
5.
Error covariance correction:
P k = I K k H k P k ,
where I is the identity matrix.
These Formulas (5)–(9) are central to Kalman filtering, enabling recursive estimation by integrating predictions and observations to improve the accuracy of state estimates and error correction.

2.4. Gaussian Filtering

Gaussian filtering [19] effectively suppresses noise by using the Gaussian function as a weighting function and smoothing the signal using its probability density function. Implementing Gaussian filtering on the CC2530 microcontroller is entirely feasible, although it requires some complex mathematical operations. Given that our research does not require high real-time data processing, the processing power of the CC2530 is fully capable of meeting the needs of Gaussian filtering. Its excellent noise suppression characteristics make Gaussian filtering a preferred option, suitable for use in resource-limited environments. Its probability density function formula is as follows:
ϕ ( x ) = 1 2 π σ e ( x μ ) 2 2 σ 2 ,
among which
μ = 1 n i = 1 n   x i ,
σ = 1 n 1 i = 1 n   x i μ 2 .
In this study, the probability interval of 0.68 ≤ ϕ(x) ≤ 1 was chosen for analyzing RSSI signal strength values. Selecting this interval implies focusing on RSSI values within ±1σ of the mean. This range encompasses the most representative data, as these values are tightly clustered around the overall average. Gaussian filtering effectively captures the consistent and prevalent signal strength characteristics in the environment, while ignoring outliers that might be caused by drastic environmental fluctuations, device inaccuracies, or other random occurrences.

2.5. Dixon’s Q-Test

Dixon’s Q-Test [20] method is a statistical method used to identify and remove outliers from a data set, which plays a key role in improving distance measurement accuracy. Especially when using RSSI data for distance estimation, the presence of outliers can severely affect the accuracy of the results. In the context of using the CC2530 microcontroller, choosing Dixon’s Q-test is particularly appropriate because this test method does not require complex calculations and is suitable for execution on resource-limited devices. The steps for applying Dixon’s Q-Test to filter RSSI values are as follows:
Step 1: Collect n RSSI data points and arrange them in ascending order as R S S I 1 R S S I 2 R S S I 3 R S S I n ; then, determine the significance level α = 0.05 [21].
Step 2: Depending on the sample size (in this case, 30), use the Dixon’s Q-Test formulae to check for high- and low-end outliers. For sample sizes between 14 and 30, the formulas are
D n = x n x n 1 x n x 3 D n = x 3 x 1 x n 2 x 1 ,
where D n is the statistic for testing high-end values, and D n is the statistic for testing low-end values.
Step 3: In this study, with α = 0.05 , obtain the corresponding critical value in the Dixon’s Q-Test critical value table D ( α , n ) .
Step 4: Compare the calculated Dixon’s Q-Test statistic with the critical value. If the Dixon’s Q-Test statistic exceeds the critical value, it can be concluded that there are outliers in the data set.
Step 5: After removing the outliers, repeat the previous steps with the remaining RSSI values until no outliers are present.

3. KDGM Combined Filtering Algorithm

In practical RSSI measurement, it is found that using a single filtering algorithm still results in a large number of outliers. These outliers may be caused by environmental factors, equipment failures, or other unknown factors, which seriously affect the accuracy and stability of the data. Therefore, when facing these problems, it is necessary to adopt a more comprehensive and effective method to process RSSI data to improve the accuracy and reliability of the measurement. Based on this, this article proposes a KDGM (Kalman–Dixon–Gaussian–Mean) combined filtering algorithm, aiming to optimize the measured RSSI values by combining the advantages of multiple filtering technologies. The design inspiration of this algorithm comes from the characteristics of various filtering algorithms at different data processing stages, such as the dynamic system model of Kalman filtering, the outlier detection capability of Dixon’s Q-Test, the data smoothing effect of Gaussian filtering, and the data fusion capability of mean filtering. The reasons for choosing the KDGM combined filtering algorithm are as follows:
  • Resource constraints:
    Microcontrollers typically have limited computational resources and memory. Specifically, the CC2530 utilizes an 8-bit enhanced 8051 microcontroller core, where computational capacity is restricted. Thus, selecting algorithms with relatively low complexity and moderate computational demands is more practical. Mean filtering and Gaussian filtering are straightforward to implement in resource-limited environments and offer high computational efficiency, making them suitable for microcontroller applications.
  • Real-time requirements:
    Microcontrollers are often used in real-time systems, necessitating algorithms that can respond quickly. Kalman filtering offers an effective method for real-time estimation and correction of system states, making it suitable for real-time tracking and prediction in dynamic systems.
  • Outlier handling:
    Dixon’s Q-test filtering is effective in identifying and handling significant outliers, making it suitable for data potentially affected by occasional anomalies. This capability is crucial for ensuring data accuracy and reliability.
  • Data characteristics:
    Gaussian filtering can smooth data, reducing the impact of noise without overly altering the inherent characteristics of the data. This property makes it suitable for processing signals with Gaussian noise characteristics.
In addition, the filtering process is described as follows, as shown in Figure 1:
  • First, based on the Kalman filtering algorithm, the initial RSSI value is filtered. The Kalman filtering algorithm is a recursive filtering technology that can effectively eliminate noise and uncertainty by estimating and correcting the state of the system, thereby improving the accuracy and stability of the data.
  • Secondly, for the RSSI value after Kalman filtering, Dixon’s filtering is performed. According to the significance level α = 0.05 , the calculated Dixon statistic is compared with the critical value until there are no outliers. Dixon’s filtering method is a statistical method used to identify outliers. By calculating the difference between the sample data and the median of the sample, and comparing it with other samples, outliers are detected and removed, thereby reducing data errors and biases.
  • Subsequently, for the RSSI value after Dixon’s filtering, the Gaussian filtering algorithm is used for smoothing, and the RSSI value falling in the probability 0.68 F R S S I 1 interval is selected. Gaussian filtering is a filtering method based on Gaussian distribution. By performing weighted averaging or convolution operations on the data, the original data are smoothed, thereby eliminating noise and sudden interference and improving the stability and reliability of the data.
  • Finally, for the RSSI value after Gaussian filtering, the average is accumulated and taken to obtain the final RSSI value. Through accumulation and averaging operations, the accuracy and stability of the data can be further improved, measurement errors can be reduced, and the strength and distance of the wireless signal can be more accurately reflected.
The KDGM combined filtering algorithm is shown in Algorithm 1.
Algorithm 1: KDGM combined filtering
Input: RawRssi (raw RSSI data), Distance
Output: avgRSSI (average RSSI after filtering)
1: Apply the Kalman filter to RawRssi and round the result to get kalman_result
2: Set distanceValue to Distance
3: Set DixonsDistance to DistanceValue and DixonsRssi to kalman_result
4: Set the batch size for Dixon’s Q-Test
5: Initialize the final RSSI value list, final_rssi
6: for each batch of data in DixonsRssi do
7:    Get the current batch of data, batch_data
8:    Apply Dixon’s Q-Test filter to batch_data to get filtered_rssi
9:    if filtered_rssi is not empty then
        Compute the mean of filtered_rssi and add it to final_rssi
10:    end if
11: end for
12: Set GaussuanDistance to DixonsDistance and GaussuanRssi to final_rssi
13: Apply the Gaussian filter to GaussuanRssi to get gaussian_result
14: Compute the mean of gaussian_result and round it to get avgRSSI
15: return avgRSSI

4. Experiment and Result Analysis

In this section, we analyze the possible sources of error in indoor distance measurement, conduct experiments on Zigbee’s transmission power, wireless channel, and height from the ground, find suitable parameters, and reduce the impact of parameter settings on RSSI values. Next, we fit the parameters of the indoor path loss model to obtain the A and n values suitable for the current environment, and finally, we verify the filtering performance of the KDGM combined filtering algorithm through experimental testing.

4.1. Analysis of Indoor Distance Measurement Error Sources

Using RSSI to achieve indoor distance measurement is a common method at present, but the accuracy of Zigbee’s indoor distance measurement will be affected by the multipath propagation of the signal, signal attenuation, and non-line-of-sight (NLOS) [22,23] propagation caused by obstacles in the propagation process, which will produce the following problems:
  • Random jumping of RSSI
When the radio signal propagates in the air, it may be subject to RSSI jumps caused by other devices or electromagnetic interference. This interference may be temporary or persistent. Also, when the wireless signal reaches the receiver through multiple paths, it may also cause rapid changes in signal strength. These situations are common problems in urban environments [24].
  • Inaccurate environmental parameter values of the distance measurement model [25]
The parameters A and n of the distance measurement model play a crucial role in determining the quality of the model. Parameter A represents the reference signal strength at a given distance, typically indicating the signal strength at one meter from the source. Parameter n , known as the path loss exponent, reflects how much the signal attenuates as it propagates over a distance. This parameter can vary depending on environmental factors such as indoor versus outdoor settings, building structures, and obstructions.
In different indoor environments, the values of A and n can vary significantly, as shown in Table 1. Relying solely on traditional experience to set these two values as fixed values can lead to large errors in estimating the distance. This discrepancy occurs because fixed values may not accurately capture the unique characteristics of specific environments, resulting in an estimated distance that does not align with the actual indoor environment distance.
  • Zigbee device parameter settings
The transmission power of Zigbee [26] and the channel selection in the indoor environment are also particularly important. The size of the transmission power determines the length of the communication distance and the penetration ability, and the channel selection determines the network performance and stability.
  • Impact of node distance from ground height on RSSI
The RSSI may also be affected by the distance from the ground [27]. If both the transmitter and the receiver are on the ground, they may be affected by ground reflection. Therefore, it is necessary to place the Zigbee nodes [28] at different height intervals on the ground, measure the RSSI, and observe the impact of height on the RSSI.
Table 1. A and N correspondence table for different scenarios [29].
Table 1. A and N correspondence table for different scenarios [29].
SceneAN
Park32.7~36.02.7~3.4
Stair35.0~38.21.9~2.5
Grassland33.2~36.43.0~3.9
Beach37.5~40.83.8~4.6
Office39.0~50.51.4~2.5
Therefore, it is necessary to first test the indoor transmission power and channels, etc., to find parameters that fit the current environment.

4.2. Indoor Transmission Power Test

The indoor short-distance transmission power test uses the SmartRF-Studio7 [30,31] developed by TI. All Zigbee nodes use a rubber stick antenna with a gain of 3 dBi. The test frequency is 2405 MHz, the channel is the default Channel 11, and the receiver sensitivity is −97 dBm. The experiment was conducted in a computer room laboratory.
The test mode is set to Expert Mode, and the transmission power setting range is −22 dBm to 4.5 dBm. Each time, 30 packets are sent, and each packet is spaced 1000 milliseconds apart.
The receiver settings are the same as above, and the expected number of received packets is set to 30. In Dump Data to File, the save path for each received data point is set.
Two Zigbee nodes are fixed at different positions, keeping the test distance constant at 1 m. The transmission frequency is set to 2405 MHz, and the transmission power [32] is set to −20 dBm, −16 dBm, −12 dBm, −8 dBm, −4 dBm, −0.5 dBm, and 4.5 dBm. Experiments are conducted under these seven fixed transmission powers. The experimental results are shown in Figure 2.
As can be seen from the figure, under the same transmission frequency, different transmission powers have a significant impact on the RSSI value. A higher transmission power can not only enhance the reliability of the RSSI value but also increase its stability.

4.3. Wireless Channel Test

In the same experimental environment as in Section 4.2, the transmission power is set to 1 dBm, and Zigbee’s channels 11 to 26 in the 2.4 G frequency band are tested. The experimental results are shown in Figure 3.
In the experiment, there are situations where the RSSI values are the same under different channels [33,34]. In order to better observe the data, a random offset of 0.1 is added when generating the line graph for easy observation of the results. As can be seen from the figure, in the indoor environment, due to the influence of multipath propagation and reflection, the choice of different channels will also affect the RSSI. Among them, Channel 19 performs well in this experimental environment.

4.4. Zigbee Height from Ground Test

Zigbee devices are placed at three different heights for the experiment, which are 0 m, 0.6 m, and 1.2 m. The distances between the receiver and the transmitter are set to 0.6 m, 1.2 m, and 1.8 m. At each distance point, 150 data points are collected. Zigbee nodes are all fixed for the experiment using tripods. The data measured at different distances under different heights are shown in Figure 4.
As can be seen from the figure, the height of the node from the ground has a certain impact on the RSSI value. This impact is significant when the distance between the nodes increases. In this experiment, when the node is 1.2 m from the ground, the RSSI value is significantly better than when it is at 0.6 m and 0 m. This proves that increasing the height of the Zigbee node can reduce the reflection of the signal from the ground, making the signal superior to when it is close to the ground.

4.5. Path Loss Model Fitting

In the computer room laboratory environment, the router node is placed on a bracket at a height of 0.8 m. The node to be tested is moved at distances from 0.3 m to 3.4 m. At each location, 1500 RSSI data points are collected. The node to be tested sends data frames to the router node. The router node forwards the read RSSI values to the coordinator node. The coordinator then establishes data transmission with the PC through serial communication. In the end, a total of 14 distance points were collected, totaling 21,000 RSSI data points.
As can be seen from Formula (3), the values of the constant A and n will affect the calculation of converting RSSI values into distance values. These two values are mainly determined by the current environment. The traditional method is to treat n as a constant. However, due to the interference of multipath effects in the environment, the value of n changes with the environment. In order to ensure that the values of A and n do not affect the distance measurement accuracy of RSSI, it is necessary to perform logarithmic fitting on the parameter values. The collected 14 sets of data are filtered, and then the least squares method is used for curve fitting, as shown in Figure 5.
As illustrated in Figure 5, the relationship between the RSSI and distance was modeled using a logarithmic fit, with a coefficient of determination of 0.83, indicating a significant functional relationship between RSSI values and distance. The fitted parameters of the model are A = −40.41 and n = 2.05, reflecting the expected attenuation of signal strength with increasing distance.
Further analysis, supported by the 95% confidence intervals, reveals that the variations in RSSI values are most pronounced within the 1–1.5 m range. The choice of a 95% confidence interval is guided by the standard practice in statistical analysis, which strikes a balance between providing sufficient assurance that the interval estimates the true parameter values while not being overly conservative. This level of confidence is widely accepted in scientific research, as it offers a high degree of certainty without being excessively stringent, thereby providing a reliable basis for decision-making in practical applications.
These confidence intervals further validate the predictive accuracy of the model and demonstrate the high reliability of the measurements over this distance range. In addition, while the overall performance of the model is good, the analysis of the confidence intervals also shows that the variation in RSSI values flattens out beyond 1.5 m. This observation suggests that for subsequent applications of RSSI-based distance measurements involved in the current environment, a maximum effective measurement distance of 1.5 m should be considered to ensure high accuracy and reliability of the measurements.

4.6. KDGM Combined Filtering Algorithm Experiment and Result Analysis

The transmitter (coordinator) was placed on a tripod at a height of 1.2 m and connected to a PC; then, the receiver (terminal) was placed at a fixed distance from the transmitter for the experiment. The collected data set was processed separately through Kalman filtering, Kalman–Dixon filtering, and Kalman–Dixon–Gaussian filtering. The filtered RSSI values processed by MATLAB are shown in Figure 6.
The figure illustrates the impact of various filtering techniques on the fluctuations in the Received Signal Strength Indicator (RSSI) data. The raw RSSI data exhibit significant variability, with a fluctuation range of 9.00, potentially caused by environmental interference or equipment variability. By applying Kalman filtering, we observed a notable reduction in the fluctuation range to 4.00, demonstrating the effectiveness of Kalman filters in reducing noise in dynamic systems predicted based on time-series data. Further integration of the Dixon’s Q-test into Kalman–Dixon filtering reduced the range to 1.21. The Dixon’s Q-Test, an effective outlier detection method, helped further eliminate extreme data points, thus optimizing signal smoothness. Finally, incorporating Gaussian filtering into the Kalman–Dixon filter further reduced the fluctuation range to 0.68. Gaussian filtering focuses on local consistency and smoothing out short-term fluctuations by averaging nearby data points with weighted importance, further enhancing overall data stability.
Variance measures the degree of deviation between a random variable and its mean. As shown in Table 2, the deviation of the RSSI values from the mean is minimized after the KDGM combined filtering algorithm, indicating that the filtering effect meets the requirements.

4.7. RSSI Distance Measurement Comparison Test

Initially, the ranging experiments were conducted within a computer laboratory space measuring 12.5 m by 10.3 m. Drawing upon the outcomes from prior investigations concerning Zigbee base height, transmission power, and wireless channel configurations, the experimental setup was optimized by setting the antenna height at 1.2 m, the transmission power to 4.5 dBm, and selecting channel 19 for the wireless communication to mitigate the impact on RSSI values significantly. As depicted in Figure 7, a coordinator node was strategically deployed within the laboratory environment, with terminal nodes precisely positioned at fourteen data collection points to ensure comprehensive coverage.
To circumvent the potential biases introduced by non-omnidirectional antennas, RSSI measurements were gathered from three distinct angles, and subsequently, data from identical distances but differing directions were amalgamated to enhance accuracy. The ranging process is shown in Figure 8.
The experiments utilized Zigbee nodes equipped with CC2530 chips from Texas Instruments, known for their reliability and performance in wireless communications. As illustrated in Figure 9, subfigure a shows the devices used for collecting RSSI data and the two Zigbee nodes, while subfigure b illustrates the Zigbee coordinator node and end node during the experiment, the RSSI data collection apparatus was interfaced with the Zigbee coordinator via a serial connection, ensuring robust data transmission. This study employed two Zigbee nodes to facilitate the thorough collection of RSSI data between the designated transmitter and receiver. Table 3 presents a detailed comparison between the raw RSSI data and the distance estimation results following the application of the KDGM combined filtering, highlighting the methodological efficacy and enhancement in measurement accuracy.
Through comparison of the “RSSI Raw Data” and “KDGM-Filtered Data” columns, it is observed that the measured distance errors are generally reduced after KDGM filtering. In particular, at short distances, the filtered data exhibit a more stable and accurate trend, indicating a significant effect of the KDGM filtering algorithm in reducing noise and interference in the ranging system. However, in some cases, especially at longer distances, measurement errors still show some degree of fluctuation. This may be attributed to environmental noise or other external factors that have not been fully eliminated. In summary, the analysis of the data in Table 3 indicates the potential of the KDGM combined filtering algorithm in optimizing ranging system performance, providing important references and guidance for future research and engineering practice.
Figure 10 shows the error residual plot for data without filtering and with filtering algorithms applied.
As can be seen from the figure, the error is the largest when no filtering is applied. After filtering, the error decreases, and the KDGM combined filtering algorithm has the smallest error. This indicates that after filtering, the accuracy of indoor ranging has greatly improved. The average error is shown in Table 4.
This study systematically evaluated three indoor distance measurement error processing methods: unfiltered data, Kalman–Dixon filtering, and KDGM combined filtering algorithm. The results showed that the latter two advanced filtering techniques significantly improved measurement accuracy. The unfiltered data exhibited the highest mean error (1.12 m) and variance (1.50 m2), indicating substantial measurement uncertainty and instability. The introduction of Kalman–Dixon filtering reduced the mean error and variance to 0.52 m and 0.46 m2, respectively, highlighting its effectiveness in reducing random fluctuations and enhancing data consistency. The KDGM combined filtering algorithm further reduced the mean error and variance to 0.46 m and 0.41 m2, with its advanced data processing techniques not only improving measurement precision but also enhancing robustness in dynamic environments. KDGM’s integration of robust statistical methods with real-time filtering algorithms enables it to outperform traditional methods in terms of accuracy and consistency. These findings provide a strong theoretical and empirical basis for the future application of this technology in more complex environments.

5. Future Directions

The complex physical structure of indoor environments often leads to signal reflection and multipath effects. While the method proposed in this study can effectively reduce these errors, enhancing the accuracy and reliability of distance measurements, it may not be directly applicable to outdoor settings. In outdoor environments, environmental factors such as weather and extensive physical obstacles may significantly affect signal transmission, thereby impacting distance measurement accuracy. To meet broader application needs, it is advisable to adjust these filtering methods or integrate other technologies to enhance performance and applicability in outdoor environments. Specifically, the introduction of machine learning algorithms such as Support Vector Machine (SVM) and deep learning networks can automatically adjust filtering parameters by learning environmental features, thus adapting to complex outdoor environmental changes. Additionally, combining Global Positioning System (GPS) and Long-Range Wide-Area Network (LoRaWAN) technologies could be an effective solution, providing wider coverage and higher positioning accuracy. Sensor fusion techniques could also be considered, integrating data from Inertial Measurement Units (IMUs), magnetometers, and visual sensors to achieve more precise and stable positioning outputs. The combination of these technologies might not only enhance system robustness but would also maintain efficient performance in diverse outdoor environments.

6. Conclusions

This study addresses indoor distance measurement errors by introducing the KDGM combined filtering algorithm. Our experiments comprehensively explore the impact of transmission power, channel selection, signal propagation models, and filtering algorithms on RSSI values. The results emphasize the significance of these factors in achieving accuracy in indoor distance measurement. Through the effective elimination of outliers in the RSSI data, the KDGM algorithm enhances distance measurement accuracy for Zigbee nodes. However, further enhancements are necessary to better align with practical application requirements across diverse environmental conditions. Future research endeavors could also delve into the broader application scope of the KDGM algorithm and optimize its parameters to address a wider range of measurement needs and environmental challenges.

Author Contributions

Conceptualization, Z.W. and Z.Z.; methodology, Z.W.; software, Z.Z.; validation, Z.Z.; formal analysis, Z.W.; investigation, Z.W.; resources, Z.W.; data curation, Z.Z.; writing—original draft preparation, Z.W. and Z.Z.; writing—review and editing, Z.W.; visualization, Z.Z.; supervision, Z.Z.; project administration, Z.W.; funding acquisition, Z.W. All authors have read and agreed to the published version of the manuscript.

Funding

This work is partially supported by the Fundamental Research Funds for the Central Universities under grant nos. JG2023-53, J2022-042, and PHD2023-027, Civil Aviation Professional Project under grant no. MHJY2023027, and Sichuan Science and Technology Program under grant nos. 2022JDR0116 and 2023YFG0308.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Matin, M.A. Wireless Sensor Networks: Technology and Protocols; BoD—Books on Demand: Norderstedt, Germany, 2012. [Google Scholar]
  2. Yick, J.; Mukherjee, B.; Ghosal, D. Wireless sensor network survey. Comput. Netw. 2008, 52, 2292–2330. [Google Scholar] [CrossRef]
  3. Jiang, W.; Cao, Z.; Cai, B.; Li, B.; Wang, J. Indoor and Outdoor Seamless Positioning Method Using UWB Enhanced Multi-Sensor Tightly-Coupled Integration. IEEE Trans. Veh. Technol. 2021, 70, 10633–10645. [Google Scholar] [CrossRef]
  4. Guo, X.; Ansari, N.; Hu, F.; Shao, Y.; Elikplim, N.R.; Li, L. A Survey on Fusion-Based Indoor Positioning. IEEE Commun. Surv. Tutor. 2020, 22, 566–594. [Google Scholar] [CrossRef]
  5. Yeh, S.-C.; Hsu, W.-H.; Lin, W.-Y.; Wu, Y.-F. Study on an Indoor Positioning System Using Earth’s Magnetic Field. IEEE Trans. Instrum. Meas. 2020, 69, 865–872. [Google Scholar] [CrossRef]
  6. Cho, H.; Kim, J.; Baek, Y. Large-Scale Active RFID System Utilizing ZigBee Networks. IEEE Trans. Consum. Electron. 2011, 57, 379–385. [Google Scholar] [CrossRef]
  7. Bihl, T.J.; Bauer, K.W.; Temple, M.A. Feature Selection for RF Fingerprinting With Multiple Discriminant Analysis and Using ZigBee Device Emissions. IEEE Trans. Inf. Forensics Secur. 2016, 11, 1862–1874. [Google Scholar] [CrossRef]
  8. Yoo, S.; Wang, C.; Kim, K.T.; Kim, S.; Youn, H.Y. Supporting Node Connectivity with Dixon’s Test for ZigBee-based WSN. Procedia Comput. Sci. 2018, 141, 80–87. [Google Scholar] [CrossRef]
  9. Dong, L.; Zou, W.; Li, X.; Shu, W.; Wang, Z. Collaborative localization method using analytical and iterative solutions for microseismic/acoustic emission sources in the rockmass structure for underground mining. Eng. Fract. Mech. 2019, 210, 95–112. [Google Scholar] [CrossRef]
  10. Chen, X.-C.; Chu, S.; Li, F.; Chu, G. Hybrid ToA and IMU indoor localization system by various algorithms. J. Cent. South Univ. 2019, 26, 2281–2294. [Google Scholar] [CrossRef]
  11. Jiang, R.; Dai, F.; Liu, Y.; Li, A. Fast marching method for microseismic source location in cavern-containing rockmass: Performance analysis and engineering application. Engineering 2021, 7, 1023–1034. [Google Scholar] [CrossRef]
  12. Biswas, D.; Barai, S.; Sau, B. Enhanced RSSI-Based Real-Time Position-Tracking System in Vehicular Networks. IEEE Sens. Lett. 2022, 6, 7500604. [Google Scholar] [CrossRef]
  13. Myagmardulam, B.; Tadachika, N.; Takahashi, K.; Miura, R.; Ono, F.; Kagawa, T.; Shan, L.; Kojima, F. Path Loss Prediction Model Development in a Mountainous Forest Environment. IEEE Open J. Commun. Soc. 2021, 2, 2494–2501. [Google Scholar] [CrossRef]
  14. Khuwaja, A.A.; Chen, Y.; Zhao, N.; Alouini, M.-S.; Dobbins, P. A Survey of Channel Modeling for UAV Communications. IEEE Commun. Surv. Tutor. 2018, 20, 2804–2821. [Google Scholar] [CrossRef]
  15. Xu, S.; Kumar, R.; Pinto, A. Correct-by-Construction and Optimal Synthesis of Beacon-Enabled ZigBee Network. IEEE Trans. Autom. Sci. Eng. 2013, 10, 137–144. [Google Scholar] [CrossRef]
  16. Youlian, Z.; Cheng, H. An Improved Median Filtering Algorithm Combined with Average Filtering. In Proceedings of the 2011 Third International Conference on Measuring Technology and Mechatronics Automation, Shanghai, China, 6–7 January 2011; Volume 1, pp. 420–423. [Google Scholar]
  17. Ge, B.; Wang, K.; Han, J.; Zhao, B. Improved RSSI positioning algorithm for coal mine underground locomotive. J. Electr. Comput. Eng. 2015, 2015, 10. [Google Scholar] [CrossRef]
  18. Ma, W.; Qiu, J.; Liang, J.; Chen, B. Linear Kalman Filtering Algorithm With Noisy Control Input Variable. IEEE Trans. Circuits Syst. II Express Briefs 2019, 66, 1282–1286. [Google Scholar] [CrossRef]
  19. Patel, H.J.; Temple, M.A.; Baldwin, R.O. Improving ZigBee Device Network Authentication Using Ensemble Decision Tree Classifiers With Radio Frequency Distinct Native Attribute Fingerprinting. IEEE Trans. Reliab. 2015, 64, 221–233. [Google Scholar] [CrossRef]
  20. Yi, W.; Gerasimov, I.V.; He, H.; Kuzmin, S.A. Design and implementation of a processing algorithm of measurement errors in multi-dimensional data acquisition. In Proceedings of the 2017 IEEE Conference of Russian Young Researchers in Electrical and Electronic Engineering (EIConRus), St. Petersburg/Moscow, Russia, 1–3 February 2017; pp. 605–608. [Google Scholar] [CrossRef]
  21. Wang, J.; Dai, Y.; Lei, Q. Indoor Positioning Algorithm Based on Dixon Test Filtering RSSI. Chin. J. Sens. Actuators 2021, 34, 118–123. [Google Scholar]
  22. Chen, B.-S.; Yang, K.-C.; Lee, M.-Y. Robust H∞ NLOS-Tolerant Localization Filter and NLOS-Tolerant Remote Reference Tracking Control of Mobile Robot in Wireless Sensor Networks. IEEE Access 2021, 9, 164801–164819. [Google Scholar] [CrossRef]
  23. Pak, J.M.; Ahn, C.K.; Shi, P.; Shmaliy, Y.S.; Lim, M.T. Distributed Hybrid Particle/FIR Filtering for Mitigating NLOS Effects in TOA-Based Localization Using Wireless Sensor Networks. IEEE Trans. Ind. Electron. 2017, 64, 5182–5191. [Google Scholar] [CrossRef]
  24. Bianchi, V.; Ciampolini, P.; De Munari, I. RSSI-Based Indoor Localization and Identification for ZigBee Wireless Sensor Networks in Smart Homes. IEEE Trans. Instrum. Meas. 2019, 68, 566–575. [Google Scholar] [CrossRef]
  25. Ge, Q.; Wen, C.; Duan, S. Fire Localization Based on Range-Range-Range Model for Limited Interior Space. IEEE Trans. Instrum. Meas. 2014, 63, 2223–2237. [Google Scholar] [CrossRef]
  26. Fahama, H.S.; Ansari-Asl, K.; Kavian, Y.S.; Soorki, M.N. An Experimental Comparison of RSSI-Based Indoor Localization Techniques Using ZigBee Technology. IEEE Access 2023, 11, 87985–87996. [Google Scholar] [CrossRef]
  27. Leccese, F. Remote-Control System of High Efficiency and Intelligent Street Lighting Using a ZigBee Network of Devices and Sensors. IEEE Trans. Power Deliv. 2013, 28, 21–28. [Google Scholar] [CrossRef]
  28. Sadowski, S.; Spachos, P. RSSI-Based Indoor Localization with the Internet of Things. IEEE Access 2018, 6, 30149–30161. [Google Scholar] [CrossRef]
  29. Minghui, Z.; Huiqing, Z. Research on model of indoor distance measurement based on receiving signal strength. In Proceedings of the 2010 International Conference On Computer Design and Applications, Qinhuangdao, China, 25–27 June 2010; Volume 5, pp. V5-54–V5-58. [Google Scholar]
  30. Faerber, J.; Gregson, R.; Clutton, R.E.; Khan, S.R.; Cochran, S.; Desmulliez, M.P.Y.; Cummins, G.; Pavuluri, S.K.; Record, P.; Rodriguez, A.R.A.; et al. In Vivo Characterization of a Wireless Telemetry Module for a Capsule Endoscopy System Utilizing a Conformal Antenna. IEEE Trans. Biomed. Circuits Syst. 2018, 12, 95–105. [Google Scholar] [CrossRef] [PubMed]
  31. Ojo, M.O.; Giordano, S.; Procissi, G.; Seitanidis, I.N. A Review of Low-End, Middle-End, and High-End Iot Devices. IEEE Access 2018, 6, 70528–70554. [Google Scholar] [CrossRef]
  32. Patwari, N.; Ash, J.; Kyperountas, S.; Hero, A.; Moses, R.; Correal, N. Locating the nodes: Cooperative localization in wireless sensor networks. IEEE Signal Process. Mag. 2005, 22, 54–69. [Google Scholar] [CrossRef]
  33. Zafari, F.; Gkelias, A.; Leung, K.K. A Survey of Indoor Localization Systems and Technologies. IEEE Commun. Surv. Tutor. 2019, 21, 2568–2599. [Google Scholar] [CrossRef]
  34. Yucek, T.; Arslan, H. A survey of spectrum sensing algorithms for cognitive radio applications. IEEE Commun. Surv. Tutor. 2009, 11, 116–130. [Google Scholar] [CrossRef]
Figure 1. Flowchart of the KDGM combined filtering algorithm.
Figure 1. Flowchart of the KDGM combined filtering algorithm.
Sensors 24 03164 g001
Figure 2. Effect of transmission power on RSSI.
Figure 2. Effect of transmission power on RSSI.
Sensors 24 03164 g002
Figure 3. Effect of channel on RSSI.
Figure 3. Effect of channel on RSSI.
Sensors 24 03164 g003
Figure 4. Plot of RSSI measurements at different altitudes.
Figure 4. Plot of RSSI measurements at different altitudes.
Sensors 24 03164 g004
Figure 5. Fitted curve.
Figure 5. Fitted curve.
Sensors 24 03164 g005
Figure 6. Comparison between the results of filtering algorithms.
Figure 6. Comparison between the results of filtering algorithms.
Sensors 24 03164 g006
Figure 7. The layout of the testing site.
Figure 7. The layout of the testing site.
Sensors 24 03164 g007
Figure 8. Ranging process.
Figure 8. Ranging process.
Sensors 24 03164 g008
Figure 9. Experimental equipment.
Figure 9. Experimental equipment.
Sensors 24 03164 g009
Figure 10. Comparison of ranging errors with and without filtering algorithms.
Figure 10. Comparison of ranging errors with and without filtering algorithms.
Sensors 24 03164 g010
Table 2. Variance comparison table.
Table 2. Variance comparison table.
Filtering MethodsRaw DataKalman-FilteredKalman–Dixon-FilteredKDGM-Filtered
Variance2.400.410.050.04
Range9.004.001.210.68
Table 3. Comparison of distance measurement errors.
Table 3. Comparison of distance measurement errors.
RSSI Raw DataKDGM-Filtered Data
Actual Distance (m)RSSI (dBm)Measured Distance (m)Error (m)RSSI (dBm)Measured Distance (m)Error (m)
0.9−482.341.44−420.220.30
1−451.670.67−440.610.50
1.2−461.870.67−431.200.14
1.5−461.870.37−441.500.00
1.8−421.200.60−431.340.46
2.1−534.102.00−523.671.57
2.3−451.670.63−441.500.80
2.5−431.340.96−441.500.81
Table 4. Comparison of mean error and variance.
Table 4. Comparison of mean error and variance.
Filtering MethodsNot FilteredKalman–Dixon-FilteredKDGM-Filtered
Mean Error (m)1.120.520.46
Variance (m2)1.500.460.41
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.

Share and Cite

MDPI and ACS Style

Wei, Z.; Zhou, Z. A Combined Filtering Method for ZigBee Indoor Distance Measurement. Sensors 2024, 24, 3164. https://doi.org/10.3390/s24103164

AMA Style

Wei Z, Zhou Z. A Combined Filtering Method for ZigBee Indoor Distance Measurement. Sensors. 2024; 24(10):3164. https://doi.org/10.3390/s24103164

Chicago/Turabian Style

Wei, Zhe, and Zhanpeng Zhou. 2024. "A Combined Filtering Method for ZigBee Indoor Distance Measurement" Sensors 24, no. 10: 3164. https://doi.org/10.3390/s24103164

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop