Abstract
The majority of services that deliver personalized content in smart buildings require accurate localization of their clients. This article presents an analysis of the localization accuracy using Bluetooth Low Energy (BLE) beacons. The aim is to present an approach to create accurate Indoor Positioning Systems (IPS) using algorithms that can be implemented in real time on platforms with low computing power. Parameters on which the localization accuracy mostly depends are analyzed: localization algorithm, beacons’ density, deployment strategy, and noise in the BLE channels. An adaptive algorithm for pre-processing the signals from the beacons is proposed, which aims to reduce noise in beacon’s data and to capture visitor’s dynamics. The accuracy of five range-based localization algorithms in different use case scenarios is analyzed. Three of these algorithms are specially designed to be less sensitive to noise in radio channels and require little computing power. Experiments conducted in a simulated and real environment show that using proposed algorithms the localization accuracy less than 1 m can be obtained.
Introduction
The services people use in public smart buildings should deliver the information they want as quickly and reliably as possible. Such services aim to ensure a high level of visitor satisfaction. Satisfaction can be increased if the services are proactive. This means that services deliver personalized content to each client, predicting with high probability exactly what information they need at any given time. These services should take into account the profiles of their clients and should be adaptive to changes in the environment. For example, if a museum visitor approaches a painting, he/she will automatically receive information about the painting in preferred media formats. Such services are used when it is necessary to evacuate visitors from a building. In case of an emergency, each client of the service automatically receives information about the emergency, as well as a user-specific evacuation route. Services that depend on the position of their clients are called Location-Based Services (LBS). They are context-aware systems because the position is a type of context [28]. The concept of smart homes and smart public buildings is based on context-sensitive services such as LBS [30]. The usability of these services is directly related to the accuracy of determining the position of each client. Accurate calculation of this position would allow the creation of diverse and high-quality LBS. The use of Internet of Things (IoT)-based solutions [5,9] to calculate the position of visitors in buildings would increase the accuracy of these systems [30]. In this case, it will be possible to develop services that are adaptive to the changes in the building environment. At this stage, the cost of IoT-based building localization systems is too high. The reason for this is the need to build a sensor network in which each node should be able to exchange information with each of the other nodes. Based on this information, such a service could adapt to changes in the environment and thus minimize the error in calculating the position of its clients. At this stage, indoor positioning solutions use sensor networks with nodes, which operate independently [32]. Such solutions are less accurate and difficult to scale, but have a lower cost and do not require significant infrastructure changes. The accuracy of such services can be improved by using more accurate localization algorithms, as well as a more accurate estimate of the required sensor’s density (number of beacons per square meter) and placement [18]. The holistic approach to IPS design is the only way to ensure the development of IPS with optimal accuracy-price ratio.
Our general objective is to analyze the possibility of developing low-complexity IPS with an accuracy of less than 1 m using Bluetooth Low Energy (BLE) beacons as a sensor network [12,31]. The obtained results show that this is possible with an appropriate choice of algorithm for filtering the raw data from the beacons and for range-based BLE localization, taking into account the beacons’ density and placement shape.
The rest of the article is organized as follows. Section 2 is a critical review of the existing techniques and algorithms for indoor localization. Section 3 presents the algorithms analyzed in this article. In Section 4, the experimental results are presented. The paper is concluded in Section 5.
Related work
Many technologies can be used to create IPS [32]. The most common IPS uses a sensor network to calculate an estimate of the client’s (target) position. Sensor networks can use different types of sensor nodes, for example: infrared, visible light (Li-Fi), ultrasound, audible sound, and radio frequency (RF) [18,30,32]. These technologies have both advantages and disadvantages. For example, each technology requires changes in the infrastructure of the building. The aim is for these infrastructure changes to be small-scale and relatively inexpensive to implement. Some of these technologies (infrared, ultrasound, and Li-Fi) require additional hardware to be used by clients. At this stage, the most commonly used RF technologies for indoor localization are Wi-Fi, Ultra-Wideband (UWB), Radio Frequency Identification (RFID) and Bluetooth Low Energy (BLE) [30,32]. The main reason for this is the good ratio between localization accuracy and cost of development and implementation of such systems.
Localization systems using Wi-Fi and RFID have medium cost, complexity and accuracy. Wi-Fi-based indoor positioning systems require external power sources and additional pricey equipment. UWB-based systems have the highest localization accuracy (less than 0.5 m), but low security and the highest deployment cost due to the need for precise inter-node time synchronization. A battery-powered UWB dongle has to be attached to every client to measure his/her position. The client’s mobile device can read the calculated position over the Wi-Fi network.
One of the most promising technologies for locating visitors in buildings is BLE [12,31]. This technology guarantees low to medium localization accuracy at low system cost and medium to high security, depending on the version of Bluetooth standard. BLE is a Bluetooth SIG open-industry standard that aims to improve the performance of the Bluetooth Classic. The BLE devices operate in the 2.4 GHz ISM band at 2,400–2,483.5 MHz. It uses 40 RF channels, and each channel is 2 MHz wide. The improvements are related to better security, reduced maximum consumption, reduced latency, increased transfer rate, and increased maximum distance between BLE devices. Most BLE-based localization services use BLE beacons to implement their sensor networks. These devices are designed to generate push notifications for advertising purposes when a client of a service approaches an object (landmark). For this purpose, each BLE beacon sends the so-called advertising packets at a certain interval. The data packets are sent via three of the 40 radio channels. BLE technology works with: channel 37 (2,402 MHz), channel 38 (2,426 MHz), and channel 39 (2,480 MHz). Each packet contains information that is specific to each type of BLE beacon (iBeacon by Apple, Eddystone by Google, or manufacturer-specific BLE beacons). The data field in the iBeacon standard includes: iBeacon prefix, Universally Unique Identifier (UUID), Major, Minor, and TxPower.
BLE technology also has some drawbacks. BLE beacons can be used for the client’s localization, but distance estimate is quite inaccurate and varies depending on the environment and distance between BLE nodes. Mobile devices such as smartphones need from 2 to 4 seconds to detect a beacon in range. The open ISM frequency band used by BLE devices is filled with many other wireless protocols, such as Wi-Fi, as well as potential interference from home appliances. However, Wi-Fi has significantly higher output power, up to 23 dBm, compared to the maximum allowed 10 dBm for BLE standard. This means that placing a beacon very close to a Wi-Fi source will probably distort the transmitted data.
The main disadvantage of IPS using RF sensor networks is the dynamic variations in the parameters of radio channels due to the following more important factors: dimensions of rooms and corridors, type of construction material of the walls and ceilings, and position of static and dynamic objects in the building environment. In most RF-based localization systems, the calculation of the distance between the client and a sensor node is based on the value of Received Signal Strength (RSS) [26,34]. Regardless of the frequency, the value of the RSS attenuates approximately logarithmically with increasing distance between the reference node and the target node. Reducing variations in radio channel parameters is a difficult task that cannot be solved in real time when using mobile devices. The use of a mathematical model of the communication radio channel (free-space loss model, log-normal shadowing model, etc.) to predict the attenuation of RSS values does not give satisfactory results. The reason for this is that these models do not accurately describe the changes in the communication channel. The power of the transmitted signal from BLE beacons decays exponentially, mostly because of the distances, but there are also other effects such as fading and multipath effect that more or less affect the signal power. Fading is the time variation of the received signal. It depends on the environment and the movement of the objects. Multipath effect causes the signal to arrive in different ways to the device due to reflections, diffraction, and scattering. The most often used log-distance path loss model estimates RSS values measured at a location
Path loss exponent
BLE-based localization algorithms can be split into two main categories [20]: distance-based and fingerprinting-based. Distance-based algorithms estimate target node position, calculating (directly or indirectly) the distance to three or more reference nodes. Distance-based algorithms [15] can be divided into two categories: 1) range-based algorithms and 2) range-free algorithms. Range-based algorithms [17] need to measure the distances between reference nodes and the target node. Then, the distances are used to calculate the position of the target node. Range-free algorithms [29] can indirectly obtain an estimate for the distances. Range-based algorithms have better localization accuracy compared to the range-free algorithms. Fingerprinting-based algorithms create a so-called reference fingerprint map using a vector of RSSI measurements in known positions [20]. Fingerprinting is an expensive localization technique that requires more deployment efforts and time. Any significant change in the infrastructure requires all measurements to be repeated in order to update the reference fingerprint map [8]. This technique is not suitable for use in large public buildings and dynamic environments. The fingerprint-based systems analyzed in [20] have an average localization accuracy of 2.5 m (from 0.8 m to 4.12 m). Similar accuracy is obtained with distance-based systems–2.1 m (from 0.75 m to 3 m). The reason for the differences between the minimum and maximum values of localization accuracy is the different parameters under which the experiments were conducted (room dimensions and deployment density). For example, in [7], the authors provide a BLE fingerprinting-based localization using 19 beacons distributed around 600 m2. They achieved tracking accuracies of < 2.6 m 95% of the time using a dense beacon distribution (1 beacon per 30 m2) and < 4.8 m using a lower density distribution (1 beacon per 100 m2). In [10], the authors use fingerprinting localization in a hall of 7 m × 5 m, where the maximum distance between the target and reference nodes is less than 9 m. Using a trilateration algorithm, the average error is 2.8 m. Improving the accuracy of localization systems is possible by using various filtering techniques [16]. In [19], the authors use a Kalman Filter (KF) to reduce the localization error. The testbed consists of six BLE beacons located in the living room (8.5 m × 13 m) of a real house. The average localization accuracy was reduced to 1.77 m (41%) compared with the raw trilateration localization accuracy. In [33], the authors use the particle filtering method to improve localization accuracy. They report tracking errors low as 0.27 m in a smaller space and 0.97 m in a larger space.
Methods
RSSI data pre-processing
Fluctuations in RSSI data in buildings due to the presence of static (furniture, architectural objects) and dynamic (visitors) obstacles are the reason for the low localization accuracy. The radio frequency channels between BLE beacons and visitors are nonlinear systems. Accurate modeling of such systems is difficult to implement in real time using mobile devices. One possible compromise solution is to filter RSSI data so that for short intervals, the communication channel is a quasi-linear system. The most commonly used techniques for real-time filtering the observed set of RSSI values are the Moving Average (MA) filter and the Kalman Filter [10,16,27]. The KF is an optimal estimation method [20]. The KF algorithm can be described as a two-step process: the prediction step (time update) that makes use of the learned system dynamics to anticipate the next step of the system, and the correct step (measurement update) that takes a new observed measurement and uses it to correct the system dynamics and state. For IPS, the level of measurement noise is environmental and visitor movement dependent. In this case, the KF is not optimal and may cause unreliable results. One solution for solving the problem is to use adaptive Kalman filtering.
This article proposes the combination of MA filter and an Adaptive Kalman Filter (AKF) as a novel dynamic noise reduction algorithm. The algorithm uses signal processing at the time window level. For each time window (
The following parameter

Fuzzy membership functions.
To prevent this, the visitor’s speed of movement is used as second input variable (

Fuzzy rule matrix.
This article analyzes the accuracy of five range-based localization algorithms in different use case scenarios. The first two well-known algorithms–Trilateration and Nonlinear Least Squares (NLLSQ) localization–are used for comparison with the other three algorithms, which are specially designed to be less sensitive to noise in radio channels and require little computing power.
Trilateration is one of the most commonly used range-based techniques for localization in buildings [1,3,6,22,27]. Three RF sources, such as BLE beacons, placed in known locations, are required to calculate the 2D position of the target node. When using three beacons, the position of the client is the point at which all circumferences intersect. In real indoor environments, due to the fluctuation of the RSSI values, instead of intersecting at one point, these three circles can either intersect in an area, or not. Therefore, we use Line Intersection-based Trilateration algorithm [21] to estimate visitor’s position.
Nonlinear Least Squares [27] is an optimization technique that solves nonlinear data-fitting problems of the following 2D form:
When the position needs to be calculated, the function to be minimized is as follows:
First proposed algorithm (ALG-1)
The proposed algorithm ALG-1 belongs to the range-based localization algorithms but implements some ideas used in the range-free localization algorithm named Ring-Overlapping Circle RSSI (ROCRSSI) [15]. The ROCRSSI algorithm requires beacons to be able not only to transmit data, but also to read the data from other beacons. This makes it unusable if standard BLE beacons are to be used. Let us assume that
In our case we use standard BLE beacons. The aim is to obtain an estimate for the values of radii
The calculation of the estimated target node position is realized in the following sequence (see Fig. 3a). First, we select beacons involved in obtaining the target node position. For each beacon the radii

Localization using algorithm ALG-1: (a) how algorithm works: valid intersections (blue dots); invalid intersections (red dots); estimated position of target node
If the number of intersections between each possible pair of circles is two, the one for which a less total distance from the point to the position of the selected beacons is winner point (blue dots). The other point is considered invalid and is removed (red dots). Finally, it is assumed that the position of the target node
The estimation for position of the target node
Figure 3b shows how the ALG-1 works when three beacons are selected to estimate position of target node. Random noise in RSSI data with a maximum value of ±6 dBm is added. The blue circle is the real position of the target node, and the red diamond–the estimated position. The accuracy of the algorithm is highest if the target node position coincides with the center of gravity of an area that the beacons form (triangle B2B4B5).
The main reason for the error in estimating the target node position in the Trilateration and NLLSQ algorithms is the inaccurate calculation of the distance between the target node position and the beacons. In algorithm ALG-2, the target node position is calculated based on the difference between the RSSI values for each pair of beacons involved in the position-finding process. Therefore, each RSSI difference value is proportional to the ratio of the distances between the target node and each pair of beacons. If all beacons are configured to transmit at the same power, then this parameter (TxPower) will not affect the accuracy of position calculation. In the proposed algorithm, in order to simplify the calculations, it is assumed that the position of the target node is located in the center of a polygon. Let us first consider a special case in which the position of the target node is a point

Localization using algorithm ALG-2: (a) how algorithm works: target point (blue circle); intersection points (red circles); (b) algorithms ALG-2A and ALG-2B in action: ΔRSSI = ±3 dBm; circle with
Let us consider a case in which the position of the target node is a point
In order for a line
If
The accuracy of these algorithms depends on the geometric location of the beacons involved in the position calculation (see Fig. 4b). Best localization accuracy is obtained if the target node is in the center of a triangle that beacons form. When the target node is located in the triangle that the beacons form, the accuracy of algorithms ALG-2A and ALG-2B is approximately the same. Worst localization accuracy is obtained when the position of the target point is outside of the triangle. In this case, as shown in Fig. 4b, the ALG-2B algorithm has better accuracy than the ALG-2A algorithm.
In this section, several use case scenarios are conducted to analyse localization accuracy of the algorithms described in Section 3. The analysis of the parameters on which the localization accuracy depends is realized through a testbed platform, which includes: 1) Mobile app which dump to CSV file information from beacons with highest RSSI values and data from built-in accelerometer; 2) Texas Instruments (TI) CC2540 USB BLE dongle and SmartRF BLE packet sniffer software; 3) Java app for raw BLE packets data pre-processing and dump; and 4) Matlab™ software for automatic beacons deployment and localization algorithms comparison.
Mobile apps for BLE beacon configuration are most often specific to each manufacturer (Gimbal, Kontakt.io, iBKS, etc.) in order to ensure a higher level of security. Through them, the beacons can be configured by setting a specific value for each parameter, for example, advertising interval, Major, Minor, RSSI0, and TxPower. Using TI CC2540 BLE dongle, it is possible to scan any BLE channel for data from BLE devices. Data from CC2540 is analyzed using TI SmartRF BLE packet sniffer software. It allows setting the identifier of the BLE channel, which should be sniffed, as well as how to visualize the contents of the data packets. The application allows broadcasting BLE packets to other applications using UDP protocol. A Java application that starts a UDP server to capture packets transmitted by the SmartRF packet sniffer is developed. This app allows real-time recording of raw and filtered data as CSV files. Subsequently, this data is processed by a Matlab™ application that allows statistical analysis of data from CSV files.
Use case scenario 1
The aim of the first experiment is to analyze the applicability of the algorithm for beacon’s data pre-processing. The experiment was conducted in a lecture hall for 50 students. The dimensions of the hall are 11 m × 6 m × 3.3 m. Six BLE beacons were used, four of which were located in the corners of the hall, and two were located in the middle of the longer sides of the hall. They are located at a height of 1.5 m from the floor of the room. The same configuration parameters are set for all beacons: advertising interval (200 ms), RSSI0 (−52 dBm), and TxPower (4 dBm). To obtain the parameters of the log-distance path loss model, Matlab™ cftool is used (see Fig. 5).
The SmartRF BLE packet sniffer software is used to select a specific BLE channel (37, 38 or 39) to read beacon’s packets. The developed Java app starts a UDP server and capture packets transmitted by the TI SmartRF packet sniffer. This application has a graphical user interface (see Fig. 6) and allows: 1) Initialization of the app using parameters from a configuration file (minimum value of RSSI below which the data from the corresponding beacons is not processed; UUID of the beacons to be analyzed; maximum number of beacons to be analyzed; filter parameters, etc.; 2) Real-time visualization of RSSI data from the three closest to target node beacons; 3) Filter type selection: MA filter, Kalman filter or a combination of both filters; 4) Start / stop saving data into a CSV file – the application shows how many samples are recorded and how much time has elapsed since the beginning of the recording.

Lecture hall path loss model,

Java app for beacons data pre-processing and dump.
One hundred records received from different beacons and channels were analyzed for the specific distance between target and reference nodes, and noise in the BLE chanels. For each of the five distances (1 m, 2 m, 3 m, 6 m, and 8 m), 20 records were obtained. Each record contains about 500 samples (100 seconds). Matlab™ software is used to visualize the results obtained. The length of the time window

Beacon’s data pre-processing – raw data (green), filtered data (MA + AKF): average curve (green circles), maximum curve (red), and minimum curve (blue):
Summary of result obtained in dynamic environment with the static target node used

Beacon’s data pre-processing in dynamic environment and moving target node:
When using an MA filter, the error in the calculated distance decreases, but for
In the second experiment, the target node (visitor) moves in the lecture hall from one reference distance between the nodes to another reference distance. The visitor uses a mobile app through which the data from the six beacons and his/her speed of movement are recorded in a CSV file. Using Matlab™, it is analyzed for how long the reaction of a non-adaptive KF and the proposed AKF converge to the actual value of RSSI. During all the recordings, people move in the room. Figure 8 shows the result after filtering the RSSI data obtained by moving the target node from the reference node at an initial distance of 1 m (−52 dBm) to a final distance of 2 m (−60 dBm). It is clear that when using a non-adaptive Kalman filter (Fig. 8a) the convergence time is over 100 samles (20 seconds). When using the proposed AFK (Fig. 8b), this time is reduced to 15 samples (3 seconds). Experiments show that a non-adaptive Kalman filter does not give satisfactory results if the target node is not stationary. In this case, the convergence of the KF is insufficient to take into account the dynamics of the target node.

Comparison of algorithms localization accuracy: (a) distance between beacons is 3 m; (b) distance between beacons is 6 m; (c) distance between beacons is 9 m.
The aim of the second experiment was to validate the localization algorithms in an simulated environment at different target node positions relative to the reference nodes position, different values of the fluctuationsin the RSSI values, and different distances between the reference nodes (beacons). To validate the algorithms, localization accuracy is calculated. The localization accuracy
All experiments were performed under the assumption that the signals from three reference nodes were analyzed, which form an equilateral triangle. The accuracy of localization at three different distances between the beacons (3 m, 6 m, and 9 m) and three different positions of the target node is analyzed. We test localization accuracy for the following target node positions: 1) Target node is in the center of an equilateral triangle; 2) The position of the target node coincides with the position of an reference node; and 3) The target node is outside the triangle. For each of these three positions, 50 estimates were made for the target node position at four different maximum values for the random noise level in RSSI (0 dBm, ±3 dBm, ±6 dBm, and ±9 dBm). Figure 9 shows the average localization accuracy estimates for all possible target node positions at different distances between reference nodes and noise in RSSI values. The ALG-2A and ALG-2B algorithms have almost constant accuracy for all values of noise and distances between reference nodes. This is expected because ALG-2 algorithms are not significantly affected by noise in RSSI data. The more accurate is ALG-2B, which guarantees average localization accuracy less than 1 m for all test scenarios. The ALG-1 algorithm has approximately the same accuracy as the ALG-2 algorithms for noise in RSSI data up to ±6 dBm. Trilateration and NLLSQ algorithms can be used for micro-localization only at a small distance between beacons and low noise levels in communication channels. These requirements cannot be guaranteed in a real environment. Analysis of the position of the target node shows that all algorithms are most accurate when the target node is at the center of gravity of the triangle the three nearest beacons form. However, at this target node position, the Trilateration and NLLSQ algorithms guarantee micro-localization only when the distance between the beacons is less than 3 m. The ALG-1 and ALG-2 algorithms are most inaccurate when the position of the target node is outside the triangle the reference nodes form. In this case, these algorithms guarantee micro-localization only if the distance between reference nodes is less than 6 m.
Use case scenario 3
This experiment analyzes how the beacons’ density and deployment shape affect the accuracy of the localization algorithms [4,11,24,25,27]. The localization accuracy increases as the distance between the beacons decreases. In large public buildings, the cost of the deployment increases as the distance between the beacons decreases. For this reason, a compromise should be made between the deployment cost and the localization accuracy. Experiments show that in addition to the beacons’ density, the localization accuracy also depends on the shape the beacons form. In [24], the authors prove that the best placement of beacons is when every three of them form an equilateral triangle. This shape is called Crystal-shape iBeacon Placement (CiP), and it gives better results compared to the Z-curve placement strategy described in [23]. In a real building environment, these shapes cannot be guaranteed due to the specific dimensions of the rooms and corridors as well as the need for different localization accuracy in different rooms and corridors.
Matlab™ software has been developed to deploy beacons automatically, taking into account the desired shape and deployment density. All analyzed localization algorithms were tested for a simulated space of 200 m2 (20 m × 10 m) in the following two scenarios:
CiP shape and a distance between the beacons 5 m (5 beacons) and 10 m (14 beacons).
Rectangular shape and a distance between the beacons 5 m (6 beacons) and 10 m (15 beacons).
For each scenario, the localization accuracy was analyzed for 50 test points with pseudo-random coordinates. Different random noise with maximum amplitude of ±5 dBm has been added to the RSSI data. The obtained results are shown in Fig. 10 as a box-and-whisper plot. Trilateration and NLLSQ algorithms have better localization accuracy if a CiP shape is used. Conversely, ALG-2 algorithms have better accuracy if a rectangular shape is used. The reason for this is that ALG-2 algorithms have less accuracy when the target node is outside the triangle formed by the nearest beacons. Such a scenario is possible due to the noise in the radio channels. The localization accuracy of the ALG-1 algorithm depends less on the deployment shape and beacon’s density compared to other algorithms. At a distance between the beacons of 5 m, only the ALG-1 and ALG-2B algorithms can be used for micro-localization. For example, for a CiP shape, the accuracy of the ALG-1 algorithm is less than 1 m for all test points. In this case, the ALG-2A algorithm has three test points, and the ALG-2B algorithm has two test points for which the localization accuracy is over 1 m but less than 1.5 m. At a distance between the beacons of 10 m, the best localization accuracy has the algorithm ALG-2B when a rectangular shape is used. In this case, none of the localization algorithms guarantees accuracy below 1 m for all test points.

Comparison of different type of beacon deployment–box-and-whisper plot (
The aim of this use case scenario is to validate the analyzed beacon’s data pre-processing and localization algorithms in a real indoor environment. Specially developed apps for Android OS and Matlab™ are used to realize this scenario. The experiment was conducted in a lecture hall described in Section 4.1.
Two experiments were performed in this scenario. The first experiment analyzes the accuracy of the localization algorithms at nine test points in the room (see Fig. 11). The positions of these points are selected to simulate different positions of the test point relative to the positions of the beacons. When a participant in the experiment reaches a test point, he/she presses a button so the mobile app can receive information about this event. The route with test points is passed 20 times in one day.
During the experiment, five people move into the room. The software saves in a CSV file the information from beacons and accelerometer every 200 ms. The Matlab™ software calculates the localization accuracy for each analyzed algorithm at all test points (see Fig. 12).

Test environment–lecture hall: beacons (red rectangles); test points (gray circles); furniture (yellow and green rectangles).

Localization accuracy for all analyzed localization algorithms at all test points.
For each test point, the value of the minimum (blue dots), the maximum (red dots), and the average (different marker) of localization accuracy for each of the localization algorithms is obtained. The average localization accuracy of the ALG-1 and ALG-2 algorithms is less than 1 m for all test points. The average accuracy of algorithm ALG-2A is over 1 m for test points 1, 6 and 7. The reason for this is that this algorithm has poor localization accuracy when the target point is near the side of the triangle the beacons form. The Trilateration algorithm gives a high localization error for test point 5, since for some of the measurements, the highest RSSI value give beacons 1, 3 and 5 that form a straight line, not a triangle.

Estimated routes vs. ideal route (dark gray).

Comparison between different localization algorithms according localization precision.
Trilateration and NLLSQ algorithms cannot be used for accurate localization, as there are measurements where the error is higher than 1 m. The best results are obtained using the ALG-2B algorithm. The next most accurate algorithm is the ALG-1.
The second experiment analyzes the localization precision of the algorithms when participants cross the route, which is formed by all test points. To compare the localization precision of the different localization algorithms, an estimate is obtained for the overall deviation from the path (the shortest distance between the calculated position and the route). Figure 13 shows the results obtained when traversing the route from test point 1 to test point 9.
The target node position is obtained every second. The length of the path is 30 m. The average time to complete this experiment is 40 seconds. The average speed of movement is 2.7 km/h. Figure 13 shows the ideal route (dark gray) and the routes obtained using each localization algorithm. The ALG-2B algorithm has the best localization precision (see Fig. 14). In this case, the deviation from the route is less than 1 m for all measurements. The next most accurate algorithm is ALG-1, for which only one measurement has a deviation greater than 1 m but less than 1.2 m. Trilateration, NLLSQ, and ALG-2A algorithms do not guarantee micro-localization.
In this article, the possibility of creating low-complexity IPS for accurate localization in smart buildings using BLE beacons is analyzed. A new adaptive algorithm for reducing noise in BLE beacon data has been proposed. The algorithm is based on a combination of a Moving Average (MA) filter and an Adaptive Kalman Filter (AKF). AKF uses fuzzy logic to estimate the noise in RSSI data and to capture visitor’s dynamics. This algorithm is designed to implement in real time. Several use case scenarios have been implemented to compare five localization algorithms. Two of these algorithms are specifically designed to be less sensitive to noise in RSSI data and require little computing power. We validate the proposed algorithms in different simulated and real building environments. The advantages and limitations for each of the algorithms are identified, based on an analysis of how their localization accuracy and precision depend on factors such as: noise level in the beacons’ data, beacons’ density, placement shape, and position of target node relative to the position of reference nodes. The following is a summary of the main results obtained after the experiments:
In a real building environment (presence obstacles for radio waves and many moving visitors) obtaining micro-localization without the use of adaptive filtering of data from beacons is not possible. The proposed data pre-processing algorithm combines MA filter and an AKF. The time to estimate the target node position is fixed to one second in order to simplify AKF calculations.
The level of fluctuations in RSSI data is 2–9 dBm and depends on a number of factors, such as distance between the beacons and multipath effect. The most dependent on noise level are the Trilateration and NLLSQ algorithms. The least noise-sensitive is ALG 2B algorithm.
The ALG-1 and ALG-2 algorithms are more sensitive than the Trilateration and NLLSD algorithms to position of the target node only if there is no noise in the RSSI data. In a real environment where there are obstacles and moving people, this is impossible. All algorithms have the highest accuracy when the target node is in the center of gravity of the shape the reference nodes form.
The density of the beacons is a major factor that affects the accuracy of all algorithms. In a real building environment, Trilateration and NLLSQ algorithms cannot be used if the distance between reference nodes
The deployment shape affects the accuracy of the localization, but in a different way for the different localization algorithms. For example, the Trilateration and NLLSQ algorithms are most accurate if the shape is an equilateral or isosceles triangle. Conversely, the ALG-1 and ALG-2 algorithms are more accurate if the placement shape is rectangular.
The NLLSQ and ALG-1 algorithms can calculate the target node position using data from two or more beacons.
The choice of beacons to calculate the position of the target node should not be based solely on RSSI values. In a real environment, it is guaranteed that only the beacon with heights value of RSSI is selected correctly. For the other beacons, it should take into account what shape they form with the selected beacon. If it is necessary, the next pair of beacons should be selected.
When localizing moving objects in a real building environment, the ALG-2B algorithm has the best precision, followed by the ALG-1 algorithm.
The proposed algorithms for data pre-processing from BLE beacons and precise localization can be used in many services for visitors to smart buildings, for example: delivery of customized content depending on the location of each visitor; precise navigation of people with visual impairments in large public buildings [14]; detection of social interactions among humans [2], etc.
