Smartphone indoor positioning based on enhanced BLE beacon multi-lateration

In this paper, we introduce a smartphone indoor positioning method using bluetooth low energy (BLE) beacon multilateration. At first, based on signal strength analysis, we construct a distance calculation model for BLE beacons. Then, with the aims to improve positioning accuracy, we propose an improved lateral method (range-based method) which is applied for 4 nearby beacons. The method is intended to design a real-time system for some services such as emergency assistance, personal localization and tracking, location-based advertising and marketing, etc. Experimental results show that the proposed method achieves high accuracy when compared with the state of the art lateral methods such as geometry-based (conventional trilateration), least square estimation-based (LSE-based) and weighted LSE-based.

INTRODUCTION Nowadays, in large cities, human activities tend to shift from outdoor to indoor environments. This has led to a growing need for services related to the indoor environment, such as location-based services (LBSs) and social networking services (SNSs). Location accuracy is a measure of service quality. GPS has done this well for outdoor environments. However, due to the obstruction of building materials, GPS signals can not work well in indoor environments. Therefore, many technologies are utilized to deploy indoor positioning systems (IPS) such as WiFi [1,2], radio frequency identification (RFID) [3], Zigbee [4], ultra-wideband (UWB) [5] and camera-based (photo-based) [6]. To overcome the limitations of previous technologies, a bluetooth low energy (BLE) based technology called iBeacon was introduced as an appropriate solution for IPS requirements due to the advantages such as low energy consumption, wide-coverage, easy deployment, and potential high accuracy. We can use iBeacon technology to build an indoor positioning system that uses received signal strength (RSS) to estimate user location. There are two kinds of received signal strength index (RSSI) based technique: fingerprinting [7] and range-based method [8] (as known as lateral or lateration method). In the localization problem, the range-based method utilizes an estimated distance from the path-loss model to estimate the user's position. Meanwhile, Fingerprinting relies on map survey steps to build an radio signal strength (RSS) database of an interested area. Then, the position decision is made based on online signals and offline database using a matching algorithm. Some recent studies have chosen fingerprint as the main approach [9][10][11][12]. Others choose  Ì  ISSN: 1693-6930 range-based as their main approach [13][14][15].
Looking at the number of current research, we can see that fingerprinting seems to be more popular than range-based methods. However, to achieve high accuracy, the fingerprinting method requires data collection for many reference points. This task takes much time and is unfeasible to practical implementation. In deployment, it seems fair to say that range-based methods are more feasible than fingerprinting. Range-based methods can help implement an indoor positioning system without additional requirements such as map survey or rebuild the database. However, range-methods have their disadvantages as well. Their problem is distance estimation, which directly affects the accuracy of the estimated position. Theoretically, we all know the distance varies according to the logarithmic function. But, it is not easy to calculate the distance correctly due to the effects of fading, small-scale, and human absorption.
To cope with this problem, we propose an improved method for a range-based method applied to BLE signals and indoor environments. We consider that, at a certain RSS level, the estimation of the distance between the phone and the BLE beacon is relatively accurate. So, such beacons are called reliable beacons. Therefore, we obtain some reliable circles with the center of the reliable beacons and the radius of the estimated distance from the mobile device. Then the returned position must be in such circles. Intervention by geometric method, we move the estimated position of conventional trilateration to a position that belongs to the circles. In order to get higher accuracy, we exploit the information of a large number of beacons. In this study, we applied the proposed method for four beacons simultaneously. Each cluster of three beacons will estimate the phone's position based on Trilateration combined with reliable circles. Then the final position will be determined by the average of possible positions. Experiments were carried out in the real world, and the results showed that the proposed method outperformed existing conventional methods.
In the next part, the Trilateration method and its encountered problem, are briefly presented in section 2. Section 3 describes our proposed method, including an improved geometry-based method for Trilateration and multiple BLE beacon usage. Section 4 provides system parameters and experimental results. Ultimately, section 5 concludes this paper.

RESEARCH METHOD 2.1. Trilateration
In the global positioning system, trilateration [16,17] (short for conventional trilateration) is a traditional method for determining the location of receiver equipment on earth. The position of the object can be obtained by calculating the distance from the satellites. We can exploit this concept for indoor localization by scaling down the trilateration concept used for global positioning system (GPS). In our study, trilateration, as illustrated in Figure 1, is defined as a method to obtain the position of an object or people under the influence of the indoor environment based on RSS information of three beacons. Received signal strengths from these beacons are calculated via the following formula [18]: whereas, Γ (d) and Γ (d 0 ) are RSSIs at Euclidean distance d and reference distance d 0 , respectively (in dBm). d 0 is usually chosen equal to one meter for the indoor environment and η represents the path loss exponent. The distance from the smart phone to the i-th beacon can be expressed as: In order to calculate the smart phone position, the coordinates of BLE beacons on the map must be known in advance. Assume that (x i , y i ) is the coordinates of ith beacon on the map. The equation for each beacon region is represented by (z = 0): (3) is equivalent to: i , then (4) is rewritten as: The position of a tracked object can be estimated by:

Distance estimation
Distance estimation plays a vital role in internet of things (IoT) applications. In this study, the accuracy of distance estimation has a high impact on reckoning trilateration position. The more accurate the conversion from RSSI to distance is, the more precise trilateration's estimated position is. Unfortunately, for BLE signals, it is not easy to calculate true distance through the log-distance path loss model. Many factors affect the BLE signal in the indoor environment, such as the material of indoor structures, body-blocking. Intending to construct a real-time indoor positioning system, we consider humans' presence as a high-impact factor. The human body consists of 70% water; therefore, this is a strong attenuation factor at a frequency of 2.4 GHz. The attenuation of the BLE signal caused by humans body (in dBm) is estimated by [19,20]: where w and n are body weight and number of detected person in the area. As shown in Figure 2, we can see a significant difference when the phone is blocked by the user body. Thus, use (2) with a fixed η to estimate the distance no longer matches the BLE signal.
To look closely at the problem, we conducted some experiments to analyze the RSSI attenuation of the BLE signal in 2 cases: line-of-sight (LOS) and non-LOS (NLOS) (body-blocking). Figure 3 shows that whenever we receive the signal that has an RSS value larger than -70 dBm, we can use LOS curve line confidently to calculate the distance from the smartphone to the beacon. For our empirical data, LOS curve line is represented by a logarithmic trendline [21], i.e.: where, Γ is RSSI at distance d.

RSSI filtering
As precise distance estimation results in proper Trilateration localization, it would be better to use some RSS filtration. For RSS, noise is often known for short-term fading [22], which is caused by surrounding pedestrians. RSS can fluctuate sharply in a short period. To reduce its impact, we apply Kalman filter [23] for RSS model: herein, we consider there is no noise in the process and v k denotes measurement noise of RSS observation z k which is introduced as pedestrian's movement. The detailed process of the Kalman filter algorithm is shown in Algorithm 1.
ENHANCED BLE BEACON MULTI-LATERATION 3.1. Enhanced trilateration for BLE signal Based on the above signal analysis, whenever the signal strength received from the beacon is higher than -70 dBm, the relative position of the phone to the beacon is likely to be LOS. For simplicity, we call the beacon that satisfies the condition with the RSSI returned on the phone higher than -70 dBm as rLOS beacon and is denoted by B . (abbreviation for reliable LOS beacon). Then, the estimated distance of rLOS beacon from (9) is considered the most reliable. Moreover, the position is estimated by trilateration completely depends on the radius of three circles. In theory, if the distance from the beacons to the smartphone is absolutely correct, the position returned from trilateration must be the intersection of the three circles. Let B . be the coordinates of rLOS beacon, T be the coordinates returned by trilateration and P is the position calculated by the proposed method. Case 1: There is no presence of rLOS beacon. In this case, there will not be any improvement, we simply apply (6), (7) to estimate the user position. Case 2: Only one rLOS beacon is available. Since there is only one rLOS beacon, that means we have only one trusted circle in total of three, called rLOS circle. Therefore, the estimated Trilateration-based position should be returned on this circle. Then, P is defined as the intersection of infinite line ← → B . T and a rLOS circle which has radius of d . , centered at B . and is denoted by (B . ; d . ). Figure 4 is the visual view of the proposed method. P must satisfy the following conditions:   Figure 5 illustrates how we estimate the user position. In this case, P must satisfy the following conditions: In addition, we consider the case of two rLOS circle does not intersect as a case is described in Figure 4 where the position is decided by a smaller rLOS circle. Because iBeacon is uniformly distributed, the smartphone rarely gets the RSS above -70 dBm simultaneously from three different beacons due to the body's obstruction; therefore, there is no Case 4 for three rLOS beacons.

Multi BLE iBeacon lateration
For achieving high accuracy, we use information from four beacons simultaneously. Accordingly, when applying Trilateration for four beacons, we have C(4, 3) ways to choose a cluster of three beacons from a set of four ones where commutation is not allowed. In detail, at first, we collect signals from all beacons on the map. Then arrange them in an array of four components: in which, B i represents ith beacon object in descending order of RSSI. In programming, B i is a tuple, which is represented in the form: where, (x i , y i ) is the coordinates in two dimensions space, Γ i and d i are RSSI and distance from the smartphone to that beacon, respectively. Let T (·) be the conventional Trilateration function and P(·) be the function used to estimate the position according to the proposed method. If we have two rLOS beacons, four possible positions are calculated by: In case we only have a rLOS beacon (B 1 is the rLOS beacon object), four possible positions are calculated by: In the absence of any rLOS beacon, the entire P(·) function in (15) is replaced by the T (·) function. The final position is estimated by: for Case 1, Case 3 3P1+3P2+3P3+P4 10 for Case 2 (16) Herein, the P(·) function is considered to be more reliable than the T (·) function. Hence, the position that returned by the P(·) function should be assigned with a higher weight. It is also possible if we use Trilateration for a larger number of beacons. For example, with five beacons, we have to calculate C(5, 3) = 10 operations instead of C(4, 3) = 4. However, this increases the computational cost. Besides, it requires a bigger number of beacons, which leads to an increase in deployment costs. Therefore, choosing to use the four beacons is reasonable.

EVALUATION 4.1. Experiment setup
The experiment was executed on the 1st floor of G2 building, University of Engineering and Technology, VNU. The testbed is typically open with some decorative trees, twos big columns, and occasionally has the TELKOMNIKA Telecommun Comput El Control, Vol. 19 appearance of pedestrians. We deploy four beacons in an area of 90 m 2 , and the shortest distance between two beacons is 6 meters. The layout of the floor plan and the interested area are shown in Figure 6. Beacons are set according to the strategy outlined in [24] at the height of 150 cm (equivalent to the height of user equipment) with the same technical configuration. Detailed specifications of the system are given in Table 1. The phone is held close to the body and in a parallel position to the horizontal plane. The proposed method is designed for discrete positioning and applied to execute multiple measurements. We wrote a measurement software with the help of several available frameworks, i.e: CoreLocation [25], CoreGraphic [26]. The collected data is sent via email and we then use it to plot the figures using MATLAB.  Firstly, we want to evaluate the accuracy in estimating the distance from the beacon to the user device. As mentioned above, the distance estimation strategy is applied to two different RSSI ranges. If RSSI is higher than -70 dBm, the (9) will be used. In contrast, if RSSI is less than or equal to -70 dBm, the distance is calculated by the average between LOS and NLOS. We measure RSS value at different distances and directions that change from 1 to 10 m. Each position is 1 m apart, and we collect 100 RSSI samples for each one. The result, including the average estimated distance and variance, are given in Table 2. As the results are shown in Table 2, at distances of 1 m, 2 m, and 3 m, the estimated distances are entirely accurate. The cause of this result is, at those distances, the RSS level is almost higher than -70 dBm, then the distance is estimated by (9). Since the equation for (9) changes slowly in this RSSI range, the variance is not too much. For distances greater than 3 m, the RSS varies considerably between LOS and NLOS and is usually less than -70 dBm. Thus, the distance is estimated by the average model. Consequently, the errors, as well as the variance in these cases, are high.  Figure 7, the red line represents nature RSS at a distance of 2.5 m under LOS condition, and the blue line represents filtered RSS using the Kalman filter. At some time steps, the red line sharply attenuated due to the presence of pedestrians. We easily see the Kalman filter somewhat reduced the impact of the RSS fluctuations in the blue line. Figure 8

Overall performance
The proposed method is verified via the experiment to see how effective it is. Distance errors are used to evaluate the accuracy of the system. We define location error e as the distance between the estimated position (x est , y est ) and the actual position (x, y), i.e: We choose three other methods to compare with proposed method, i.e: conventional trilateration, least square estimation and weighted least squares estimation [27]. Table 3 specifies the parameters used in the experiments.  Figure 6) at 80 different points on the map. Error distribution is shown in Figure 9. We can recognize that errors of positions that lie in the parallelogram of four beacons are lower than others that lie outside this region. The average error in this area is about 1.7 m. Especially, the positions with coordinates (8.4; 11.2), (14; 11.2), (11; 8) and (15.6, 18) have negligible errors. The reason for this result is that these positions are located in front of beacons where the distance is very close. Consequently, when the user stands at these points, the estimated position will be treated with another policy, as described in section 3.1. In contrast, edge areas have poor accuracy because phones and iBeacon are often under an unreliable situation. At both ends of the experiment area, the error may reach more than 4 m.  Figure 10 describes the accuracy of the algorithms in four directions at a fixed position, say, (14; 9.6). When the heading of the user's device is the North, since none of the beacon was discovered is under rLOS condition, the accuracy of the proposed method is not much better than the other algorithms. When users point their phone towards the East, South, or West, a beacon at the coordinate of (14; 11.6) is detected as a reliable beacon. As a result, our proposed method shows a marked improvement when compared to other methods. c. Overall accuracy comparison Figure 11 depicts the accumulative error of four approaches. As we can see, our proposed method has the best performance in total of four. The average error of the method is 1.9 m. Our proposed method helps increase the accuracy of indoor positioning by 35.15% over the conventional trilateration method, 23.22% over the least square method, and 15.55% over weighted least square method.

CONCLUSION
In this paper, we introduced a plain and robust method to improve the accuracy of the trilaterationbased indoor positioning system using BLE beacon. The proposed method makes use of an RSSI range (greater than -70 dBm equivalent to a distance of less than 3 m) to estimate the distance accurately. This increases the positioning accuracy by moving the estimated position of trilateration to reliable circles. In addition, the power of four beacons is utilized at the same time for more accurate positioning. Experimental results show that this is an effective and robust proposed scheme. As we have seen the impact of rLOS beacon, in the future, we will study the optimal method of beacon placement, in which, in any position, users always be able to observe an rLOS beacon.