Abstract
Introduction
Indoor localization has attracted a lot of research efforts in recent years. It aims to estimate the indoor position of a user (e.g. smartphone) to provide the service he or she needs. One typical method for obtaining location information is to use the global positioning system (GPS) service. This system provides a good accuracy and portable navigator for large-scale deployments but suffers from high cost and complex hardware. Moreover, GPS functions are not well performed in the indoor environment (e.g. buildings, tunnels). Thus, indoor localization technology would bring us huge benefit to improve the quality of Internet of things. For example, instead of spending enormous amount of time to find an item in a shopping center, a person can have an indoor map marked with his location on a mobile phone. With indoor positioning system, the shopping center can also deliver the location content and other location-based advertising. In this article, we consider an indoor localization scheme that employs Bluetooth low-power equipment (BLE) (e.g. iBeacon), received signal strength (RSS), and trilateration. A device detects the RSS signals from the iBeacon, calculates roughly the distance to iBeacon, and estimates its location if it is in the range of more than two iBeacons. Our task is first to find a good trusted-range model to describe the RSS–distance relationship during the training phase, then a trilateration technique is applied to determine the user position during the online phase. We have put more effort to provide an easy scheme for localization at the finest resolution area (under 1 m accuracy) which is good enough to distinguish kiosks or rooms in a building. In this case, the variations of RSS measurements are also taken into account to provide accurate position estimate.
The benefits of BLE in indoor localization have been shown in several works.1–7 Jianyong et al. 1 proposed a theoretical RSS-based BLE positioning method, which is divided into the following steps: (1) establishing an accurate RSS model, (2) smoothing online RSS readings, (3) RSS-based trilateration positioning methods, and (4) adjusting the RSS model periodically. A practical localization scheme 2 used only the RSS measurements and multi-lateration method for a Bluetooth smartphone. The effects of furniture and human body were also addressed in the RSS model. The BlueSentinel system 3 only adapted iBeacon to detect the number of users in a room, while their locations are estimated by a building management system. Chen et al. 4 proposed the RSS-based localization scheme for BLE device. The authors deployed the iBeacon hardware developed by Estimote, Inc., which have large variations in measurements. In order to achieve good accuracy, the iBeacon nodes should be deployed in high density. By jointly using iBeacon and inertial sensors, the protocols5,6 consisted of two modes: iBeacon localization mode and particle filter mode. Then, the position was estimated based on Wi-Fi fingerprinting approach. In order to achieve high accuracy, iBeacon nodes were only deployed to cover the areas that have poor Wi-Fi signals. Noh et al. 7 proposed a system deploying dead reckoning for RSS-based localization, where Wi-Fi access points (APs) were used as reference points. However, these aforementioned inertial sensor-based protocols are not only complex but also have many drawbacks. With a theoretical RSS model, 1 the results from an experimental study were not presented, while the system 2 deploys the Bluetooth 2.1 standard, which is old and low response. Errors from measuring and calculating procedure need to be addressed via practical experiments. Even if the distribution of errors is known, complexity and convergence issues may limit the performance of the algorithm3,4 in practice. Also, it is inefficient for self-localization if we maintain such a management system or building fingerprinting database. Another challenge related to the computational capability of the mobile devices is that inertial sensor-based approaches5,6 have comprehensive performance but they require higher hardware complexity and cost for the dual architecture. Wi-Fi can be used in a similar way as BLE beacons. Although its signals are stronger and can cover more distance than BLE, it requires an external power source, more setup cost, and pricey equipment. The accuracy of Wi-Fi solution 7 highly depends on the number of APs, that is, increasing the number of APs will increase the deployment cost. Moreover, scanning Wi-Fi signals is slower than Bluetooth ones. In order to tackle these issues, we first experienced the relationship between the distance and the RSS signals measured from an iBeacon node. The signal experiment varies over time at the same location. This information is collected to build a trusted-range table, which is used to determine the position of a mobile device during the online phase. In this article, we aim to propose a real-time indoor positioning and tracking system based on iBeacon devices that can give accurate position estimate and can be implemented for self-localization on mobile devices, so that location-based services can be applied. In the context of this article, the mobile device refers to the handheld devices (i.e. smartphones) which have limited power, memory, and computational capability; thus, not only a light-weight localization algorithm but also the capability to have real-time operation as well as accurate performance is required. In addition, we presented different ways to improve those aforementioned conventional approaches, such as determination of region of interest, selection of the zone, and the use of estimation method. Then, we obtained the effective localization scheme by the following procedures:
Measure the RSS from the nearest neighbor iBeacon nodes;
Calculate and choose a zone that offers the best fit of the mobile position;
Use a localization algorithm based on the triangulation method to estimate the position. Our approach provides low complexity and rapid processing.
There are several reasons that we choose the iBeacons to improve the performance of localization system. First, they are inexpensive and small that makes them easy to deploy as standard on devices. Second, since they have long battery life and do not require external energy source, there is no need of system maintenance. Third, they have high adjustment capability and are very responsive for small chunks of information broadcasted without a pairing sequence. Through practical experiments, we proved that the scanning time can be reduced by 65% when using iBeacon compared to when using the Wi-Fi. In our previous work, 8 we proposed an indoor localization scheme based on iBeacon and provided some simulation results. This scheme offers a simple and accurate localization solution with low complexity. Based on this work, we modified and extended the localization algorithm and included some new experimental results under real indoor environments.
The remainder of our article is organized as follows. Section “iBeacon propagation measurements” briefly introduces the iBeacon characteristics and a basic idea of the trusted-ranges model. The proposed localization algorithm and a practical setup scheme are presented in section “Localization algorithm.” Section “Experimental results” shows the experimental results and the corresponding evaluation on the algorithm performance. Finally, the conclusion is given in section “Conclusion.”
iBeacon propagation measurements
Single iBeacon node measurements
An iBeacon node–equipped BLE works similar to a stand-alone radio base station, which allows Bluetooth devices to broadcast a small amount of data through the air within short distance. 9 It is inexpensive, small in size, and has a long battery life. In general, its wireless signal is significantly affected by several ambient materials such as wall materials, metal, and human body from the measured environment. The accuracy estimated based on RSS measurements does vary depending on manufacturers but can be as good within 1.5 m. 10 In this section, we consider the following environment for experiment setup. A lobby with the size of 8 m × 10 m has a floor made of solid granite rock. The roof is about 6-m high covered by slim flat metal sheets on which several small lights and speakers are attached. The walls are 10 m in length and are made of concrete and glass with aluminum frames. The space does not consist of furniture or people.
In this experiment, we use RedBean iBeacon
11
and set the advertising interval at 200 ms and transmit (TX) power at +4 dBm. An iBeacon node is placed at the corner of the room. The antenna of iBeacon is pointed straight upward. A smartphone is placed on the ground with the screen facing up, parallel with the iBeacon node. RSS readings from the iBeacon are recorded by the smartphone at various distances. Since the orientation of the antenna inside the iBeacon affects the RSS reading, the device is put at a specific orientation when collecting RSS reading at each point. In this work, RSS readings are collected at four directions represented by

Four orientations of iBeacon: (a) 0°, (b) 90°, (c) 180°, and (d) 270°.

Single iBeacon node measurements with a smartphone.
Since the average RSS values are used by the positioning and tracking system to estimate the smartphone’s location, it is important to obtain a reliable average value. Figure 3 shows the average of RSS readings at several times of a day. Each measurement was taken almost 2 h to be done. At each reference point, we collected 300 RSS recordings during 5 min. The measurement was taken three times a day and was repeated for three Sundays. We choose these time schedules because they are business time slots, that is, localization-based services are needed. The RSS recordings at 9 a.m. can be classified into three levels: those from −65 to −56 dBm at 0.5 m from the iBeacon node, −76 to −66 dBm at 1 m, and −85 to −77 dBm at 1.5 m. Even then we measured at different times of the day (e.g. 2 p.m. and 6 p.m.), we also obtained similar results despite slight differences in ranges as shown in Figure 3(b) and (c). From this observation, the concept of trusted-ranges table which consists of three levels of RSS ranges is appropriate. We denoted the measurement step as

Average RSS from a single iBeacon node to a smartphone at several times of a day: (a) 9 a.m., (b) 2 p.m., and (c) 6 p.m.
Trusted-ranges model
After collecting the RSS time samples, we observed that the RSS readings versus distances from the same pattern at a certain time thus can be classified into three levels of ranges. We selected the reliable RSS values as trusted ranges given by equation (1). Moreover, an additional range level is also included in the table to address the case when mobile device receives the RSS values outside of the predefined range. This “out-of-ranges” level plays a prominent role in distinguishing spatial areas. Assuming there are
where
Here,
Due to time varying characteristics of the propagation wireless channel, RSS readings collected during training phase will be stored for the computation of position estimation. The actual RSS readings recorded at 9 a.m., 2 p.m., and 6 p.m. are given in Table 1. The RSS values are classified into four levels in terms of distance. We evaluated the trusted ranges of all recorded RSS values from an iBeacon node to a smartphone using equation (1). These trusted ranges show the RSS–distance relationship, so that the smartphone can estimate the distance from the iBeacon based on the RSS collected at that location. For example, if a smartphone receives a signal at −34 dBm from an iBeacon, the distance between them must be within 0.5 m, and if the RSS has a value in the range of (−63, −56), then the distance between them is limited from 0.5 to 1.0 m. The accuracy of the proposed localization scheme depends on finding a good trusted-range model that can best describe the behavior of the RSS values.
RSS ranges at various times and corresponding trusted ranges.
RSS: received signal strength.
While the RSS signals at distance 0.5 to 1.5 m are distinguished, the rest are difficult to analyze. Some of them have RSS values near trusted ranges, although the distance is far more than 2 m. The chaos of out of ranges could affect the accuracy of our proposed algorithm. For that reason, we carefully analyzed the probability of out-of-ranges interference as shown in Table 2. After collecting the signals in several distances, we calculated the percentage of the out-of-ranges distance that has RSS values in the trusted-ranges table. For instance, there is 12.7% chance of generated the RSS values at distance 2.0 m similar to the trusted range in distance 1.5 m (−84, −79). For our particular iBeacon type, the distance from 2 to 4.5 m has the acceptable value of interference (e.g. lower than 30%). In the trusted range (−71, −66), there is only one case of interference at distance 4 m.
Interference probability of various out-of-ranges distances to trusted range.
Localization algorithm
Most RSS-based localization algorithms utilize triangulation or fingerprinting methods to compute the position estimate. However, when exploiting the triangulation method in a large-scale area, its accuracy is no longer guaranteed due to calculation error and path loss propagation. 2 On the other hand, the accuracy of the fingerprinting method depends highly on how good the radio map is, for example, radio map has finer resolution and thus allows for a better estimation. The building and maintaining of fingerprint database are time-consuming and costly. To overcome these issues, we utilized a RSS–location relationship in real situation and performed an improved triangulation method to obtain the smartphone position. Thus, it is able to reduce the labor efforts, time required for creating radio map, and estimation errors.
Area allocation
We consider a grid of

Partition schemes of a cell, partitions, and zones with
Figure 4 shows an example of partition where
Regarding Table 1, zones can be divided into five groups based on their closeness to the iBeacon node. From Figure 4, group 1 includes zone 1, which is the closest zone to the iBeacon node within 0.5 m. Similarly, group 2 includes the zones 2, 5, and 6, which are 1 m to the iBeacon. Zones 3, 7, 6, 9, and 10 are assigned to group 3, which are those zones of distance 1.5 m to iBeacon. Group 4 involves the zones 4, 8, 11, 13, and 14 that indicate distances of 2 m. The last group included zones 12, 15, and 16, which represents the RSS values out of the trusted ranges. Thus, we modified the method to determine the zone for locating the smartphone in the next section.
Proposed localization algorithm
Without loss generality, assume that iBeacon nodes are placed at the positions as illustrated in Figure 4, and the smartphone is near to iBeacon

The flow chart of the proposed localization algorithm.
First, the smartphone scans iBeacon signals and may not recognize all
where
Second, a group
Since the RSS readings collected at different distances are different, it can vary up to −56 dBm. This indicates that with the same distance, the trust-range model cannot be used by mobile devices. For example, when the smartphone is located at zone 6, the RSS values of
where
Third, in order to select the zone, we used
(C1)
(C2)
(C3)
From a previous step, we already know the group which could distinguish the iBeacon easily. Next, the step of selecting the zone where the smartphone position may belong to is described as follows:
Finally, the smartphone obtains the information on
Note that the coordinate is used based on pixel screen coordinator in which the system uses the top-left corner as staring point.
Experimental results
Application description
In this section, to implement our proposed algorithm, we made a simple application based on Xcode and iPhone 5 as shown in Figure 6. The grid map on the main screen is a simplified map where the position estimation performs. The red point located at the screen corner represents the current estimated location of

A developed iPhone application for experiment.
Random position experiments
Before analyzing the localization performance of a random position, we tried several grid resolutions to find the optimal value

Deployment of iBeacon nodes with
The smartphone was randomly deployed at a position, thus placed on the floor in a random zone, which is estimated. Meanwhile, no pedestrian, furniture, or tester was around. Then, we collected the localization errors by calculating the Euclidean distance
If
Figure 8 depicts the localization accuracy (equation (9)) versus distance

Accuracy for random positions according to various
Real-time walking route experiments
Based on the previous result, we performed real-time localization experiments in which a user carries a smartphone and walks around the area of interest following a route. In order to provide accuracy position, the presence of effects along

Mapping trusted ranges by combining user-holding height.
Let
In fact,

Localization results in real-time experiments with
Next, in order to evaluate the efficiency of our proposed approach, we analyzed the localization accuracy versus distance
where
As can be seen from the figure, the trusted-ranges method shows better results than the conventional triangulation one. For instance, it shows that more than 80% of results achieve the localization error lower than 0.5 m, while this value is about 67.7% in the second scheme. Hence, the attained position errors are significantly lower.

Real-time walking accuracy rate with various

Histogram of positioning errors at
Scanning time performance
Since Wi-Fi and BLE technologies are best suited for indoor localization due to their deployed infrastructures, 13 in this section, we aim to conduct experiment to compare the performances between them. Throughout the above experiments, we first obtained a set of optimal parameters that produce the best performance of the proposed positioning system and then compared it to Wi-Fi in terms of running time. Note that a mobile may have limited processing power and memory. If the running time is too high, it would be a bad experience for user. We divided consumption during the localization procedure which consists of two parts: the time consumed during scanning iBeacon/Wi-Fi and the time consumed during estimating user position. We observed that there are no large differences in the estimates of user position (around 0.3 s) in two approaches. Thus, we only concerned the scanning time required on an iPhone 5 with iOS 9. To measure how long the scanning time of Bluetooth signal to take, we added the time portions of code using API functions. Invoking “TIC” starts the timer, and the next “TOC” reads the elapsed time. A demo of recorded log code is displayed in Figure 13. We consider measuring it running in a loop and then average to find the time for a single run. In this figure, the smartphone scans 30 iBeacon nodes and records the time when it is done. With different number of iBeacon nodes (5, 10, 20, and 30), the scanning process is performed at least 10 times for each. The final results are described in Table 3.

Bluetooth scanning speed of 30 iBeacon nodes.
Average Wi-Fi and Bluetooth scanning speed for several number of Wi-Fi nodes and iBeacon nodes.
Unfortunately, scanning time of Wi-Fi cannot be measured easily as Bluetooth did because iPhone API function refuses to access the Wi-Fi information that is outside the code. To complete this task, we launched the “Settings” icon on the iPhone 5 and turned on the Wi-Fi option. As illustrated in Figure 14, the scanning time in this case is the time that the smartphone has taken for realizing the available networks after the user turns on the Wi-Fi. We used a stopwatch timer to measure performance from In scanning (Figure 14(a)) to Done scanning (Figure 14(b)). Measure time is recorded with several number of Wi-Fi APs like iBeacon nodes. Time-consuming statistics for both approaches are described in Table 3. We observed that it requires less time to identify iBeacon signals than Wi-Fi ones, for example, the scanning time significantly reduces by at least 65%. Also, the simplicity and accuracy of iBeacon make it a good technology to be implemented on any mobile device.

Wi-Fi scanning within five densities of Wi-Fi access points: (a) In scanning and (b) Done scanning.
Conclusion
To overcome the limitations of fingerprinting and triangulation methods, we proposed an alternative indoor localization scheme based on iBeacon technology, which is called the trusted-ranges method. In this scheme, a reasonable trust-ranges model is first built based on the RSS measurements between iBeacon node and a smartphone. Then, the smartphone location is accurately obtained by finding an appropriate zone to which it belongs. In terms of database construction, we built a trusted-range model to describe that the RSS propagation varies over time and distance instead of rebuilding the fingerprint database periodically. In terms of position estimation, inspired by the triangulation method, we improved the performance by restricting the relevant area. In terms of running time, our proposed scheme reduces the running time using simple algorithm and taking the advantage of highly responsive iBeacon nodes instead of the Wi-Fi nodes (scanning time for iBeacon is at least 0.91 s, while that for Wi-Fi is 2.6 s). 2 In terms of accuracy, we achieved a better result than other works.1,2,7,8 Although trusted ranges have limited covering distances, the accuracy can be easily improved using higher density of iBeacon nodes whose price is not too much expensive. Moreover, using better iBeacon nodes from different manufacturers can also improve the cover range and accuracy. In summary, our scheme can perform better than the previous algorithms, especially in a short-range communication, while having a low complexity and fast speed. In the future work, we would like to extend this study with the presence of interference like obstacles and human.
