Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

Indoor Positioning Using BLE iBeacon,

Smartphone Sensors, and Distance-Based


Position Correction Algorithm

Anh Vu-Tuan Trinh, Thai-Mai Thi Dinh, Quoc-Tuan Nguyen


and Kumbesan Sandrasegaran

Abstract In this paper, we propose a Bluetooth Low Energy (BLE) iBeacon-based


localization system, in which we combine two popular positioning methods: Pedes-
trian Dead Reckoning (PDR) and fingerprinting. As we build the system as an appli-
cation running on an iPhone, we choose Kalman filter as the fusion algorithm to
avoid complex computation. In fingerprinting, a multi-direction-database approach
is applied. Finally, in order to reduce the cumulative error of PDR due to smartphone
sensors, we propose an algorithm called “Distance-based Position Correction”. The
aim of this algorithm is to occasionally correct the estimated position by using the
iBeacon nearest to the user. In experiments, our system results in an average error of
only 0.63 m.

Keywords Bluetooth low energy · iBeacon · Indoor localization · Fingerprinting ·


Pedestrian dead reckoning · Kalman filter · Position fusion

1 Introduction

Indoor positioning is the process of obtaining a device or a user’s location in an


indoor setting or environment [1]. In recent years, with the rapid development of
Internet of Things applications, indoor positioning has been widely studied.
Researchers around the world have applied a number of technologies in their
solutions for indoor localization. These include Wi-Fi, Bluetooth Low Energy (BLE),

A. V.-T. Trinh · T.-M. T. Dinh (B) · Q.-T. Nguyen


VNU University of Engineering and Technology, Hanoi, Vietnam
e-mail: dttmai@vnu.edu.vn
A. V.-T. Trinh
e-mail: tuananhtv97@gmail.com
Q.-T. Nguyen
e-mail: tuannq@vnu.edu.vn
K. Sandrasegaran
University of Technology Sydney, Sydney, Australia
e-mail: Kumbesan.Sandrasegaran@uts.edu.au
© Springer Nature Singapore Pte Ltd. 2020 1007
V. K. Solanki et al. (eds.), Intelligent Computing in Engineering,
Advances in Intelligent Systems and Computing 1125,
https://doi.org/10.1007/978-981-15-2780-7_105
1008 A. V.-T. Trinh et al.

Radio Frequency Identification (RFI) Device, or Ultra-Wideband [1, 2]. Out of these
techniques, BLE seems to be a better solution, especially with the introduction of
BLE iBeacon by Apple Inc. in 2013. iBeacon is a small, wireless device that can send
its advertisements to compatible smartphones in its proximity via BLE [3]. A great
number of recent research have focused on the use of beacons, since they are simpler
to deploy, more energy efficient, and low-cost compared to other technologies. Also,
as most of the smartphones on the market now support BLE, an iBeacon-based
indoor positioning system can be built and utilized as a localization app running on
smartphones.
Taking algorithms into consideration, the most popular method in iBeacon-based
indoor positioning is based on Received Signal Strength (RSS). This method can be
divided into two main approaches: trilateration and fingerprinting. The main problem
of RSS-based methods is the instability of the beacons’ RSS due to noises, multipath
fading, non-light-of-sight (NLOS), and other factors caused by the indoor environ-
ment [1, 2]. Another popular algorithm is Pedestrian Dead Reckoning (PDR), which
is based on sensors, such as accelerometers and magnetometers embedded in smart-
phones. The current position of the user can be computed from the sensors’ data.
The problem of PDR is that in a long tracking path, the sensors can drift over time
and lead to a high cumulative error [4, 5].
In order to achieve a more accurate indoor positioning system, recent studies tend
to fuse BLE beacon’s RSS-based methods with PDR. A number of studies [5, 6]
combine them by a particle filter; while others [7–9] use Kalman filter or extended
Kalman filter. In addition, a number of authors [10–12] fuse PDR, iBeacon, and
Wi-Fi fingerprinting.
Hence, there has been a lot of work that chose iBeacon—PDR fusion as the main
approach for indoor positioning. Most of them resulted in quite low positioning errors.
However, the algorithms in those works require complex and heavy computation.
This is not suitable especially if we want to implement the system as an app running
on a smartphone, as the app’s response time can be delayed due to those complex
algorithms. Therefore, the main aim of this paper is to design a fusion-based indoor
positioning system that not only provide fast, accurate real-time positioning services
on smartphones, but also can overcome the ever-present problems of iBeacon and
PDR-based techniques. To avoid heavy computation, we use a Kalman filter instead
of a particle filter, as the fusion algorithm to combine fingerprinting and PDR. In
fingerprinting, we build a multi-direction-database for its online phase, in order to
reduce the effect of NLOS. Also, we proposed an effective and lightweight algorithm
that we call “Distance-based Position Correction” to improve the user’s position
based on the beacon nearest to the user. In experiments, the proposed system is built
into an app running on an iPhone. It results in a low average positioning error of only
0.63 m.
The rest of the paper is structured as follows: Sect. 2 presents an overview and each
component of the system, in which we focus on our main contribution—the Distance-
based Position Correction algorithm. Next, we show the experimental results in
Sect. 3. Finally, Sect. 4 concludes the paper.
Indoor Positioning Using BLE iBeacon, Smartphone Sensors … 1009

2 Proposed System

2.1 System Overview

The diagram of the proposed system is shown in Fig. 1. In order to integrate the system
into an iOS app running on an iPhone, we use two development frameworks provided
by Apple Inc., which are called CoreLocation and CoreMotion. These frameworks
allow us to read data from the beacons and from the smartphone’s embedded sensors
[13–16].
The sensors reading module is responsible for reading the heading direction and
acceleration values, which are provided by the magnetometer and accelerometer of

Fig. 1 Proposed system model


1010 A. V.-T. Trinh et al.

the smartphone. Let It = [xt , yt ]T be the two-dimensional position of the user at time
step t. In our study, the updated time (between t−1 and t) is 1 s. From the sensors’
data, the PDR-based position can be computed as follows:
 
˜It = Iˆt−1 + t cosθt (1)
t sinθt

where t is the user’s step length and θt is the heading direction at time step t. Thus,
in order to calculate the PDR-based position, we need to determine the following
information: the user’s step detection, step length, and heading direction.
For step detection, the acceleration values from the accelerometer are used.
According to Apple Inc., iOS devices’ accelerometers deliver acceleration mea-
surements in each of the three axes [16], as shown in Fig. 2. In the scenario of our
study, the user holds the smartphone on his/her hands so that the back of the phone
is opposite and parallel to the ground. Therefore, the vertical acceleration, a y , i.e.,
the acceleration measurement in the y-axis, is sufficient to detect the user’s step. A
double threshold is then applied for the vertical acceleration as follows:

Fig. 2 Three-axis +Y
accelerometer

-Z

-X

+X

+Z

-Y
Indoor Positioning Using BLE iBeacon, Smartphone Sensors … 1011

Fig. 3 Heading direction in y o


0
Oxy coordinates system

o o
270 90

o
180

O x

Step detected when athreshold_1 ≤ a y ≤ athreshold_2

For step length, we let  equal to a fixed value of 0.6 m. Finally, the user’s heading
direction θ is taken from the device magnetometer, and its value varies from 0 to
360°, as shown in Fig. 3.
As the iBeacon’s RSS value is heavily influenced by the indoor environment,
filtering the RSS values from each iBeacon is necessary. There are a number of
methods to filter the RSS, such as average filter, median filter, and Kalman filter [7].
In this work, we used a simple moving average filter with a window of 6 consecutive
RSS values to avoid heavy computation.
6
RSSk
RSSfiltered = k=0
n
(2)

The filtered RSS values are then used in fingerprinting, which consists of two
phases: offline phase and online phase. In the offline phase, we collect RSS data at
several location points on the indoor area. At each point, data is collected when we
stand in each of the four directions of the coordinates systems: 0, 90, 180, and 270°.
In other words, for a point, there will be four RSS vectors in total. Each RSS vector
includes the RSS values received from every iBeacon when we stand in one of four
directions. This will help reduce the effect of NLOS to iBeacons’ RSS values, as the
user’s body can block the signals from the iBeacons. There are four offline databases
in total, each one corresponds to each of four directions. Then, in the online phase,
based on the heading direction from the sensors reading module, the fingerprinting
module will choose the database corresponding to that heading direction. Finally, the
online RSS vector that the user’s device receives is compared with the vectors in the
chosen database using k-Nearest Neighbor (kNN) to predict the fingerprinting-based
position.
Finally, the sensor-based position and the fingerprinting-based position are fused
using a Kalman filter, which is similar to the works in [7–9].
1012 A. V.-T. Trinh et al.

2.2 Distance-Based Position Correction

The idea of “Distance-based position correction” is to occasionally correct the posi-


tion fused by the Kalman filter by using the iBeacon nearest to the user. This nearest
iBeacon is the iBeacon that has the strongest RSS. Assume that we have a situation as
shown in Fig. 4. The nearest iBeacon
  B, with the location of (xb , yb ). The position
is
estimated by the system is P x p , y p . d is the distance between the user and the
nearest iBeacon, which is computed by the long-distance path loss model:
RSS1m −RSSd
d = 10 10n (3)

in which RSS1m is the RSS of the nearest iBeacon at a reference distance of 1 m,


RSSd is the RSS of that iBeacon at distance d, and n is the path loss exponent—which
equals to 1.99 in our study.
Since d is the distance between the user and the nearest iBeacon, the user’s actual
position should be somewhere in the circle that has the center as the iBeacon—
B(xb , yb ) and theradius of d. In the scenario in Fig. 4, the position estimated by the
system, P x p , y p , is inaccurate and is not in the actual position range. The distance
between the estimated position P and the nearest iBeacon is denoted by d p and is
computed as:
 2  2
dp = x p − xb + y p − yb (4)

If d p > d (as in Fig. 4), the estimated position is considered to be inaccurate


and will be improved by the proposed algorithm.  The
 algorithm will now move
the estimated position from the inaccurate P x p , y p to a much better estimation
which is C(xc , yc ). C(xc , yc ) is the intersection of the circle that has the center as the
nearest iBeacon—B(xb , yb ) and the line connecting the iBeacon and the inaccurate

Fig. 4 Distance-based
position correction scenario
Indoor Positioning Using BLE iBeacon, Smartphone Sensors … 1013

estimated position—BP. Because C is much closer to the actual position range, it


will be a better estimation compared to P.
Since we already know the coordinates of the nearest iBeacon B(xb , yb ), the
inaccurate estimated position P x p , y p , and the distances d and d p , the improved
estimation C(xc , yc ) can be easily computed:

d 2 −(d p −d ) −(xb2 +yb2 )+(x 2p +y 2p )−2( y p −yb )b


2

xc = 2(x p −xb +ay p −ayb )


(5)

yc = axc + b (6)

With:
yb −y p
a= xb −x p (7)

yb −y p
b = yp − xb −x p
xp (8)

In addition, to ensure that the RSS value from the nearest iBeacon is stable and
reliable, the proposed algorithm will only be used when the distance d between the
user and that iBeacon is computed to be lower than 3 m, and when the user stands
still in a short amount of time (m seconds for example).

3 Experimental Results

To evaluate the performance of the proposed system, we built an indoor positioning


app running on an iPhone 5C. The experiments are conducted in an indoor area of
30 m × 11 m. Table 1 summarizes the equipment information. The position of the
iBeacons in the area are shown in Fig. 5, in which the red dots indicate the iBeacons.
All the iBeacons are configured with the same parameters shown in Table 1. As the
user walks around the area, the app tracks and records the user’s position. We did

Table 1 Equipment parameter


User device iPhone 5C
Wireless interface BLE v4.2/2.4 GHz
Operating system iOS 10.3.3
iBeacons 8 Estimote iBeacons
iBeacon’s broadcasting range 50 m
iBeacon’s advertising interval 100 ms
iBeacon’s broadcasting power 0 dBm
1014 A. V.-T. Trinh et al.

Fig. 5 Experiment set-up

Fig. 6 Experimental results: a Simple walking path, b complex walking path

the experiment in two cases, one with the proposed system that has the Distance-
based Position Correction algorithm, and another when the system does not have
the algorithm. The results collected from two different walking paths are shown in
Fig. 6.
In Fig. 6, the orange line indicates the true path, the blue line is the tracked path
with correction algorithm, and the gray line is the tracked path without it. In the
case of a simple walking path (Fig. 6a), without the correction algorithm, the system
performance results in a very high error of up to 5.49 m, with an average error of
1.99 m. This is due to the drift of PDR and mostly due to the instability of iBeacon
signals. However, with the correction algorithm, the performance is significantly
improved. The maximum error is reduced to 2.49 m, and the average error is only
0.63 m. In addition, the system also runs and responds well on the iPhone 5C.
With a more complex walking path (Fig. 6b), the results are similar. Without the
correction module, the maximum error is 5.03 m and the average error is 2.25 m. The
performance is again improved with the proposed algorithm, with the maximum and
average errors of 3.05 m and 0.90 m, respectively. A summary of our experimental
results including maximum error, average error, variance (VAR), and Mean Squared
Error (MSE) is given in Table 2.
Indoor Positioning Using BLE iBeacon, Smartphone Sensors … 1015

Table 2 Summary of experimental results


Max. error (m) Avg. error (m) VAR MSE
Simple path Without correction 5.49 1.99 2.02 5.99
With correction 2.49 0.63 0.26 0.66
Complex path Without correction 5.03 2.25 1.32 6.41
With correction 3.05 0.90 0.47 1.28

4 Conclusion

In this paper, we have introduced an iBeacon-based indoor positioning system that


fuses PDR and fingerprinting. In order to avoid complex and heavy computation,
we use a Kalman filter as the fusion algorithm and make use of the data provided
by the iOS development frameworks. In addition, we proposed a lightweight algo-
rithm called Distance-based Position Correction, which has shown its performance
improvements in the experiments. We also make a positioning app to test the system
performance. The app runs well on an iPhone with a low average error of 0.63 m for
simple paths.

Acknowledgements This work has been supported by Vietnam National University, Hanoi (VNU),
under Project No. QG.19.25.

References

1. Zafari F, Gkelias A, Leung K. A survey of indoor localization systems and technologies.


Available http://arxiv.org/abs/1709.01015v2
2. Al-Ammar MA et al (2014) Comparative survey of indoor positioning technologies, techniques,
and algorithms. In: 2014 International conference on cyberworlds, Santander, pp 245–252
3. Silicon Labs. Developing beacons with bluetooth low energy (BLE) technology. Avail-
able https://www.silabs.com/products/wireless/bluetooth/developingbeacons-with-bluetooth-
low-energy-ble-technology
4. Chen Z, Zou H, Jiang H, Zhu Q, Soh YC, Xie L (2015) Fusion of WiFi, smartphone sensors
and landmarks using the Kalman filter for indoor localization. Sensors 15:715–732
5. Chen Z, Zhu Q, Jiang H, Soh YC (2015) Indoor localization using smartphone sensors and
iBeacons. In: 2015 IEEE 10th conference on industrial electronics and applications (ICIEA),
Auckland, pp 1723–1728
6. Chandel V, Ahmed N, Arora S, Ghose A (2016) InLoc: an end-to-end robust indoor localization
and routing solution using mobile phones and BLE beacons. In: 2016 International conference
on indoor positioning and indoor navigation (IPIN), Alcala de Henares, pp 1–8
7. Robesaat J, Zhang P, Abdelaal M, Theel O (2017) An improved BLE indoor localization with
Kalman-based fusion: an experimental study. Sensors 17(5)
8. Lee S, Cho B, Koo B, Ryu S, Choi J, Kim S (2015) Kalman filter-based indoor position track-
ing with self-calibration for RSS variation mitigation. In: International Journal of Distributed
Sensor Networks—Special issue on Location-Related Challenges and Strategies in Wireless
Sensor Networks, vol 2015
1016 A. V.-T. Trinh et al.

9. Chen Z, Zhu Q, Soh YC (2016) Smartphone inertial sensor-based indoor localization and
tracking with iBeacon corrections. IEEE Trans Industr Inf 12(4):1540–1549
10. Sung K, Lee DK, Kim H (2018) Indoor pedestrian localization using iBeacon and improved
Kalman filter. Sensors 18(6)
11. Zou H, Chen Z, Jiang H, Xie L, Spanos C (2017) Accurate indoor localization and tracking
using mobile phone inertial sensors, WiFi and iBeacon. In: 2017 IEEE international symposium
on inertial sensors and systems (INERTIAL), Kauai, HI, pp 1–4
12. Chen J, Zhang Y, Xue W (2018) Unsupervised indoor localization based on smartphone sensors,
iBeacon and Wi-Fi. Sensors 18(5)
13. Apple, Getting Started with iBeacon. Available https://developer.apple.com/ibeacon/Getting-
Started-with-iBeacon.pdf
14. Zafari F, Papapanagiotou I (2015) Enhancing iBeacon based microLocation with particle fil-
tering. In: 2015 IEEE global communication conference (GLOBECOM), San Diego, CA, pp
1–7
15. CoreLocation. Retrieved https://developer.apple.com/documentation/corelocation
16. CoreMotion. Retrieved https://developer.apple.com/documentation/coremotion

You might also like