Next Article in Journal
Multiscale Design of Graded Stochastic Cellular Structures for the Heat Transfer Problem
Next Article in Special Issue
A Wireless Sensor System for Diabetic Retinopathy Grading Using MobileViT-Plus and ResNet-Based Hybrid Deep Learning Framework
Previous Article in Journal
Needle Fracture in Pterygomandibular Space during Loco-Regional Dental Anesthesia: Systematic Review
Previous Article in Special Issue
Lightweight Integrity Preserving Scheme for Secure Data Exchange in Cloud-Based IoT Systems
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Real-Time Indoor Positioning Based on BLE Beacons and Pedestrian Dead Reckoning for Smartphones

School of Computer Science and Technology, Zhejiang University of Technology, Hangzhou 310023, China
*
Author to whom correspondence should be addressed.
Appl. Sci. 2023, 13(7), 4415; https://doi.org/10.3390/app13074415
Submission received: 9 February 2023 / Revised: 14 March 2023 / Accepted: 27 March 2023 / Published: 30 March 2023
(This article belongs to the Special Issue Recent Advances in Wireless Sensor Networks and Its Applications)

Abstract

:
Nowadays, smartphones have become indispensable in people’s daily work and life. Since various sensors and communication chips have been integrated into smartphones, it has become feasible to provide indoor positioning using phones. This paper proposes such a solution based on a smartphone, combining Bluetooth low energy (BLE) and pedestrian dead reckoning (PDR) in the particle filter framework to realize real-time and reliable indoor positioning. First, the smartphone’s built-in accelerometer, magnetometer, and gyroscope are used to provide data measurements and formulate a feasible method for PDR. Second, a range-free weighted centroid algorithm is proposed to realize BLE-based localization with low computation complexity. However, a single positioning technology has limitations, e.g., the cumulative error of PDR and the received signal strength fluctuation of BLE. Finally, to exploit the complementary strengths of each technology, a fusion framework utilizing a particle filter is proposed to combine PDR and BLE-based methods and provides more stable and accurate positioning results. Experiments are conducted on a floor in a campus building. Experimental results show that our proposed fused positioning method offers more accurate and stable performance in the long run compared with single PDR or BLE-based positioning. The achieved average positioning error is 1.34 m, which is reduced by 24.16% compared with PDR positioning and 10.60% compared with BLE-based positioning. Moreover, about 95% of the positioning errors are smaller than 1.7 m. The proposed fused positioning method has a vast application prospect in indoor navigation, indoor user tracking, and interactive experience for indoor visitors.

1. Introduction

Location-based service (LBS) has received tremendous attention due to the popularity of smartphones. On the one hand, LBS provided by smartphone apps and point-of-interest (POI) database [1] greatly enriches users’ daily life by satisfying various demands [2], such as autonomous navigation, searching for nearby POIs, and finding friends. On the other hand, it also facilitates advanced activities to the service provider [3], including personnel management and scheduling, location-based advertisement, business intelligence, and analysis. A smartphone can obtain accurate positions in an outdoor environment using its built-in global navigation satellite system (GNSS) chip. However, GNSS performs poorly in the indoor environment due to the signal block by buildings [4]. Nevertheless, smartphone users usually spend more than 70% of the time in an indoor environment [2], and indoor areas such as hospitals, buildings, and shopping malls are becoming more and more complex. Patient and medical staff tracking in smart hospitals [5], indoor navigation in buildings and shopping malls [6], and interactive and personalized experiences for museum visitors [7] are some practical indoor service requirements. Thus, indoor positioning for smartphones is pressingly needed to support various indoor LBSs.
Nowadays, a smartphone is an integration of communication and measurement devices. On the one hand, it supports Bluetooth low energy (BLE), WiFi, and 4G/5G cellular connectivity for communication. On the other hand, it incorporates various sensors such as an accelerometer, gyroscope, magnetometer, etc., which can be used to provide information on the user’s actions [8]. Pedestrian dead reckoning (PDR) [9] is a relative navigation technique that uses these sensor measurements. It consists of four parts: (1) step detection based on an accelerometer, (2) step length estimation based on empirical acceleration models, (3) heading direction estimation between each step based on the gyroscope or magnetometer, and (4) 2D position estimation—noting that in PDR, the user’s current position is estimated based on the previous position by calculating the walking distance and the heading direction. It has the merits of good real-time performance and relatively accurate positioning for short-time intervals. Meanwhile, it suffers from large cumulative error when long distances are involved, and it greatly depends on the precision of the previous position [8]. Therefore, PDR is usually utilized in combination with other methods. As for smartphone-based indoor localization, PDR has been combined with BLE [10], WiFi [11], acoustics [2], and magnetic fields [12] in the literature to provide higher positioning accuracy. Among these technologies, WiFi and BLE are the most commonly adopted [8]. By deploying WiFi access points (APs) or BLE Beacon tags in the indoor area, the received signal strength (RSS) obtained by the smartphone can be used to achieve indoor positioning. Compared with WiFi, BLE Beacon tags have the following advantages: they have a small size and low energy consumption, can be placed flexibly in any indoor location without active power supply [8], and cost much less energy to scan for BLE devices than to scan for WiFi APs [13]. Therefore, BLE is more promising than WiFi to become the mainstream technology in the indoor positioning market [14]. It has been widely used in building emergency management [15], occupancy detection [16], smart grid applications [17], and smart energy management [18]. That is also why we select BLE to combine with PDR in this paper.
An integrated system combining BLE and PDR is a feasible solution for realizing real-time and long-term indoor positioning of a smartphone with relatively high precision [3,10,19,20]. Due to the short-term high-precision features of the PDR method, occasional abnormal BLE signals caused by a non-line-of-sight (NLOS) environment or interference in similar frequency bands can be detected and effectively eliminated. Meanwhile, the positions obtained from normal signals with the BLE localization can be used to correct and inhibit the error accumulation of the PDR method. In this paper, we present a real-time indoor localization method for smartphones based on the combination of BLE and PDR positioning in the particle filter framework. Particle filtering has been proven an effective framework that fuses the RSS-based and PDR positioning methods [8,21,22,23]. The proposed fusion method can effectively reduce the cumulative error of PDR and mitigate the influence of the RSS fluctuations and thus provide more accurate and reliable positioning for smartphones. The contributions of this paper are listed in the following:
  • To realize the PDR method, first, peak detection is used for step detection based on the measured acceleration; second, an empirical nonlinear step length estimation model is adopted based on the measured acceleration in a single stride; third, the heading direction is estimated by using the complimentary filter to combine the measurements from magnetometer, gyroscope, and accelerometer.
  • For BLE-based localization, a range-free weighted centroid algorithm is proposed instead of commonly-used range-based trilateration or fingerprint-based method. This range-free method has low computation complexity and is proven to be efficient, especially when the BLE anchor tags are densely deployed.
  • The particle filter framework is adopted to fuse the positioning results obtained by PDR and BLE-based methods. As the PDR method cannot determine the initial position and suffers from error accumulation over time, and the BLE-based method cannot provide continuous and stable positioning results due to signal fluctuation, the combination of the two methods under the particle filter framework is able to overcome the shortcomings of both sides and provides more stable and accurate positioning results.
  • We have implemented the proposed positioning method on the smartphone and performed indoor positioning experiments on a floor of the campus building. Experimental results indicate that our proposed fused positioning method offers more accurate and stable performance in the long run compared with pure PDR or BLE-based positioning.
The rest of the paper is organized as follows. Section 2 presents related work. Section 3 describes the nuts and bolts of our proposed method, including the overall architecture, the PDR method, the range-free BLE-based method, and the use of a particle filter framework. Performance evaluation by experiments is discussed in Section 4. Finally, Section 5 concludes this paper.

2. Related Work

Over recent decades, various technologies such as WiFi, BLE, PDR, ultra-wideband (UWB), acoustic and ultrasonic wave, radio frequency identification (RFID), geomagnetic field, visible light communication (VLC), and combinations of these technologies have been used for indoor positioning on smartphones [4,24,25]. Although UWB and VLC can achieve high accuracy, they do not seem to receive as strong support from the community as BLE or WiFi [3]. In this section, we briefly review the advances in PDR positioning, BLE-based positioning, and fused positioning methods, which are mostly related to our work.

2.1. PDR

PDR positioning using the inertial measurement units (IMU) is commonly used in indoor positioning since accelerometers, gyroscopes, and magnetometers have been integrated into smartphones, and it does not need an extra infrastructure investment [9,26]. However, PDR using IMU sensors has an acceptable positioning accuracy only for a short distance since it suffers from cumulative error in heading estimation over time. Extensive studies have been conducted recently to reduce cumulative error. First, to achieve accurate and robust step detection, various algorithms are proposed, such as peak-detection [27], zero-crossing [28], wavelet transform [29], dynamic time warp (DTW) [30], and a combination of the above methods [31]. Second, to acquire accurate step length, several step-length estimation technologies have been proposed. In some technologies, various parameters are required, such as step frequency, user’s leg length or height, and even angle between legs [32], which are inconvenient to obtain. Empirical models based on acceleration, and features extracted from acceleration, are the most frequently exploited [33,34]. Third, the most commonly used heading direction estimation scheme is fusing data from accelerometer and magnetometer measurements to compensate for gyro drift [35]. Wu et al. [36] propose a fusion algorithm based on the gradient descent algorithm combining a linear Kalman filter and the least square solution based on aided vector measurements to improve the accuracy and convergence. Recently, some data-driven technologies leveraging deep learning methods have been proposed for step detection [37] and step length estimation [38,39,40]. In addition, data-driven technologies are also adopted to directly regress the speed and the heading [41,42], achieving 3-D inertial navigation. However, applying deep learning methods requires the collection of massive datasets to train the neural network and additional equipment to obtain the ground-truth information beforehand, which is labor-intensive to execute. Moreover, for real-time PDR positioning, it is better to deploy the trained neural network on the smartphone for local computing, which may bring a heavy computation load to the end-device.

2.2. BLE-Based Positioning

BLE-based positioning has been extensively explored over the past few years. Currently, the most commonly-used BLE includes Apple’s iBeacon and Google’s URIBeacon [20]. BLE is not designed from the ground up as a positioning technique, but it is feasible for estimating the user’s position based on RSS measurements. Though the principles of BLE-based and WiFi-based positioning methods are basically identical, it has been shown that under the same circumstance, BLE-based positioning tends to be more reliable than WiFi due to its lower transmission power and a unique channel hopping mechanism [43]. Moreover, BLE-based positioning has the advantage that the BLE beacon tags can be placed as required, and it provides good signal coverage. Depending on whether or not the distance information to an anchor tag is required, two derivatives of BLE-based indoor positioning algorithms are considered: range-based and range-free algorithms. The range-based algorithm first uses the path loss model to estimate the distance to nearby anchor tags and then adopts trilateration and least-square estimation to obtain the estimated location. Due to the multipath fading and background interference, the range estimates are inaccurate. Furthermore, additional efforts are needed to obtain the empirical path loss model. Over time, researchers have proposed various methods to improve the accuracy of a range-based algorithm utilizing various propagation models and machine learning [7,44,45]. However, all proposed approaches have limitations affecting RSS values and, consequently, distance and location estimates, which arise from attenuation from obstacles, radio interference, aggregation or low frequency of measurements, and their strong dependence on the environment [46]. For range-free methods, some adopt fingerprint-based methods similar to WiFi positioning [10,24]. However, it is labor-intensive to build and maintain the fingerprint database, and the positioning accuracy greatly depends on the quality and scale of the database.

2.3. Fused Positioning Methods

Since pure PDR or BLE-based methods cannot continuously offer reliable indoor positioning service, great efforts have been made by researchers to find solutions integrating these two technologies to mitigate the limitations of each individual technology. Studies have shown that the Kalman filter and particle filter can be used to promote GPS positioning, so they can also be used to improve the performance of indoor localization systems [26]. Filter theories such as the Kalman filter (KF), extended Kalman filter (EKF), unscented Kalman filter (UKF), and particle filter have been widely used to combine sensory data from disparate sources to obtain better positioning accuracy [22]. For instance, researchers have applied the KF [19,47], EKF [10,48], and UKF [49] to indoor positioning and obtained satisfying performance. However, the KF and EKF are not suitable for systems with severe nonlinearity and non-Gaussian noise [50], whereas the UKF can be applied to the nonlinear system but cannot deal with highly non-Gaussian noise [22]. On the contrary, the particle filter, which is based on Bayesian statistical theory and a sequential Monte Carlo framework, can approximate the true posterior distribution of the state for the nonlinear/non-Gaussian system. Particle filtering has demonstrated its excellent performance in several studies integrating PDR and RSS-based positioning methods [8,21,22,23].

3. Methodology

3.1. Methodology Architecture

The basic architecture of the proposed indoor positioning method is shown in Figure 1. It consists of three major components: BLE-based positioning, PDR, and a particle filter. The data inputs include the iBeacon RSS scans and IMU readings. For the BLE-based method, the iBeacon RSS scans are recorded as the weights for the centroid-based localization algorithm. For PDR, IMU readings are used for step detection, step length estimation, and heading direction estimation. The PDR and BLE-based methods are fused in the particle filter framework. Each particle represents a discrete-state hypothesis, which is initially generated using the BLE-based method. Then PDR is used to model the particle movement, and thus the state evolving is achieved. When new observation data is obtained from the BLE-based method, the weights of all particles are updated. Finally, particle resampling is performed according to the weight values, and the location is estimated from new particles. More details are elaborated on in the following sections.

3.2. BLE-Based Positioning

In this paper, we propose a weighted centroid positioning method, which is an extension of the simple centroid algorithm with RSS-related weights added to the anchor tags evolving in the positioning.

3.2.1. Traditional Centroid Algorithm

Suppose M iBeacon tags are deployed in the target indoor area with known positions ( x i , y i ) , i = 1 , 2 , , M . Let N t h and P t h be the number threshold, and power threshold, respectively, and P i be the RSS at the smartphone from iBeacon i. Denote the number of iBeacon signals with the RSS exceeding the threshold P t h by N ( P i > P t h , i = 1 , 2 , , M ) . If N > N t h , the estimated position of the smartphone is
( x ^ , y ^ ) = x 1 + + x N N , y 1 + + y N N .

3.2.2. Weighted Centroid Algorithm

The traditional centroid algorithm is coarse-grained and largely depends on the distribution of nearby iBeacon anchors. In order to decrease the influence of the anchor distribution and improve the positioning accuracy, a weighted centroid algorithm is proposed. The rationale behind this algorithm is to assign larger weights to the iBeacons that are closer to the smartphone. Thus Equation (1) can be extended to
( x ^ , y ^ ) = x 1 / d 1 + + x N / d N 1 / d 1 + + 1 / d N , y 1 / d 1 + + y N / d N 1 / d 1 + + 1 / d N .
Based on the free space path loss model, i.e., the Friss equation, the RSS at the receiver is
P r = ε P t / d α ,
where P t is the transmit power, d is the distance between the transmitter and the receiver, and ε is a constant related to the antenna gains and the wavelength. Suppose all the iBeacons use the same transmit power, combing (1) and (3), we have
( x ^ , y ^ ) = P 1 α x 1 + + P N α x N P 1 α + + P N α , P 1 α y 1 + + P N α y N P 1 α + + P N α .
It is worth noting that, in the proposed weighted centroid algorithm, the distances between the smartphone and nearby iBeacons do not need to be precisely estimated. Only the size relationship of the distances is concerned, which is reflected by the RSS. That is why a simple Friss equation is adopted instead of more complicated path loss models.

3.3. PDR Positioning

Nowadays, most smartphones have various built-in sensors, such as accelerometers, magnetometers, gyroscopes, light sensors, microphones, barometers, etc. These sensors can measure acceleration, orientation, and various environmental conditions. Among these sensors, the IMU sensor, consisting of an accelerometer, magnetometer, and gyroscope, can be used to perform PDR. PDR is a relative navigation technique that uses IMU sensor measurements to estimate the current position based on the previous position by calculating the distance and the heading angle. Concretely, the position x k + 1 = [ x k + 1 , y k + 1 ] T can be real-time updated by adding an amount of displacement to the previous position x k = [ x k , y k ] T :
x k + 1 y k + 1 = x k y k + l k cos φ k sin φ k ,
where l k is the distance traveled on step k and φ k is corresponding heading direction. In the following, we discuss the process in detail.

3.3.1. Step Detection

Step detection is a key component in the PDR method. Either failing to detect a few steps or detecting extra steps will lead to a decrease in the positioning accuracy. Peak detection is used in the paper for step detection. Accelerations change continuously and periodically when the user moves. A step is detected when the acceleration is greater than a threshold a t h . To further avoid false detection, the next footstep is counted if the time interval between two possible steps is greater than a threshold t t h . Specifically, the conditions of peak detection are given by
| a m g | a t h Δ t t t h ,
where a m = a x 2 + a y 2 + a z 2 is the local synthetic acceleration, a x , a y and a z are the 3-axis accelerations, and g is the the local gravity component. The parameters a t h and t t h are fine-tuned to achieve better accuracy. Using extensive experiments, a t h is set to 1.9 m/s2. Since t t h should be related to user velocity, the dynamic threshold is adopted with the detection frequency ranging from 1.65 to 2.85 Hz according to different user velocities.

3.3.2. Step Length Estimation

The step length estimation model can be classified into two categories: static model and dynamic model. The static model considers that the user’s step length is fixed throughout the process and is only related to the user’s individual characteristics, such as height. However, using a fixed step length will degrade the positioning accuracy since the step length is also affected by other factors, such as velocity, acceleration magnitude, the environment, etc. The dynamic model allows the step length to be different at different moments for the individual user. In this paper, we adopt a nonlinear step estimation model based on statistics proposed in [51]. The step length l is given by
l = τ a max a min 4 ,
where τ is a scale factor that can be obtained using offline training, a max and a min are the maximum and minimum values of the synthetic acceleration in the step detection process.

3.3.3. Heading Direction Estimation

We assume it is most likely that the user holds the smartphone to check the navigation while walking. Thus, the user holds the smartphone in a portrait orientation, pointing to the heading direction with the screen up. So, the user’s heading direction is the same as that of the smartphone. In this paper, the heading direction is estimated with the combined data from the magnetometer, accelerometer, and gyroscope using a complementary filter, as shown in Figure 2. It is given by
φ = ε · φ m + ( 1 ε ) φ g ,
where φ m is the heading angle obtained from the magnetometer and accelerometer, φ g is the heading angle obtained from the gyroscope, and ε is the weight coefficient of the complementary filter, depending on the accuracy of the two components. The rationale of this method is as follows. On the one hand, the heading angle estimated by the magnetometer and accelerometer is unstable over a short time due to the disturbance from the indoor magnetic field. On the other hand, a gyroscope can provide 3-axis angular velocities with high accuracy in a short interval, but it incurs accumulative error in the long run. Therefore, using a complementary filter to combine the heading angle from both components can improve accuracy and stability. In the following, we elaborate on how to obtain φ m and φ g , respectively.
First, we discuss how to get φ m based on the sensing data from the magnetometer and accelerometer—noting that the coordinate system of the smartphone sensors is based on the device coordinate system (DCS), which changes with the phone’s attitude. Therefore, we have to transform the DCS-based sensing data to the earth coordinate system (ECS) to ensure accuracy. The Euler angle is defined as the angle between the three axes of DCS and ECS, including pitch, roll, and yaw. The pitch, roll, and yaw represent rotation around the x, y, and z axes, often denoted by θ , γ , and φ , respectively. The relationship between the 3-axis magnetic field intensity under DCS and that under ECS is as follows:
H x H y H z = cos θ sin γ sin θ cos γ sin θ 0 cos γ sin θ sin θ sin γ cos θ cos γ cos θ h x h y h z ,
where H x H y H z T is the magnetic field intensity under ECS, and h x h y h z T is the magnetic field intensity under DCS provided by the magnetometer of the smartphone. The pitch θ and roll γ are obtained by measurements from the accelerometer:
θ = arctan a x a y 2 a z 2 ,
γ = arctan a y a z .
Then the estimated heading angle φ m can be calculated using
φ m = arctan H y H x = arctan h y cos γ h z sin γ h x cos θ + h y sin γ sin θ + h z cos γ sin θ .
Second, we discuss how to get φ g based on the data from the gyroscope. The rotation matrix C n b is introduced, representing the motion process of the device rotation from DCS to ECS, defined as follows:
C n b = cos θ cos φ cos θ sin φ + sin γ sin θ cos φ sin γ sin φ + cos γ sin θ cos φ cos θ sin φ cos θ sin φ + sin γ sin θ cos φ sin γ sin φ + cos γ sin θ cos φ sin θ sin γ cos θ cos γ cos θ .
To simplify the description, let C n b = C 11 C 12 C 13 C 21 C 22 C 23 C 31 C 32 C 33 , where C 11 , …, C 33 correspond to the 9 elements of the matrix in (13). The quaternion method is used to calculate the heading angular. Let the quaternion vector be Q = q 0 q 1 q 2 q 3 T . The initial value is given by
Q = q 0 q 1 q 2 q 3 = 1 2 1 + C 11 + C 22 + C 33 1 2 1 + C 11 C 22 C 33 1 2 1 + C 11 + C 22 C 33 1 2 1 C 11 C 22 + C 33 .
The gyroscope samples the 3-axis angular velocity ω = ω x ω y ω z T every Δ t time. Then the quaternion is updated using the first-order Runger-Kutta method as follows:
Q t + Δ t = I cos ( Δ θ / 2 ) + Ω ( ω ) Δ t sin ( Δ θ / 2 ) Δ θ Q t ,
where I is a 4 × 4 identity matrix, Δ θ = Δ t ω x 2 + ω y 2 + ω z 2 , Ω ( ω ) = 0 ω x ω y ω z ω x 0 ω z ω y ω y ω z 0 ω x ω z ω y ω x 0 .
Then the estimated heading angle φ g can be calculated by:
φ g = arctan 2 ( q 1 q 2 + q 0 q 3 ) q 0 2 q 1 2 + q 2 2 q 3 2 .
By substituting (12) and (16) into (8), the fused heading angle φ is finally obtained.

3.4. Particle Filter

PDR is a self-contained algorithm that provides an accurate position in a short time, but it depends on the previous position and suffers from cumulative error. BLE-based positioning does not rely on the previous position, but the accuracy varies due to signal interference. To improve the positioning accuracy, continuity, and stability, we propose integrating the two methods using a particle filter. The key strategy of the particle filter is to use a set of particles to represent the posterior distribution of the positioning process, replace integral operations with the sample mean, and obtain the minimum variance distribution of the state. The process of particle filtering consists of the following steps.

3.4.1. Particle Initialization

An initial set of m particles is generated P 0 = { X 0 ( i ) | i = 1 , 2 , , m } , where X 0 ( i ) = [ x 0 ( i ) y 0 ( i ) ] T is the position of the ith particle. The positions of the m particles are obtained by BLE-based positioning discussed in Section 3.2 plus the measurement noise. The noise follows a Gaussian distribution with a mean of 0 and a standard deviation of the positioning error. An equal weight of w 0 ( i ) = 1 / m is assigned to each particle.

3.4.2. Particle Position Update

The position of each particle is updated using the PDR method discussed in Section 3.3. Suppose the position of particle i at the k-th step is X k ( i ) . Once a new step is detected, according to the estimated step length l k and the heading direction ϕ k , without considering the system noise, the particle state transition follows
X k + 1 ( i ) = X k ( i ) + l k cos φ k sin φ k ,
where φ k and l k are the heading direction and step length of k-th step towards k + 1 -th step, respectively, which can be obtained by the methods introduced in Section 3.3.3 and Section 3.3.2, respectively.

3.4.3. Particle Weight Update

Once the condition that triggers the BLE-based positioning is satisfied, i.e., N ( P i > P t h ) > N t h , the observation based on BLE-based positioning is obtained X k + 1 B = [ x k + 1 B y k + 1 B ] T . Based on the observation, we update the particle weights according to a Gaussian pseudo-distribution:
w k + 1 ( i ) = 1 2 π δ exp ( X k + 1 ( i ) X k + 1 B ) T ( X k + 1 ( i ) X k + 1 B ) 2 δ 2 ,
where δ is the positioning error of the BLE-based method. After computing all particle weights, we normalize them to ensure that all weights sum up to one:
w ¯ k + 1 ( i ) = w k + 1 ( i ) j = 1 m w k + 1 ( j ) .

3.4.4. Particle Resampling

Let M t h be the threshold of a valid number of particles. Then, by the k + 1 -th step, the valid number of particles is
M k + 1 = 1 i = 1 m ( w ¯ k + 1 ( i ) ) 2 .
If M k + 1 < M t h , it implies severe degeneracy. To mitigate the effects of the degeneracy, sampling importance resampling (SIR) is applied whenever the degeneracy problem is detected. The resampling stage aims to remove the samples with a small value of the weight and to focus on the samples that have a large value of weight. Specifically, m particles are chosen with replacements with respective weights as the probabilities. Then the weights are reset to 1 / m equally.

3.4.5. Position Estimation

The weighted sum of particles is used to estimate the final position, which can be expressed as:
X k + 1 = i = 1 m w ¯ k + 1 ( i ) X k + 1 ( i ) .

4. Performance Evaluation

We conduct experiments in a real indoor environment to verify the accuracy and stability of the fused indoor positioning method proposed in this paper. It is worth noting that there is prior work that has proposed an indoor positioning method integrating BLE and PDR [10]. However, we will not compare their work for the following reasons. First, the fingerprint-based method is adopted for BLE positioning in [10]. However, it is labor-intensive to build and maintain the fingerprint database. Second, a robust filter based on the EKF is adopted to fuse the positioning results obtained using PDR and BLE-based methods in [10], which is totally different from the particle filtering framework adopted in our work. Actually, it is rather difficult to fully reproduce the method proposed in [10]. Therefore, we only compare the positioning results of our proposed fusion positioning method with pure PDR and BLE-based positioning methods. This section presents the experimental setting and results and makes an analysis.

4.1. Environmental Setting

The experiments are conducted on a floor of a campus office building, as shown in Figure 3. A total of 9 iBeacon tags are used in the experiment; see Figure 4a. The deployment scenario of iBeacons is shown in Figure 4c. They are mounted on the ceiling of the corridors at the height of 2.5 m above the ground with the same technical configuration. The horizontal interval between the iBeacon tags is approximately 4 m. A Huawei smartphone with Android 9.0 is used to collect the IMU data, as shown in Figure 4b. The phone is handled by a volunteer pointing to the heading direction with a screen up during the experiments. Since the major purpose of our work is to locate the smartphone user continuously in real-time instead of occasionally executing measurements statically, continuous trajectories are tested, which consist of two parts of the corridors, with distances of 20.8 m and 11.2 m, respectively; see the red lines in Figure 3. We compare our proposed method with the other two different methods: pure PDR and pure BLE-based methods. Ten groups of experiments on the same trajectory are independently conducted by applying the three methods. Thirty-two measurement points on the trajectory are selected to demonstrate the positioning performance.

4.2. Experimental Results

In the following, the experiment results are analyzed and discussed.

4.2.1. Step Detection and Heading Direction Estimation Results

Since step detection and heading direction estimation greatly affect the accuracy of PDR positioning, we first conduct experiments to separately test their performances. Figure 5 shows the original sampled acceleration data and the data after filtering. The sampling frequency is set to 30 Hz, the window size for the moving average filtering is set to 20, the acceleration threshold is set to 1.75 m/s2, and the step frequency threshold is set to 1 Hz. A total of 300 measurement points are plotted in Figure 5, and the red circles mark out the detections of steps, which are consistent with the ground truth. Figure 6 shows the estimated heading direction compared with the ground truth. It is observed that the estimated results are, in most cases, stable, and the deviations are less than 5 degrees when the user walks a straight line. It is worth noting that a sharp U-turn leads to a large fluctuation, but the estimation accuracy is restored in a short time.

4.2.2. Performance of Different Methods

Figure 7 displays the trajectories obtained in the corridor of a campus building with different positioning methods. It can be seen that the volunteer walks along a right-angle corridor at a uniform speed. Figure 8 shows the average errors of these methods. In the following, we make a detailed analysis of these methods.
(1)
For pure PDR positioning, the error is mainly caused by inaccurate measurement of the heading angle and also by inaccurate step length estimation. Analyzed from the source, the error comes from the measurement errors of the magnetometer, the accelerometer, and the gyroscope, which is inevitable. Since the position of the current point is derived from the position of the previous one, a high correlation appears between adjacent points, and thus the error gradually accumulates over a period of time. For example, in Figure 7, the trajectory obtained with PDR positioning after the bend deviates from the ground truth farther and farther away. As shown in Figure 8, the average error increases from 0.5 m at the start to 2.2 m at the end. Therefore, it is concluded that PDR cannot be independently and continuously used for long-term indoor positioning unless supplementary means are adopted to reduce the cumulative error.
(2)
The performance of BLE-based positioning is unstable due to the influence of the environment. As shown in Figure 8, the average error obtained with BLE-based positioning is larger than that obtained by PDR in the first part of the trajectory, but the average error of PDR positioning becomes larger in the second part. Compared with PDR positioning, the advantage is that the error is not accumulating over time. It is consequently a good complement to PDR positioning.
(3)
The average error of our proposed fused positioning method is the smallest among all the methods. As shown in Figure 8, the average error is not as cumulative as with PDR, and the fluctuation is smaller than that of the BLE-positioning. It is also observed that the positioning errors are large at the start of the positioning process. This is because the initial positions of the particles are randomly generated and dependent on the results from BLE-based positioning. With the increase in the number of iterations and resampling steps, the particles’ positions gradually converge, and the accuracy gradually improves.
Table 1 lists the maximum, minimum, and average errors of different methods. It is observed that our proposed fused positioning method has the smallest average error of 1.35 m, which is a reduction of 24.16% compared with PDR positioning and 10.60% compared with BLE-based positioning. Although PDR positioning has the smallest minimum error, its maximum error is the largest. These positioning results demonstrate that our proposed fused method can effectively improve the accuracy of indoor positioning.
Figure 9 shows the cumulative distribution function (CDF) of the positioning errors with different methods. It is observed that for our proposed fused positioning method, about 95% of the positioning errors are smaller than 1.7 m, while the probability is 80% and 65% for PDR and BLE-based positioning, respectively. It is worth noting that PDR positioning has a higher confidence level with an error smaller than 1.2 m. However, due to the cumulative error, it cannot maintain the advantage and has a higher probability of incurring large errors. Overall, our proposed fused positioning method statistically performs the best.

5. Conclusions

In this paper, we propose a smartphone-based real-time indoor positioning method for providing indoor LBS, in which a particle filter framework combines PDR and BLE-based positioning using the built-in sensors and BLE chip. First, the built-in smartphone accelerometer, magnetometer, and gyroscope are used to provide data measurements and formulate a feasible solution for PDR. Second, a range-free weighted centroid algorithm is proposed to realize BLE-based localization with low computation complexity. Finally, to exploit the complementary strengths of each technology, a fusion framework utilizing a particle filter is proposed to combine PDR and BLE-based methods and provides more stable and accurate positioning results. Experimental results show that our proposed fused positioning method offers more accurate and stable performance in the long run compared with single PDR or BLE-based positioning. The achieved average positioning error is 1.34 m, which is a reduction of 24.16% compared with PDR positioning and 10.60% compared with BLE-based positioning. Moreover, about 95% of the positioning errors are smaller than 1.7 m. The proposed fused positioning method has vast application prospects in indoor navigation, indoor user tracking, and interactive experience for indoor visitors, etc. In future work, we will further expand the proposed approach to the situation when there are map constraints, and the placement of the smartphone is unconstrained.

Author Contributions

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

Funding

This research was funded by the Natural Science Foundation of Zhejiang Province under Grant No. LZ21F020005, National Natural Science Foundation of China under grants Nos. 61772472 and 62271446, Fundamental Research Funds for the Provincial Universities of Zhejiang under grant No. RF-A2019002.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Not applicable.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Low, R.; Tekler, Z.D.; Cheah, L. An end-to-end point of interest (POI) conflation framework. ISPRS Int. J. Geo-Inf. 2021, 10, 779. [Google Scholar] [CrossRef]
  2. Liu, T.; Niu, X.; Kuang, J.; Cao, S.; Zhang, L.; Chen, X. Doppler shift mitigation in acoustic positioning based on pedestrian dead reckoning for smartphone. IEEE Trans. Instrum. Meas. 2021, 70, 1–11. [Google Scholar] [CrossRef]
  3. Dinh, T.M.T.; Duong, N.S.; Nguyen, Q.T. Developing a novel real-time indoor positioning system based on BLE beacons and smartphone sensors. IEEE Sens. J. 2021, 21, 23055–23068. [Google Scholar] [CrossRef]
  4. Davidson, P.; Piché, R. A survey of selected indoor positioning methods for smartphones. IEEE Commun. Surv. Tutor. 2017, 19, 1347–1370. [Google Scholar] [CrossRef]
  5. Hou, Y.; Yang, X.; Abbasi, Q.H. Efficient AoA-based wireless indoor localization for hospital outpatients using mobile devices. Sensors 2018, 18, 3698. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  6. Rezazadeh, J.; Sandrasegaran, K.; Kong, X. A location-based smart shopping system with IoT technology. In Proceedings of the IEEE 4th World Forum on Internet of Things (WF-IoT), Singapore, 5–8 February 2018; pp. 748–753. [Google Scholar]
  7. Spachos, P.; Plataniotis, K.N. BLE beacons for indoor positioning at an interactive IoT-based smart museum. IEEE Syst. J. 2020, 14, 3483–3493. [Google Scholar] [CrossRef] [Green Version]
  8. Xia, H.; Zuo, J.; Liu, S.; Qiao, Y. Indoor localization on smartphones using built-in sensors and map constraints. IEEE Trans. Instrum. Meas. 2019, 68, 1189–1198. [Google Scholar] [CrossRef]
  9. Yan, D.; Shi, C.; Li, T. An improved PDR system with accurate heading and step length estimation using handheld smartphone. J. Navig. 2022, 75, 141–159. [Google Scholar] [CrossRef]
  10. Xu, S.; Wang, Y.; Sun, M.; Si, M.; Cao, H. A Real-Time BLE/PDR Integrated System by Using an Improved Robust Filter for Indoor Position. Appl. Sci. 2021, 11, 8170. [Google Scholar] [CrossRef]
  11. Shen, L.L.; Hui, W.W.S. Improved pedestrian dead-reckoning-based indoor positioning by RSSI-based heading correction. IEEE Sens. J. 2016, 16, 7762–7773. [Google Scholar] [CrossRef]
  12. Ouyang, G.; Abed-Meraim, K. A Survey of Magnetic-Field-Based Indoor Localization. Electronics 2022, 11, 864. [Google Scholar] [CrossRef]
  13. Faragher, R.; Harle, R. Location fingerprinting with bluetooth low energy beacons. IEEE J. Sel. Areas Commun. 2015, 33, 2418–2428. [Google Scholar] [CrossRef]
  14. Zhuang, Y.; Yang, J.; Li, Y.; Qi, L.; El-Sheimy, N. Smartphone-based indoor localization with bluetooth low energy beacons. Sensors 2016, 16, 596. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  15. Filippoupolitis, A.; Oliff, W.; Loukas, G. Bluetooth low energy based occupancy detection for emergency management. In Proceedings of the 2016 15th International Conference on Ubiquitous Computing and Communications and 2016 International Symposium on Cyberspace and Security (IUCC-CSS), Granada, Spain, 14–16 December 2016; pp. 31–38. [Google Scholar]
  16. Tekler, Z.D.; Low, R.; Gunay, B.; Andersen, R.K.; Blessing, L. A scalable Bluetooth Low Energy approach to identify occupancy patterns and profiles in office spaces. Build. Environ. 2020, 171, 106681. [Google Scholar] [CrossRef]
  17. Collotta, M.; Pau, G. A novel energy management approach for smart homes using bluetooth low energy. IEEE J. Sel. Areas Commun. 2015, 33, 2988–2996. [Google Scholar] [CrossRef]
  18. Tekler, Z.D.; Low, R.; Yuen, C.; Blessing, L. Plug-Mate: An IoT-based occupancy-driven plug load management system in smart buildings. Build. Environ. 2022, 223, 109472. [Google Scholar] [CrossRef]
  19. Sung, K.; Lee, D.K.R.; Kim, H. Indoor pedestrian localization using iBeacon and improved Kalman filter. Sensors 2018, 18, 1722. [Google Scholar] [CrossRef] [Green Version]
  20. Chen, J.; Zhou, B.; Bao, S.; Liu, X.; Gu, Z.; Li, L.; Zhao, Y.; Zhu, J.; Li, Q. A data-driven inertial navigation/Bluetooth fusion algorithm for indoor localization. IEEE Sens. J. 2022, 22, 5288–5301. [Google Scholar] [CrossRef]
  21. Wu, X.; Shen, R.; Fu, L.; Tian, X.; Liu, P.; Wang, X. iBILL: Using iBeacon and inertial sensors for accurate indoor localization in large open areas. IEEE Access 2017, 5, 14589–14599. [Google Scholar] [CrossRef]
  22. Sung, K.; Lee, H.K.; Kim, H. Pedestrian positioning using a double-stacked particle filter in indoor wireless networks. Sensors 2019, 19, 3907. [Google Scholar] [CrossRef] [Green Version]
  23. Chen, J.; Song, S.; Liu, Z. A PDR/WiFi Indoor Navigation Algorithm Using the Federated Particle Filter. Electronics 2022, 11, 3387. [Google Scholar] [CrossRef]
  24. 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] [Green Version]
  25. Farahsari, P.S.; Farahzadi, A.; Rezazadeh, J.; Bagheri, A. A survey on indoor positioning systems for IoT-based applications. IEEE Internet Things J. 2022, 9, 7680–7699. [Google Scholar] [CrossRef]
  26. Harle, R. A survey of indoor inertial positioning systems for pedestrians. IEEE Commun. Surv. Tutor. 2013, 15, 1281–1293. [Google Scholar] [CrossRef]
  27. Abadleh, A.; Al-Hawari, E.; Alkafaween, E.; Al-Sawalqah, H. Step detection algorithm for accurate distance estimation using dynamic step length. In Proceedings of the 2017 18th IEEE International Conference on Mobile Data Management (MDM), Daejeon, South Korea, 29 May–1 June 2017; pp. 324–327. [Google Scholar]
  28. Goyal, P.; Ribeiro, V.J.; Saran, H.; Kumar, A. Strap-down pedestrian dead-reckoning system. In Proceedings of the International Conference on Indoor Positioning and Indoor Navigation, Guimaraes, Portugal, 21–23 September 2011; pp. 1–7. [Google Scholar]
  29. Wang, J.H.; Ding, J.J.; Chen, Y.; Chen, H.H. Real time accelerometer-based gait recognition using adaptive windowed wavelet transforms. In Proceedings of the 2012 IEEE Asia Pacific Conference on Circuits and Systems, Kaohsiung, Taiwan, 2–5 December 2012; pp. 591–594. [Google Scholar]
  30. Li, H.; Yang, L. Accurate and Fast Dynamic Time Warping. In Advanced Data Mining and Applications, Proceedings of the Advanced Data Mining and Applications, Hangzhou, China, 14–16 December 2013; Motoda, H., Wu, Z., Cao, L., Zaiane, O., Yao, M., Wang, W., Eds.; Springer: Berlin/Heidelberg, Germany, 2013; pp. 133–144. [Google Scholar]
  31. Yao, Y.; Pan, L.; Fen, W.; Xu, X.; Liang, X.; Xu, X. A robust step detection and stride length estimation for pedestrian dead reckoning using a smartphone. IEEE Sens. J. 2020, 20, 9685–9697. [Google Scholar] [CrossRef]
  32. Vezočnik, M.; Juric, M.B. Average step length estimation models’ evaluation using inertial sensors: A review. IEEE Sens. J. 2018, 19, 396–403. [Google Scholar] [CrossRef]
  33. Kang, W.; Han, Y. SmartPDR: Smartphone-based pedestrian dead reckoning for indoor localization. IEEE Sens. J. 2014, 15, 2906–2916. [Google Scholar] [CrossRef]
  34. Ho, N.H.; Truong, P.H.; Jeong, G.M. Step-detection and adaptive step-length estimation for pedestrian dead-reckoning at various walking speeds using a smartphone. Sensors 2016, 16, 1423. [Google Scholar] [CrossRef] [Green Version]
  35. Hu, J.S.; Sun, K.C. A robust orientation estimation algorithm using MARG sensors. IEEE Trans. Instrum. Meas. 2015, 64, 815–822. [Google Scholar]
  36. Wu, J. MARG attitude estimation using gradient-descent linear Kalman filter. IEEE Trans. Autom. Sci. Eng. 2020, 17, 1777–1790. [Google Scholar] [CrossRef]
  37. Gadaleta, M.; Rossi, M. Idnet: Smartphone-based gait recognition with convolutional neural networks. Pattern Recognit. 2018, 74, 25–37. [Google Scholar] [CrossRef] [Green Version]
  38. Hannink, J.; Kautz, T.; Pasluosta, C.F.; Barth, J.; Schülein, S.; Gaßmann, K.G.; Klucken, J.; Eskofier, B.M. Mobile stride length estimation with deep convolutional neural networks. IEEE J. Biomed. Health Inform. 2017, 22, 354–362. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  39. Gu, F.; Khoshelham, K.; Yu, C.; Shang, J. Accurate step length estimation for pedestrian dead reckoning localization using stacked autoencoders. IEEE Trans. Instrum. Meas. 2018, 68, 2705–2713. [Google Scholar] [CrossRef]
  40. Wang, Q.; Luo, H.; Ye, L.; Men, A.; Zhao, F.; Huang, Y.; Ou, C. Personalized stride-length estimation based on active online learning. IEEE Internet Things J. 2020, 7, 4885–4897. [Google Scholar] [CrossRef]
  41. Yan, H.; Shan, Q.; Furukawa, Y. RIDI: Robust IMU double integration. In Proceedings of the the European Conference on Computer Vision (ECCV), Munich, Germany, 8–14 September 2018; pp. 621–636. [Google Scholar]
  42. Chen, C.; Lu, X.; Markham, A.; Trigoni, N. Ionet: Learning to cure the curse of drift in inertial odometry. In Proceedings of the AAAI Conference on Artificial Intelligence, New Orleans, LA, USA, 2–7 February 2018; Volume 32. [Google Scholar]
  43. Zhao, X.; Xiao, Z.; Markham, A.; Trigoni, N.; Ren, Y. Does BTLE measure up against WiFi? A comparison of indoor location performance. In Proceedings of the 20th European Wireless Conference, VDE, Barcelona, Spain, 14–16 May 2014; pp. 1–6. [Google Scholar]
  44. Cantón Paterna, V.; Calveras Auge, A.; Paradells Aspas, J.; Perez Bullones, M.A. A bluetooth low energy indoor positioning system with channel diversity, weighted trilateration and kalman filtering. Sensors 2017, 17, 2927. [Google Scholar] [CrossRef] [Green Version]
  45. Li, G.; Geng, E.; Ye, Z.; Xu, Y.; Lin, J.; Pang, Y. Indoor positioning algorithm based on the improved RSSI distance model. Sensors 2018, 18, 2820. [Google Scholar] [CrossRef] [Green Version]
  46. Szyc, K.; Nikodem, M.; Zdunek, M. Bluetooth low energy indoor localization for large industrial areas and limited infrastructure. Ad Hoc Netw. 2023, 139, 103024. [Google Scholar] [CrossRef]
  47. Alsmadi, L.; Kong, X.; Sandrasegaran, K.; Fang, G. An improved indoor positioning accuracy using filtered RSSI and beacon weight. IEEE Sens. J. 2021, 21, 18205–18213. [Google Scholar] [CrossRef]
  48. Chen, Z.; Zhu, Q.; Soh, Y.C. Smartphone inertial sensor-based indoor localization and tracking with iBeacon corrections. IEEE Trans. Ind. Inform. 2016, 12, 1540–1549. [Google Scholar] [CrossRef]
  49. Zhu, Y.; Luo, X.; Guan, S.; Wang, Z. Indoor positioning method based on WiFi/Bluetooth and PDR fusion positioning. In Proceedings of the 13th International Conference on Advanced Computational Intelligence (ICACI), Chongqing, China, 14–16 May 2021; pp. 233–238. [Google Scholar]
  50. Julier, S.J.; Uhlmann, J.K. Unscented filtering and nonlinear estimation. Proc. IEEE 2004, 92, 401–422. [Google Scholar] [CrossRef] [Green Version]
  51. Weinberg, H. Using the ADXL202 in Pedometer and Personal Navigation Applications; Analog Devices AN-602 Application Note; Analog Devices: Norwood, MA, USA, 2002; Volume 2, pp. 1–6. [Google Scholar]
Figure 1. Architecture of the proposed positioning method.
Figure 1. Architecture of the proposed positioning method.
Applsci 13 04415 g001
Figure 2. The process of heading direction estimation using complementary filter.
Figure 2. The process of heading direction estimation using complementary filter.
Applsci 13 04415 g002
Figure 3. The map of the experimental area, with colored regions indicating different rooms (some have room numbers as shown on the map, while others like toilets and distribution rooms do not have numbers).
Figure 3. The map of the experimental area, with colored regions indicating different rooms (some have room numbers as shown on the map, while others like toilets and distribution rooms do not have numbers).
Applsci 13 04415 g003
Figure 4. The devices used in the experiment and the deployment scenario. (a) The iBeacon tag used in the experiment. (b) The smartphone used in the experiment. (c) The deployment scenario of the iBeacon tags.
Figure 4. The devices used in the experiment and the deployment scenario. (a) The iBeacon tag used in the experiment. (b) The smartphone used in the experiment. (c) The deployment scenario of the iBeacon tags.
Applsci 13 04415 g004
Figure 5. The synthetic acceleration while walking.
Figure 5. The synthetic acceleration while walking.
Applsci 13 04415 g005
Figure 6. The estimated heading direction and the ground truth.
Figure 6. The estimated heading direction and the ground truth.
Applsci 13 04415 g006
Figure 7. The trajectories obtained by different positioning methods and the ground truth.
Figure 7. The trajectories obtained by different positioning methods and the ground truth.
Applsci 13 04415 g007
Figure 8. The average positioning errors of different methods.
Figure 8. The average positioning errors of different methods.
Applsci 13 04415 g008
Figure 9. The CDF of the positioning errors with different methods.
Figure 9. The CDF of the positioning errors with different methods.
Applsci 13 04415 g009
Table 1. Positioning errors of different methods.
Table 1. Positioning errors of different methods.
Positioning MethodsMaximum Error (m)Minimum Error (m)Average Error (m)
PDR positioning2.170.391.78
BLE-based positioning2.050.71.51
Fused positioning1.870.511.35
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

Jin, Z.; Li, Y.; Yang, Z.; Zhang, Y.; Cheng, Z. Real-Time Indoor Positioning Based on BLE Beacons and Pedestrian Dead Reckoning for Smartphones. Appl. Sci. 2023, 13, 4415. https://doi.org/10.3390/app13074415

AMA Style

Jin Z, Li Y, Yang Z, Zhang Y, Cheng Z. Real-Time Indoor Positioning Based on BLE Beacons and Pedestrian Dead Reckoning for Smartphones. Applied Sciences. 2023; 13(7):4415. https://doi.org/10.3390/app13074415

Chicago/Turabian Style

Jin, Zhiang, Yanjun Li, Zhe Yang, Yufan Zhang, and Zhen Cheng. 2023. "Real-Time Indoor Positioning Based on BLE Beacons and Pedestrian Dead Reckoning for Smartphones" Applied Sciences 13, no. 7: 4415. https://doi.org/10.3390/app13074415

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