1 Introduction

Wireless sensor networks (WSNs) are a significant technology which has attracted much attention of academic researchers and real-world users [1, 2]. With advances in this technology, applications employing WSNs have become more popular [1, 2]. Localization is one of the most essential subjects in WSNs [3], since locations of sensor nodes or targets are critical to both network operations and application level tasks [4, 5]. Location information of people, objects, and equipment is very useful for many applications such as elderly and patients monitoring systems in hospitals [6, 7], people tracking in buildings [8], mobile robot and equipment tracking [9], and automated control of devices. Focusing on medical and healthcare applications [10,11,12,13], in recent years, the WSN localization technology has been facilitating pervasive medical and healthcare services. For example, access to real-time location monitoring can enhance workflow efficiency to reduce delays required for critical care, especially as a mean of providing ensure safety for hospital patients, such as Alzheimer’s disease, psychiatry disorder, and infant abduction. Related to improve queuing at the outpatient department (OPD), the location service system is implied to notify and display appointment directly to caregivers/patients to be less of a need to rely on waiting list by receptionists. Finally, mobile robots with their location information, which move in hospitals, can be used to carry meals, medical records, diagnostic samples, and other loads in hospitals. Especially, in COVID-19 pandemic, the mobile robot plays a very significant role for this situation.

One of the main challenges in WSNs is the localization problem. Accurate location information can lead to efficient decisions of the systems and applications, as mentioned above. Methods of localization include time of arrival (TOA), time of difference of arrival (TDOA), angle of arrival (AOA), RSSI, and some combinations of these methods [14, 15]. Here, TOA and the TDOA methods require timing and extra hardware to guarantee the precise synchronization between transmitting equipment and receiving equipment [16]. For the AOA method, it is sensitive to non-line-of-sight and multipath propagation effects, especially in indoor scenarios [17]. Hence, the AOA is preferred in outdoor environments. AOA measurement also requires additional hardware, such as an array antenna or a digital compass [15, 18]. Therefore, it is not appropriate for resource-limited WSNs. Among the mentioned methods, localization using RSSI as the power level of the received signal is more widely used [18, 19]. The major reason is that since most wireless sensor nodes have RSSI circuits built into them, additional hardware and extra cost are not required that can help to reduce the cost and complexity of the overall system.

Although the RSSI-based method is often used, the challenge is that the measured RSSI signal is affected by environmental parameters including temperature, humidity, and other factors [40,41,42,43]. The RSSI signal is time-varying. It often fluctuates due to environments and multipath effects caused by reflection, diffraction, and scattering of radio signals in a physical environment, especially in an indoor scenario [3]. High variation of the RSSI signals can significantly cause high levels of localization errors. Unstable estimated results can lead to poor decisions in the system. Consequently, RSSI-based methods and optimal solutions to solve the RSSI variation problem are required.

Based on prior studies in the research literature, methods related to RSSI-based estimation and localization have been presented. In the study by Jianwu and Lu [20], an RSSI-based distance estimation method for IEEE802.15.4 ZigBee networks was presented. A Gaussian distribution function or the Gaussian model was applied to check and limit measured RSSI values used for the distance estimation. Experiments using CC2430 RF transceivers showed that the average estimation errors by the Gaussian model were 1.964 m and 3.618 m within 20 m and 30 m of the test areas, respectively. The Gaussian model and the Gaussian mixture model filters were also introduced by Tseng and Yen [21] to remove and compensate outlier RSSI values before the RSSI-to-distance conversion using the log-distance path-loss model. Experiments using CC2540 Bluetooth chipset in a 6 × 8 m meeting room indicated that the average distance errors by both mentioned filters were 0.750 m and 0.483 m, respectively. Although the Gaussian models, in the studies by Jianwu and Lu [20] and Tseng and Yen [21], can improve the estimation accuracy, for the large test area as in the study by Jianwu and Lu [20], the errors are quite high. In contrast, for Tseng and Yen [21], it can be worked well in the small room.

Adaptive distance estimation in WSNs using RSSI signals was presented in Awad et al. [22]. Two methods to estimate the distance based on a statistical method (i.e., linear and exponential regression) and an artificial neural network with a back-propagation learning method were proposed. The authors demonstrated that by the experiments in a 3.5 × 5.0 m indoor area using CC1000 low-power RF transceivers, the average error distances were between 0.50 and 1.00 m, approximately. However, although the precise estimation accuracy can be achieved for the small test area, an artificial neural network solution requires time for the training phase and the experimental setup. In the study by Svečko et al. [23], distance estimation using RSSI and a particle filter for a 2.4 GHz IEEE802.15.4 standard were presented. Multiple antennas with two different placements (i.e., parallel and circular) were also used for the receiver node (required extra hardware). Experimental results showed that, for the distances of 1 to 5 m, the particle filter method and antennas placed on a circular board and a parallel-board provided mean error values of 0.87 m and 1.34 m, respectively. In the study by Sung [24], the author stated that if the distance between two nodes could be measured or estimated accurately, the precise location in indoor environments could be obtained. The RSSI-based distance estimation using a Kalman filter was then proposed. Here, the variation of the measured RSSI data was filtered by the Kalman filter, and the log-distance path-loss model was then applied to convert the filtered RSSI value to the distance value. Experimental results using a WiFi network indicated that the method in the study by Sung [24] was more accurate for distance estimation. The estimation accuracy improved 8% compared with the case without the Kalman filter. However, although the Kalman filter provides the improved results, it suffers from high computational complexity [25].

From our research motivation and research problems described above, the hypothesis of this work is that developing a real-time and efficient RSSI-based tracking method for an indoor corridor environment of the hospital by taking unreliable RSSI measurements into consideration can lead to improve the localization and tracking accuracy. Therefore, in this work, we develop and test an RSSI-based tracking system. The contributions of our work are threefold.

  • First, a real-time RSSI-based tracking system for a mobile target in the indoor corridor environment is implemented and tested. Six methods using RSSI signals from two reference nodes located at the opposite sides of the test area are proposed to track the mobile target node in the indoor corridor. A filter technique is also applied to smoothen and increase the estimation accuracy of the estimation results by the proposed methods.

  • Second, a determination approach for finding the optimal parameters assigned for the proposed tracking methods and the filtering method is also introduced, where the minimum error is obtained by minimizing the mean absolute error between the estimated positions and the reference positions or the actual positions. Here, the average estimated error of the proposed methods can be significantly improved.

  • Third, since the proposed system is developed to support medical and healthcare services, experiments using a 2.4 GHz, IEEE 802.15.4/ZigBee wireless network have been carried out in the corridor of the hospital building, and the mobile target (e.g., human, equipment, or robot) with different moving speeds has been tested to validate and evaluate the proposed system.

From our study, the experimental results demonstrate that the proposed system with optimal value setting can automatically and efficiently track the moving target in real time, where the smallest average distance error is 0.78 m for the corridor size of 22 m.

The structure of this paper is as follows. Section 2 presents the proposed RSSI-based tracking system which includes the wireless communication network, RSSI-to-distance conversion, position estimation by the proposed methods, filtering of the estimated target positions, and a determination approach for finding the optimal parameters. Section 3.1 provides details of experiments including experimental setups, finding of log-distance path-loss equation, and performance metrics. Section 4 provides experimental results and discussion. We finally conclude the paper in Section 5.

2 The proposed RSSI-based tracking system

2.1 Wireless communication network

The RSSI-based tracking system develped in this work is shown in Fig. 1. There are three wireless nodes connected togather including two reference nodes fixed at known positions (e.g., at the different sides of a corridor), and an unknown target node to be estimated its location. We have three processes to track the target node: the RSSI measurement and collection, the RSSI-to-distance conversion using the log-distance path-loss equation, and the position estimation by the proposed methods.

Fig. 1
figure 1

The RSSI-based tracking system

To determine the target node position, first, the target node sends a request packet to the reference nodes (i.e., the ref. node 1 and the ref. node 2) by broadcasting. Here, the target node ID is also encapsulated in the request packet. Upon receiving the request packet, the reference nodes suddenly generate a beacon packet and then send such a packet back to the target node, continuously. By receiving the beacon packets from both reference nodes, the target node can read the RSSI levels from its radio circuit. The target node finally transfers the RSSI data to the computer via wire connection.

2.2 RSSI-to-distance conversion

After the computer receiving the RSSI data from the reference nodes, the RSSI value is converted to the distance value using the log-distance path-loss equation [26,27,28], as expressed by (1) to (5), where \({\text{RSSI}}_{d}\) is the measured RSSI level at the distance \(d\) (i.e., the distance between the reference node and the target node), \({\text{RSSI}}_{{d}_{0}}\) is the RSSI level at the reference distance (\({d}_{0}\); \({d}_{0}=1 \mathrm{m}\)), and \(\beta\) is the path-loss exponent indicating the decrease of received signal strength along with distance. We note that \(\beta\) is the significant parameter that corresponds to the power loss of the signals affected by environmental factors. By the Eqs. (1) to (5), the average received signal strength level decreases logarithmically with distance. Both \({\text{RSSI}}_{{d}_{0}}\) and \(\beta\) can be determined by collecting the RSSI data in the test field, where the distances between the transmitter to the receiver are known.

$${{\text{RSSI}}_{d}=\text{RSSI}}_{{d}_{0}}-\left[10\times \beta \times {\log }_{10}\left(\frac{d}{{d}_{0}}\right)\right]$$
(1)
$${{\text{RSSI}}_{d}=\text{RSSI}}_{{d}_{0}}-\left(10\times \beta \times {\log }_{10}\left(d\right)\right)+\left(10\times \beta \times {\log }_{10}\left({d}_{0}\right)\right)$$
(2)
$${{\text{RSSI}}_{d}=\text{RSSI}}_{{d}_{0}}-\left(10\times \beta \times {\log }_{10}\left(d\right)\right)+\left(10\times \beta \times {\log }_{10}\left(1\right)\right)$$
(3)
$${{\text{RSSI}}_{d}=\text{RSSI}}_{{d}_{0}}-\left(10\times \beta \times {\log }_{10}\left(d\right)\right)$$
(4)
$$d={10}^{\frac{{{\text{RSSI}}_{{d}_{0}}-\text{RSSI}}_{d}}{10\times \beta }}$$
(5)

2.3 Position estimation by the proposed methods

After, the distance values (i.e., \({d}_{1}\) distance and \({d}_{2}\) distance as in Fig. 1) are determined. The proposed methods are applied to estimate the position of the target node. Here, six solutions for estimating the target positions in terms of the distance in x-axis (distance from the reference node 1) are introduced. They are described below. We note that traditional solutions (like the solutions 1 and 2) to more efficient solutions are presented.

Solution 1:

$${P}_{et,i} = {d}_{1,i}$$
(6)

For the solution 1 in (6), the estimated target position (\({P}_{et,i}\)) is equal to the distance between the target node and the referent node 1 (\({d}_{1,i}\); \({d}_{1,i}\) is calculated from (5)), where \(i\) is the number of iteration or the RSSI sample index. By (6), the estimated result is the distance from the reference node 1.

Solution 2:

$$P_{et,i}=\left|\text{ref.1 to ref.2 distanc}e-d_{2,i}\right|$$
(7)
$$\text{ref.1 to ref.2 distance}={\text{Ref}.2}_{\text{position}}-{\text{Ref}.1}_{\text{position}}$$
(8)

For the solution 2 in (7) and (8), \({P}_{et,i}\) is equal to the different distance between the reference node1-to-reference node 2 distance (\(\text{ref.1 to ref.2 distance}\)) and the distance between the target node and the reference node 2 (\({d}_{2,i}\); \({d}_{2,i}\) is calculated from (5)). By the solution 2, the estimated result is determined by giving the priority to the RSSI signal received from the reference node 2. We note that, since both \({d}_{1,i}\) and \({d}_{2,i}\) are calculated from the RSSI values which often fluctuate over time due to environmental factors [40,41,42,43] and multipath effects caused by reflection, diffraction, and scattering of radio signals in a physical environment [3, 29, 30]. Such RSSI variations can cause significantly high levels of estimated distance errors [31]. Therefore, by the solution 1 (giving the priority to the RSSI signal received from the reference node 1) and the solution 2, results will demonstrate that which and when the reference nodes 1 and 2 should be considered.

Solution 3:

$$P_{et,i}=\frac{d_{1,i}+\left|\text{ref.1 to ref.2 distanc}e-d_{2,i}\right|}2$$
(9)

For the solution 3 in (9), \({P}_{et,i}\) is the average result between the outputs of the solution 1 (\({d}_{1,i}\)) and the solution 2 (\(\left|\text{ref.1 to ref.2 distance}-d_{2,i}\right|\)). Here, (9) is calculated by taking the information of \({d}_{1,i}\) and \({d}_{2,i}\) into consideration, where there is no priority assigned for any reference nodes.

Solution 4:

$$\begin{aligned}P_{et,i\;}=\frac{\sum_{j=1}^n(W_{j,i}\times Ref.j_{position})}{\sum_{j=1}^n(W_{j,i})};n=number\;of\;ref.\;node\\P_{et,i\;}=\left(\frac{(W_{1,i}\times Ref.1_{position})(W_{2,i}\times Ref.2_{position})}{W_{1,i}+W_{2,i}}\right)\\P_{et,i\;}=\left(\frac{({\displaystyle\frac1{d_{1,i}}}\times Ref.1_{position})(\frac1{d_{2,i}}\times Ref.2_{position})}{\frac1{d_{1,i}}+\frac1{d_{2,i}}}\right)\\;where\;W_{1,i}=\frac1{d_{1,i}}\;and\;W_{2,i}=\frac1{d_{2,i}}\end{aligned}$$
(10)

For the solution 4 in (10), \({P}_{et,i}\) is determined based on the weighted centroid localization concept [32, 33]. This solution assigns a greater weight (i.e., \({W}_{1}=1/{d}_{1,i}\) or \({W}_{2}=1/{d}_{2,i}\)) to the reference node closest to the target node, where \({\text{Ref}.1}_{\text{position}}\) and \({\text{Ref}.2}_{\text{position}}\) are the reference node positions in x-axis (i.e., the constant values depend on the experimental setup). Here, the shorter distance (i.e., strong RSSI value) has more weight value than the longer distance (i.e., weak RSSI value). Thus, \(W\) and \(d\) are inversely proportional.

Solution 5:

$$P_{et,i}=\left(W\times d_{1,i}\right)+\left(\left(1-W\right)\times\left|\text{ref.1 to ref.2 distance}-d_{2,\mathrm i}\right|\right) W=\left\{\begin{array}{c}1,{\text{RSSI}}_{d_{1,i}}\geq{\text{RSSI}}_{d_{2,i}} \\0,Else\end{array}\right.$$
(11)

For the solution 5 in (11), \({P}_{et,i}\) is determined based on the condition of the RSSI value. If \({\text{RSSI}}_{{d}_{1,i}}\ge {\text{RSSI}}_{{d}_{2,i}}\) (i.e., \({\text{RSSI}}_{{d}_{1,i}}\) is stronger than \({\text{RSSI}}_{{d}_{2,i}}\)), a weight (\(W\)) is set to 1 and \({d}_{1,i}\) is used as the estimation result. On the other hand, \(W\) is set to 0, and \(\left|\text{ref.1 to ref.2 distance}-d_{2,i}\right|\) is used for the estimation result instead. By the solution in (11), the result is automatically provided based on the RSSI signal level. We note that if \(W=0.5\), the estimated target position is then equal to the result obtained from the solution 3 in (9). Thus, the solutions 3 and 5 can be integrated together.

Solution 6:

$$\begin{aligned}P_{et,i}&=\frac{\sum_{j=1}^n(W_{j,i}\times{Ref.j}_{position})}{\sum_{j=1}^n(W_{j,i})};n=number\;of\;ref.\;node\\ W_{j,i}&={(1-\alpha)}^{{RSSI}_{max}-{RSSI}_{j,i}}\\P_{et,i}&=\frac{\sum_{j=1}^n({(1-\alpha)}^{{RSSI}_{max}-{RSSI}_{j,i}}\times{Ref.j}_{position})}{\sum_{j=1}^n{(1-\alpha)}^{{RSSI}_{max}-{RSSI}_{j,i}}}\\P_{et,i}&=\frac{({(1-\alpha)}^{{RSSI}_{max}-{RSSI}_{1,i}}\times{Ref.1}_{position})+({(1-\alpha)}^{{RSSI}_{max}-{RSSI}_{2,i}}\times{Ref.2}_{position})}{({(1-\alpha)}^{{RSSI}_{max}-{RSSI}_{1,i}})+({(1-\alpha)}^{{RSSI}_{max}-{RSSI}_{2,i}})}\end{aligned}$$
(12)

Finally, in the solution 6 in (12), \({P}_{et,i}\) is determined based on the concept of the relative span exponential weighted localization [34, 35], where the weight is obtained by the relative placement of the RSSI value within the span of all the RSSI values measured by the target node [36]. Here, the solution 6 favors the reference node which exhibits higher RSSI values and therefore are likely to be closer to the target node. This is obtained using the weighting factor \(\alpha\), according to the exponentially moving average concept. We note that, by (12), \({\text{RSSI}}_{\max }\) is the maximum value in the span of the RSSI values measured by the target node. Also, in this work, \(\alpha\) will be varied during the experiment where the optimal value can be determined when the estimated distance error reaches the minimum value.

2.4 Filtering of the estimated target position

We also apply the filter to the estimated target position (\({P}_{et,i}\)) as introduced in the previous section. The filter is used to reduce the variation of the \({P}_{et,i}\) value which is determined from raw RSSI signals (sample-by-sample). Thus, the \({P}_{et,i}\) data stream and its average values then will be improved. The output value after applying the exponential weighted moving average filter (\({P}_{s\_et,i}\)) is shown in (13), where \({P}_{s\_et,i}\) is the smoothed value at the sample number \(i\), and \(\lambda\) is the weighting factor. By (13), the result depends on the previous smoothed value (\({P}_{s\_et, i-1}\)) and the recent \({P}_{et,i}\) value multiplied by the weighting factor which is between 0 and 1. \(\lambda\) close to 1 gives high priority to recent changes in the \({P}_{et,i}\) value, while \(\lambda\) close to 0 indicates that the previous output \({P}_{s\_et, i-1}\) plays a role in the calculation. In this work, \(\lambda\) is also varied during the experiment, and the optimal value is corresponding to the value which gives the smallest average distance error. Derivation of (13) is also provided below.

$${P}_{s\_et,i}=\lambda \times {P}_{et,i}+\left(1-\lambda \right)\times {P}_{s\_et, i-1}$$
(13)

By substituting \({P}_{et, i-1}\), \({P}_{et, i-2}\)…, and \({P}_{et,1}\) into (13), the general form can be obtained, as shown in (14).

$$\begin{aligned}P_{s\_et,i}&=\lambda\times P_{et,i}+\lambda\times\left(1-\lambda\right)\times\lbrack\lambda\times P_{et,i-1}+(1-\lambda)\times P_{s\_et,i-2}\rbrack\\&=\lambda\times P_{et,i}+\lambda\times\left(1-\lambda\right)\times P_{et,i-1}+{(1-\lambda)}^2\times P_{s\_et,i-2}\\&=\lambda\times P_{et,i}+\lambda\times\left(1-\lambda\right)\times P_{et,i-1}+{(1-\lambda)}^2\times\lbrack\lambda\times P_{et,i-2}+(1-\lambda)\times P_{s\_et,i-3}\rbrack\\&=\lambda\times P_{et,i}+\lambda\times\left(1-\lambda\right)\times P_{et,i-1}+{(1-\lambda)}^2\times P_{et,i-2}+{(1-\lambda)}^3\times P_{s\_et,i-3}\\&\quad\;.\\&\quad\;.\\&\quad\;.\\P_{s\_et,i}& =\lambda\times P_{et,i}+\lambda\times\left(1-\lambda\right)\times P_{et,i-1}+{\lambda\times\left(1-\lambda\right)}^2\times P_{et,i-2}+\dots+\lambda\times\left(1-\lambda\right)^{i-1}\times P_{et,1}\end{aligned}$$
(14)

An example of the solution 6 in (12) and the filter in (13) implemented on MATLAB/Simulink is also illustrated in Fig. 2. Flowchart of the proposed methods with the filter is also presented in Fig. 3.

Fig. 2
figure 2

The proposed solution 6 in (12) and the filter in (13) implemented on MATLAB/Simulink

Fig. 3
figure 3

A flowchart of the proposed methods with the filter

2.5 A determination approach for finding the optimal parameters

As we mentioned above, for the solution 6 in (12) and the filter in (13), generally, the values of \(\alpha\) and \(\lambda\) are varied by manual tuning during the experiment, and the optimal values can be obtained when the average estimated distance error reaches the minimum value. However, the manual tuning technique is not the appropriate solution since it requires time and inaccurate result. Therefore, we also propose a determination approach for finding the optimal values of \(\alpha\) and \(\lambda\) using the optimization technique, where the optimal values are determined by minimizing the mean absolute error (MAE) as the error between the estimated positions and the reference positions (or the actual positions). In this work, optimization problems are implemented and solved using the Solver optimization tool in Excel program. Table 1 provides the optimization information, and Fig. 4 illustrates a flowchart for determining the optimal \(\alpha\) and \(\lambda\). Here, the MAE is minimized by adjusting the values of \(\alpha\) and \(\lambda\) where they are in the range between 0 and 1.

Table 1 Optimization information for determining the optimal values of \(\alpha\) and \(\lambda\)
Fig. 4
figure 4

A flowchart for determining the optimal values of \(\alpha\) and \(\lambda\)

We note that, in our approach, we require the off-line phase or the training phase. In the beginning, the mobile target node moves from the starting point to the destination point in the test field (i.e., we know the moving route; the reference positions or the actual positions). Then, the solution 6 and the filter are applied, while the optimal values of \(\alpha\) and \(\lambda\) are determined by the optimization approach as illustrated in Fig. 4. Finally, for the online phase or the testing phase, the optimal values of \(\alpha\) and \(\lambda\) determined from the first phase are used.

3 Experiments

3.1 Experimental setup

As we mentioned in the introduction section, the proposed system can be applied for medical and healthcare services, like patient and mobile robot tracking systems in hospitals. Thus, in our test, experiments have been performed in the hospital building as shown in Fig. 5. Figure 6 also shows the layout of the test field. Here, two reference nodes are fixed at the defined positions \({x}_{\text{ref}.1}\) = 1 m and \({x}_{\text{ref}.2}\) = 22 m (i.e., \({\text{Ref}.1}_{\text{position}}\) and \({\text{Ref}.2}_{\text{position}}\)), respectively. Hence, \(\text{ref.1 to ref.2 distance}\) in (8) is equal to 21 m. The moving target node connected to the computer is also between these two reference nodes. All nodes are placed 1 m above the floor level.

Fig. 5
figure 5

The test field with the equipment. a Corridor in the hospital building. b Equipment

Fig. 6
figure 6

The layout of the test field in Fig. 5

We define that there are two test cases. In the first test case, the target node moves from the position \({x}_{\text{actual}}\) = 2 m (i.e., near the reference node 1) to the position \({x}_{\text{actual}}\) = 21 m (i.e., near the reference node 2) with a low moving speed (see the moving direction in Fig. 5). For the second test case, the target node moves from the position \({x}_{\text{actual}}\) = 2 m to the position \({x}_{\text{actual}}\) = 21 m with higher moving speed (i.e., double speed of the first test case, approximately).

Low-power Z1 modules [37] are employed in our experiments, as shown in Fig. 5(b). Z1 is equipped with a second-generation MSP430F2617 low-power microcontroller and a CC2420 [38] RF transceiver, 2.4 GHz IEEE 802.15.4 standard with 250-kbps data rate, and 0 dBm output power. Z1 sensor nodes can be applied for many wireless sensor network applications such as environmental monitoring, personal healthcare monitoring, emergency detection, and Internet of Thing (IoT) scenarios [37]. In our system, Z1 (the reference node) is attached with a tripod and connected to the power source through a serial port. A carrier-sense multiple-access/collision-avoidance (CSMA/CA) protocol [39] is also used for medium access, and channel 26 (2.480 GHz) is operated. In our experiments, we make sure that there is no signal interference from the WiFi channels in the corridor environments, since we first monitor them by using the WiFi analyzer software. Most of WLAN devices deployed in the test field use the channels 1, 6, and 11 as corresponding to the channel frequencies of 2.412, 2.437, and 2.462 GHz. Therefore, during the experiment, we set the different channel from the WLAN devices, to avoid signal interference.

We note that, in this paper, we concentrate on sampling RSSI signals and deciding the location of targets or patients. In the next step of this work, we are going to collect environmental information using sensors to support patient's condition in addition to tracking.

  1. B.

    Finding of log-distance path-loss equation

As introduced in Sect. 2 (B), the measured RSSI values collected from the test field are converted to the distance values using the log-distance path-loss equation as in (1) to (5) that it is used for the solutions 1 to 5 in Sect. 2 (C)). To determine the path-loss equation for the test field in Fig. 5, in the beginning, one transmitter node and one receiver node are used to measure RSSI data at different distances throughout the corridor. At each distance, the receiver node collects 10,000 RSSI data samples. Figure 7 is a plot of the average RSSI in dBm units versus the distance in meters (i.e., a logarithmic scale). By applying linear curve fitting, the path-loss equations can be found. Here, from (1) and (5), \(\beta\) or the path-loss exponent of the test field (i.e., the slope of the graph) is 2.5334, and \({\text{RSSI}}_{{d}_{0}}\) is −14.046 dBm with \({R}^{2}\) of 0.9358.

Fig. 7
figure 7

The path-loss equation of the test field in Fig. 5

  1. III.

    Performance metrics

To evaluate the estimation accuracy of the proposed system, the actual target position (\({x}_{\text{actual}}\)) of the target node during the experiment and the estimated target position after smoothing (\({P}_{s\_et,i}\)) are reported. An error distance defined in (15) is also used as the performance metric. It is the deference between \({x}_{\text{actual},i}\) and \({P}_{s\_et,i}\). Additionally, an average error distance defined in (16) is provided, where \(N\) is the number of samples to be averaged.

$$\text{Error distance}=\sqrt{{(x_{\text{actual},i}-P_{s\_et,i})}^2}$$
(15)
$$\text{Avg.error distance}=\frac1N\sum\nolimits_{i=1}^N\sqrt{{(x_{\text{actual},i}-P_{s\_et,i})}^2}$$
(16)

4 Experimental results and discussion

The experimental results and discussion are separated into two parts: the part 1) results by the manual tuning of \(\alpha\) and \(\lambda\), and the part 2) results by the optimization approach. In the part 1), both values of \(\alpha\) and \(\lambda\) are varied, and we show the best values which provide the minimum value of the average error distances. For the part 2, the optimization approach for finding the optimal parameters of \(\alpha\) and \(\lambda\) in Sect. 2 (E) is applied.

We note that, as mentioned in Sect. 3.1, there are two major test cases of experiments. For the part 2), the first test case (i.e., the low moving speed case) is used as the off-line phase or the training phase for finding the optimal \(\alpha\) and \(\lambda\) (we know the reference positions), while the section test case (i.e., the high moving speed case) is as the online phase or the testing phase.

  1. Part 1:

    Results by the manual tuning of \(\alpha\) and \(\lambda\) 

The raw RSSI signals measured from the first test case and the second test case (i.e., double moving speed) are shown in Fig. 8. The actual target positions (\({x}_{\text{actual}}\)) of the target node during the experiment, the estimated target positions before smoothing (\({P}_{et,i}\)), and the estimated target positions after smoothing (\({P}_{s\_et,i}\)) with the weighting factor \(\lambda\) (in (13)) of 0.05 (i.e., the best value by manual tuning) for both test cases are shown in Fig. 9. We note that, for the solution 6, the weighting factor \(\alpha\) (in (12)) is set to 0.1 (i.e., the best value by manual tuning). Figure 10 also demonstrates the average error distances by the solution 1 to the solution 6 with \(\lambda\) of 0.05 for both test cases.

Fig. 8
figure 8

Raw RSSI signals received from the reference node 1 and the reference node 2; a the first test case and b the second test case

Fig. 9
figure 9figure 9

The actual target positions (\({x}_{\text{actual}}\)) of the target node during the experiment and the estimated target positions before and after smoothing (\({P}_{et,i}\) and \({P}_{s\_et,i}\) with \(\lambda =0.05\)); a the first test case and b the second test case

Fig. 10
figure 10

The average error distances by the solution 1 to the solution 6 with \(\lambda =0.05\); a the first test case and b the second test case

The experimental results indicate that in Fig. 8, since the moving target moves from the position \({x}_{\text{actual}}\) = 2 m (i.e., near the reference node 1; at 1 m) to the position \({x}_{\text{actual}}\) = 21 m (i.e., near the reference node 2; at 22 m), the RSSI signals received from the reference node 1 decreases with the distance increase, while in contrast, the RSSI signals received from the reference node 2 increases. Also, as mentioned before, the moving target in the first test case has lower moving speed than the second test case. Thus, as seen in the graph, in the first test case, the target requires more time to reach the destination and there are higher collected RSSI samples (i.e., 468 and 195 RSSI samples for the first and the second test cases, respectively).

In Fig. 9, the experimental results demonstrates that, for both test cases, using the solutions 1 and 2 which consider only the RSSI signal received from the reference node 1 or the reference node 2, they cannot efficiently track the actual target positions. Here, the solution 1 provides a good tracking result when the target is near the reference node 1’s location. On the other hand, the solution 2 is better when the target is close to the reference node 2. The solutions 3 to 6 which use RSSI information from both reference nodes have better results than the solutions 1 and 2. Here, the solution 3 which is the combination of the solutions 1 and 2 and the solution 5 which estimates the target positions based on the selection of the RSSI level can be used to track the moving target, since their estimated results are more close to the actual target positions. However, we have found that the solutions 4 and 6 which are based on the weighted centroid localization and the relative span exponential weighted localization concept significantly provide the best results, since they can efficiently track the actual target positions with small errors. This summary can also be confirmed by the results in Fig. 10. The average error distance results from both test cases reveal that there are three groups of the estimation accuracy of the proposed solutions; the solutions 1 and 2, the solutions 3 and 5, the solutions 4 and 6 (more accurate solution), respectively. The average distance errors reduce from 5.14 (the solution 2) to 1.01 m (the solution 6) and 4.55 (the solution 2) to 0.86 m (the solution 4) for the first test case and the second test case. Here, the average errors decrease by 81.365% and 80.854%, respectively.

Figure 11 illustrates examples of the average error distances by the solution 4 for both test cases when varying the weighting factor \(\lambda\) of the filter in (13), and Fig. 12 also shows examples of the estimated target positions by the solution 4 when varying \(\lambda\). These examples indicate that the minimum error can be obtained by using the weighting factor \(\lambda\) of 0.05. Therefore, this is the reason why, in Figs. 9 and 10, \(\lambda =0.05\) is used and displayed for consideration. We note that, from Fig. 11, at \(\lambda =0.05\), the average errors are 1.11 m and 0.86 m that they are corresponding to the results in Fig. 10.

Fig. 11
figure 11

Examples of the average error distances by the solution 4 when varying the weighting factor \(\lambda\) of the filter in (13); a the first test case and b the second test case

Fig. 12
figure 12

Examples of the estimated target positions by the solution 4 when varying the weighting factor \(\lambda\); a the first test case and b the second test case

Figure 13 shows examples of the average error distances by the solution 6 for both test cases when varying the weighting factor \(\alpha\) in (12). Here, the experimental results indicate that, to efficiently use the solution 6 as based on the relative span exponential weighted localization concept, the optimal \(\alpha\) value in the weight function (i.e., \({{W}_{j,i}=\left(1-\alpha \right)}^{{\text{RSSI}}_{\max }-{\text{RSSI}}_{j,i}}\)) should be determined and used. In our cases, \(\alpha =0.1\) provides the best results. We note that, from the graph, at \(\alpha =0.1\), the average errors are 1.01 m and 0.87 m that they are corresponding to the results in Fig. 10.

Fig. 13
figure 13

Examples of the average error distances by the solution 6 when varying the weighting factor \(\alpha\) of the solution 6 in (12); a the first test case and b the second test case

  1. Part 2:

    Results by the optimization approach

The average error distance results, when the optimization approach for finding the optimal parameters of \(\alpha\) (for the solution 6) and \(\lambda\) (for the filter) in Sect. 2 (E) is applied, are demonstrated in Fig. 14. As we mentioned before, the first test case (i.e., the low moving speed case) is used as the training phase for finding the optimal \(\alpha\) and \(\lambda\) (we know the reference distance), while the second test case (i.e., the high moving speed case) is as the testing phase. We have found that after applying the optimization approach to the first test case, the optimal value of \(\alpha\) is equal to 0.0826 (by manual tuning, it is 0.1 as in Fig. 13), and the optimal value of \(\lambda\) is 0.0253 (by manual tuning, it is 0.05 as in Fig. 11). The implementation of the determination approach for finding the optimal value of \(\alpha\) and \(\lambda\) is also illustrated in Appendix.

Fig. 14
figure 14

The average error distances by the solution 6 without and with the optimization approach in Sect. 2 (E); a the first test case and b the second test case

Figure 14 indicates that using the optimal values of \(\alpha\) and \(\lambda\), the average error distances are 0.97 m and 0.78 m, respectively; they are lower than the case manual tuning as presented in the part 1. Although there is not much decrease compared with the manual tuning case, the major advantages are that the smallest error can be automatically obtained and manual tuning time by researchers/users is not required. We note that from Fig. 14, we have also found that, if the filter in (13) is not applied, the average error distances by the solution 6 with the optimal value of \(\alpha\) are equal to 1.943 m (i.e., the first test case) and 2.236 m (i.e., the second test case), respectively. After applying the filter with \(\lambda\) of 0.0253, the average errors significantly reduce to 0.97 m and 0.78 m, respectively. These results confirm the importance and the significance of the filter method. Finally, Fig. 15 also illustrates the actual target positions (\({x}_{\text{actual}}\)) of the target node during the experiment and the estimated target positions using \(\alpha\) of 0.0826 and \(\lambda\) of 0.0253 for both test cases. Here, we can see that the proposed solution 6 and the filter with their optimal parameter setting can efficiently track the mobile target node, where the estimated results are more close to the actual target positions.

Fig. 15
figure 15

The actual target positions (\({x}_{\text{actual}}\)) of the target node during the experiment and the estimated target positions using \(\alpha\) of 0.0826 and \(\lambda\) of 0.0253; a the first test case and b the second test case

5 Conclusions

Implementation and validation of the real-time mobile target tracking system based on RSSI signals is introduced in this paper. We propose six solutions for target tracking in the hospital building using RSSIs received from two reference nodes located at the opposite sides of the corridor.The filter is also applied to smoothen and improve the estimation position accuracy. Additionally, the determination approach for finding the optimal parameters assigned for the proposed tracking solutions and the filter is also introduced. Experimental results using the 2.4 GHz, IEEE 802.15.4/ZigBee wireless network indicate that the proposed solutions with the filter can automatically and efficiently track the moving target. From our test scenarios with the 22-m test field, the smallest distance error is 0.78 m.

In future work, the proposed system will be tested and evaluated in the case that the mobile target moves with various movement speeds, movement patterns (i.e., circle, zig-zag), and environments. In addition, the proposed tracking solution using RSSI will be extended to reduce the estimation error more, and the filtering methods based on the time-series concept will be developed. Finally, for practical use, we will implement the proposed algorithms in a nodeMCU like Arduino to test the proposed system in real situations.