You are on page 1of 5

2016 International Conference on Internet of Things and Applications (IOTA)

Maharashtra Institute of Technology, Pune, India 22 Jan - 24 Jan, 2016

Indoor Positioning System Using Euclidean


Distance Correction Algorithm with Bluetooth Low
Energy Beacon

Yankai Wang1, Qingyu Yang2, Guangrui Zhang3, Peng Zhang4


International school
Beijing University of Posts and Telecommunications
Beijing, China
1
) wyk1029@126.com, 2) 2809787538@qq.com, 3) yqy9449@126.com, 4) ericbjsdfz@hotmail.com

Abstract— Recently, indoor Location Based Service(LBS) has


been a hot business model but "the last mile" problem is a II. SYSTEM COMPONENT6
critical issue when deploying this service, while Bluetooth Low The whole system consists of three components: cloud
Energy (BLE) technology is a solution. In this paper we propose a server, smart phone APP and Bluetooth beacons.
Euclidean distance correction algorithm improved from k-
Nearest Neighbor algorithm and position calculation method, A. Cloud Server
then use it in Bluetooth positioning. We also give the positioning
procedure and the system construction in detail, including
The cloud server records data and calculates the position
deploying massive Bluetooth beacons in vast indoor area, using using an algorithm which will be introduced later.
smart phone and cloud server to collect and calculate Bluetooth B. Smart Phone APP
data respectively, and presenting results on a smart phone. We
have tested it in two scenes using several methods, and field test Smart phone collects Received Signal Strength (RSS) data
results show that we have got a relatively accurate result (1.58 for the system, and then uploads it to cloud server to do
meters), which indicates a practical solution to “the last mile” positioning and navigation. To be compatible with BLE
problem. And such solution can be used in the real situation, with protocol, the smart phone must be equipped with Bluetooth 4.0
the advantages of low cost and high durability. adaptor. For Android phones, the API level should be no lower
than 18, which means the operation system (OS) version has to
Keywords— Indoor positioning, Bluetooth Low Energy, be no lower than Android 4.3. For iPhones, the hardware
Received signal strength
version should be no lower than iPhone 4s, and OS version
I. INTRODUCTION should be no lower than iOS 7.
Study on indoor positioning has been popular since the last C. Bluetooth Beacon
decades and people have developed various methods in In our system we use nodes manufactured by April Brother
positioning such as Wi-Fi [1-2], RFID [3-4], and so on. But [5], which use Texas Instruments cc2540 chip solution. It
two methods have unavoidable disadvantages. Wi-Fi is presents that the RSS fade dramatically while distance
restricted by the environment and power supply, while RFID is increases from 1 to 5 m. Due to our experiment, the decrement
restricted for the user may need special equipment to realize of RSS turns slow after the distance is longer than 10 m, at the
positioning. Bluetooth low energy (BLE) is a high potential distance of 25 m, the signal will stay around -99 dBm. BLE
new technology with low energy consumption and low cost. uses 3 channels, each bandwidth is 2MHz [6]. The composition
Using a button battery, a Bluetooth beacon can stay active from of BLE beacon is shown below, the green one is circuit board,
six months up to two years depending on the frequency and its
own power usage. What’s more, it can keep the signal power in
a relatively stable level which is important for indoor
positioning. The cost of Bluetooth beacon with one button
battery is less than ten dollars. With such reasonable cost, it
could cover from 25 square meters to 100 square meters, which
also depends on its signal power. The signal power can be
flexibly chosen from -23dBm to 4dBm [5]. Bluetooth beacons
help people to easily set up a network which suits for indoor
positioning. A new method for indoor positioning is proposed
in our paper, which can be applied in real environment.
Fig. 1.Composition of Bluetooth beacon.
The authors would like to acknowledge the technical and financial
support of the project sponsors, Beijing University of Posts and
Telecommunications, innovation committee.

978-1-5090-0044-9/16/$31.00 ©2016 IEEE 243


the sliver one is battery and the black things are the shield of database and server cooperate cohesively.
the Bluetooth beacon.
IV. ALGORITHM LOGIC
III. SITE LAYOUT AND POSITIONING PROCEDURE A Euclidean distance correction (ECKP) algorithm
The BLE beacons are uniformly placed so that users can developed from KNN (K-Nearest Nodes) algorithm and
receive good quality signal at most places. The testing area is Position calculation method is used in this system in order to
divided into small blocks by horizontal and vertical lines. And fit the real situation. This is mainly due to the fact that though
each line is X (depending on the needs) meters away from the the average signal strength is relatively stable in a long term,
next. its signal strength is unstable in short term which fluctuates
from -1dBm to -10dBm during sampling interval. This could
Firstly, at each cross point, signal strength is scanned Z be seen in Fig.4 as we have collected a beacons RSS for 50
times to offset the noise caused by the signal fluctuation of seconds. To address this problem, the smart phone will collect
Bluetooth beacons, moving obstacles and irrelevant data in a long term during offline data sampling and
electromagnetic waves spanning around 2.4 GHz. Then, we positioning, then the server will calculate the average of RSS
select N (depending on need and environment) Bluetooth data under each MAC address.
beacons, which have stronger average signal strength than
others. And their average signal strength and mac address will We once considered using trilateration algorithm, which is
be saved into one row in form of N attributes. an approach for tracking mobile objects [7-8]. However, with
too many obstacles in the environment, trilateration algorithm
During positioning, user scans the signal M times is not as accurate as fingerprint. So we finally choose
(depending on the needs), which is also used to offset noise. fingerprint algorithm and improve it [9-11].
The smart phone will upload raw data to sever. Sever will
handle the data, and then compare it with the signal data stored The server calculates the Euclidean distance of the RSS
in database row by row. After the comparison, server will data uploaded by smart phone and data stored in the database,
choose three rows that are most likely to smart phone uploaded which is used to store signal strength information. A row of
data. Calculated position from these rows will be the smart data in the database consists of N groups of mac address of
phone’s position. Bluetooth beacons and its related RSS data. And there are
many rows of data in the database. When RSS data is
Finally, the phone will get the position information and uploaded from smart phone, the server compares it with first
present it on the screen. During the procedure, smart phone, row in the database, and matches the attributes that have the
same mac address, then analyzes the similarity of these two
rows of data. In the end all rows in the database will be
compared with the uploaded data. The position information of
the three rows that has the smallest Euclidean distance will be
calculated and its position will be user’s current position. The
formula is as following:

³
N 2
M i  mi
d M ,m, N
i 1
(1)
N
M and m represents the signal strength stored in the
database and uploaded by the smart phone respectively. i
represents the sequence number of matching groups.
Fig. 2. system structure We also face two significant problems when we implement
algorithm above during the test. First, we place Bluetooth
beacons every 5 meters in large area. The testing shows that
smart phone can receive signals from Bluetooth beacon for 25
meters at most, but most Bluetooth beacons’ signal strength

Fig. 3. The diagrammatic sketch of the whole procedure

Fig. 4. signal strength fluctuation with time

244
received by smart phone fluctuates slightly between -99dBm to deploying 9 beacons, which is illustrated in the Fig.4. The
-101dBm if they are over 10 meters away from the smart scene B is an indoor room that is 44 meters long and 22 meters
phone. For it doesn’t fluctuate much, it would be valueless to wide, which is illustrated in the Fig.5. Considering the
store it in database. Aiming at this problem, we stipulate that performance of Bluetooth beacon and the need of accuracy, 34
the database can save up to ten groups of attributes and the Bluetooth beacons is a must. Adding more beacons makes no
smart phone is also only allowed to upload ten groups. obvious difference. In both scenes each Bluetooth beacon is 5
However, this leads to the second problem. If the data uploaded meters away from the neighboring one. In some areas of scene
by smart phone at the position A matches a row of data with B, the distance is a little bit longer or shorter due to the
few attributes, and the signal strength from both sides of those environment limitation. In both scenes the power of Bluetooth
matched attributes are between -99dBm and -101dBm, then the beacon is adjusted to 4dBm, and refreshing rate is 10/3 Hz. In
average Euclidean distance will be lowered dramatically, the Fig.4 and Fig.5, the green rectangle represents Bluetooth
server will take the position information stored in this row for beacon.
smart phone’s current position, resulting in that the smart
phone’s actual position deviates far from the calculated one. B. Offline Data Collection
During the test, we find that for same smart phones, when
To solve this problem, when server calculates Euclidean they start scanning, some beacons may not be scanned at the
distance of a row of data in database with smart phone’s beginning, only after scanning several times hidden Bluetooth
uploaded data, we add an extra parameter of 1024 to Euclidean beacons will appear, faster refreshing rate will take it longer
distance when every time the MAC address of a beacon time to show all the available beacons. Under same refreshing
uploaded by smart phone can’t match this row, meaning that rate, due to different types of Bluetooth adaptors, some phones
the Bluetooth beacon can’t be matched is very far from smart may scan five to six times to find all of them. Taking both
phone’s actual position. So the ECKP algorithm is as accuracy and efficiency into consideration, phone used in this
following: test scans 15 seconds with 2 Hz refreshing rate.

³ In scene A, each sampling position in 2 meters away from


N
d M ,m, N M i  m i  1 0  N u 1 0 2 4 ()
i 1 each other, we collect RSS data 30 times at every sampling
position twice during an interval of 8 hours, and save the RSS
After testing, we find that 1024 is the number suitable for -
this situation. It is 1024 because the valuable RSS mostly range
from -60dBm to -70dBm, RSS above -90dBm would be
considered valueless, for it’s insensitive to the distance change.
We select a typical difference between the valuable and
valueless RSS, which is 32, the square of it is 1024. With
smaller parameter, the system may choose a row of record that
is far from the phone as the correction parameter’s wright is too
small, with larger parameter, the system will be inclined to
select a row that matches the most attributes regardless of the
RSS difference between records and the data smart phone
collects.
When we get d(M,m,N), we will choose three positions that
have the smallest d(M,m,N), and returned position will be:

3a x  2bx  c
x (3)
6 Fig. 5. Scene A

3a y  2by  c y
y (4)
6

Where a is the row that has the smallest d(M,m,N), b is the


second lowest, c is the third. In this way we could minimize
the positioning error, and calculate a position that is nearer to
the smart phone.
V. FIELD TEST PROCEDURE AND RESULTS
A. System Deployment
We choose two scenes to verify ECKP algorithm. The
scene A is an outdoor place that is 10 x 10 meters square

Fig. 6. Scene B

245
data into database A and B respectively. In scene B, as shown position, using duplicated data is likely to choose two rows
in Fig.5, is divided into small square blocks with 1 square that are sampled at the same sampling position and is the
meter area, and we merge four blocks into one. The RSS data is nearest to smart phone.
collected in the center of each block using method used in
scene A, and RSS data will be saved into database C and D VI. CONCLUSIONS AND FUTURE WORK
respectively. Depending on researches we have done, we can get
C. Positioning Data Collection conclusions as follows:
8 hours after the last offline data sampling, we walk 1. The original algorithm works well in small area for
randomly to position one hundred times in the scene A and B there are only several beacons and they can all be
respectively. After positioning, all the raw data will be scanned and stored in database, while in wide area,
uploaded to the server and saved. when not all the beacons can be stored in database and
received by smart phone, original algorithm does not
D. Data Processing work well.
After saving the testing data into server, we test 2. ECKP algorithm does have a better performance in
positioning performance in several ways. firstly we use the wide area with a large amount of Bluetooth beacons
testing data in scene A, offline RSS data from both databases comparing to the normal algorithm.
A and B only with original algorithm, then record the result in
the name of series 1 and the result is shown in the TABLE ĉ. 3. When using two databases, the positioning
Then we use testing data in scene B, offline data in database C performance improves comparing to using one.
to test positioning performance with original and ECKP 4. This system could be used in several scenes that
algorithm, after that we use testing data in scene B, RSS data - require relatively high accuracy. In the future, with the
in database C and D only with ECKP algorithm. Those results development of deploying methods, the cost of
are shown in TABLE Ċ, in order of series 2, 3 and 4. deploying system will be lower.

E. Results Analysis After testing, we find that valuable and valueless Bluetooth
beacons also varied in several degrees, fixed parameter may
From the results above, we can see that in the scene A,
not be as useful as a dynamic one. Developing an algorithm in
there are only 9 Bluetooth beacons available, we don’t need to
the future using dynamic parameter may perform better. Also,
consider the two problems mentioned above, for rows in the
in this test we use the average to deal with the white noise
database can save all the Bluetooth beacons’ information, the
when collecting offline RSS data and positioning, but use
average error is 0.64 m, reaching our expectation comparing
Kalman filter method will help improve the accuracy, we have
with these two [10-11], this reveals that testing system works
done the test but not in a systematical way, so the result is not
well, so the testing result in scene B should also be reliable.
shown in this paper.
While in scene B, when using original algorithm, since its
deviation is above 10 meters, ECKP algorithm has a REFERENCES
significant improvement in the accuracy under same situation, [1] P. Bahl and V. N. Padmanabhan. RADAR: An in-building RF-based
with average error of 1.83 meters, combined use of databases user location and tracking system. In Proc. INFOCOM, pp. 775–784,
C and D decrease the positioning error to 1.58 meters. With 2000.
duplicated offline data, the positioning performance improves [2] Z. Xiang, S. Song, J. Chen, H. Wang, J. Huang, and X. Gao. Awireless
in some degree as we will choose three rows to calculate - LAN-based indoor positioning technology. IBM J. Res. Dev.,
48(5/6):617–626, 2004.
[3] G.-Y. Jin, X.-Y. Lu, and M.-S. Park. An indoor localization mechanism
using active rfid tag. In Proc. SUTC (1), pp. 40–43, 2006.
TABLE I. RESULTS IN SCENE A
[4] L. Ni, Y. Liu, Y. Lau, and A. Patil. LANDMARC: Indoor location
Error Above 10 sensing using active rfid. Wireless Networks, 10(6):701–710, 2004.
0-2m 2-5m 5 - 10 m [5] April Beacon, at the product column, Aprilbeacon 242, introduction
Series m http://www.aprbrother.com/
[6] Ramsey Faragher, Robert Harle. Location Fingerprinting with Bluetooth
Series 1 97 3 0 0 Low Energy Beacons. DOI 10.1109/JSAC, 2015
[7] S. Pandey, P. Agrawa, "A Survey on localization techniques for wireless
TABLE II. RESULTS IN SCENE B network", Journal of the Chinese Institue of Engineers, vol. 29, no. 7,
pp.1125-1148, 2006
Error Above 10 [8] F. Subhan, H. Hasbullah, "Designing of Roaming Protocol for Bluetooth
0-2m 2-5m 5 - 10 m Equipped Multi Agent Systems", Lecture Notes in Computer Science,
Series m vol. 5857, pp.759-769,2009
[9] Fazli Subhan, Halabi Hasbullah, Azat Rozyyev, Sheikh Tahir, “Indoor
Series 2 3 9 34 54 Positioning in Bluetooth Networks using Fingerprinting and Lateration
approach”, International Conference on Information Science and
Series 3 78 8 6 8 Applications (ICISA), IEEE, Jeju Island, 26-29 April 2011, pp. 1-9.
Series 4 87 7 0 6 [10] Chen Guoping, Ma Yaohui, Zhang Baike, “Bluetooth indoor positioning
based on fingerprinting technology”, Application of Electronic
Technique,vol.39, no.3, pp.104-107, 2013

246
[11] MO Qian, XIONG Shuo, “Close Degree Classification of Indoor Metrology and Measurement, vol. 34, no. 6, pp.66-70, 2014
Positioning Algorithm Based on Bluetooth 4. 0”, Journal of Astronautic

247

You might also like