More Accurate Beacon Locating Using AI Machine Learning

There’s new research in the Bulletin of Electrical Engineering and Informatics on Bluetooth beacons based indoor positioning in a shopping malls using machine learning. Researchers from Algeria and Italy improved the accuracy of RSSI locating by using AI machine learning techniques. They used extra-trees classifier (ETC) and a k-neighbours classifier to achieve greater than 90% accuracy.

A smartphone app was used to receive beacon RSSI and send it to an indoor positioning system’s data collection module. RSSI data was also filtered by a data processing module to limit the error range. KNN, RFC, extra trees classifiers (ETC), SVM, gradient boosting classifiers (GBC) and decision trees (DT) algorithms were evaluated.

The ETC model gave the best accuracy. ETC is an algorithm that uses a group of decision trees to classify data. It is similar to a random forest classifier but uses a different method to construct the decision trees. ETC fits a number of randomised decision trees on sub-samples of the dataset and uses averaging to improve the predictive accuracy and control over-fitting. ETC is a good choice for applications where accuracy is important but the data is noisy and where computational efficiency is important.

Radio RSSI

RSSI stands for Received Signal Strength Indicator. It is a measure of the power level of a radio signal being received by a device, for example a smartphone, in dBm (decibel-milliwatts). The RSSI is accessible to receiving devices via APIs such as the standard iOS and Android Bluetooth libraries.

The RSSI value is typically used to get an indication of the distance between a device and a beacon. A higher RSSI value indicates a stronger signal and therefore a closer proximity to the beacon, while a lower RSSI value indicates a weaker signal and a farther proximity to the beacon. Note that RSSI is usually -ve so a larger negative more usually indicates the beacon is further away.

RSSI is not a perfect measure of distance, as it can be affected by factors such as the environment and the type of device that is receiving the signal. However, by comparing the RSSI value of a beacon’s signal with the known transmission power of the beacon, it is possible to estimate the distance between the device and the beacon.

RSSI is commonly used in wireless communications such as WiFi, Zigbee, Bluetooth and cellular networks to measure the signal strength of the received signal. It is also used to estimate the quality of the signal, and to determine if the signal is strong enough to maintain a reliable connection.

RSSI is not a standard or a regulated measure and varys depending on the technology and the manufacturer of the device.

The relationship between RSSI and distance is not linear, and can vary depending on the environment and the type of device that is receiving the signal. In general, as the distance between a device and a beacon increases, the RSSI value decreases. However, the rate at which the RSSI value decreases with distance can vary depending on factors such as the environment and the transmission power of the beacon.

In free space, the RSSI value decreases at a rate of approximately 6 dB per doubling of distance. This is known as the inverse square law, which states that the power of a signal decreases proportionally to the square of the distance from the source.

Inverse square law

However, in a real-world environment, the rate of decrease can be affected by factors such as walls, obstacles, and interference from other devices, which can cause the signal to weaken faster or slower than expected.

It’s also worth noting that the RSSI value can vary depending on the type of device that is receiving the signal, as well as the type of radio technology used. The sensitivity of the device’s radio receiver will also affect the received RSSI value, a more sensitive device will be able to detect weaker signals at farther distances than a less sensitive device.

While equations can be used to infer distance from RSSI, the above factors mean the most accurate way to determine distance is to compare with previously measured RSSI-distance values.

If accurate distance is essential, up to about 3m, consider using a beacon such as the iBS03R that uses a time of flight (ToF) sensor rather than using RSSI.

Indoor Positioning Using iBeacon and ESP32

Bluetooth beacons advertising iBeacon can be used to perform indoor locating using trilateration. Trilateration is where three receivers are used to measure signal strength (RSSI) to calculate the position.

It’s possible to use ESP32 single board computers as Bluetooth receivers. The GitHub project iBeacon-indoor-positioning-demo has an example open source implementation. There’s also an accompanying blog post.

The implementation uses MQTT to send the data to a React app on a server where it’s displayed on a floorplan.

In practice, you might want to consider creating a more robust solution that uses Bluetooth gateways rather than ESP32 devices. There’s also the Bluetooth AoA Direction Finding standard that’s more accurate than using RSSI.

Using AI Machine Learning to Improve Ranging Accuracy

There’s new research from Oregon State University, USA and Peking University, Beijing, China on A Machine Learning Approach to Improve Ranging Accuracy with AoA and RSSI.

System Workflow

Machine learning was used to determine the line-of-sight distance in a multipath (reflective) environment. Due to the multipath effect, acquired signals indoors have complex mathematical models. A machine learning Artificial Neural Networks (ANN) is the most efficient way to process these signals.

The system achieved accuracy where 75% of the errors were less than 0.1 m with a median error of 0.037 m and a mean error of 0.092 m. This reduced ranging errors to under 10cm. The researchers were able to achieve high-precision indoor ranging without the need for a wide signal bandwidth nor synchronisation. The system was also simple and low cost to deploy due to low complexity of the equipment.

Making an iBeacon Using ESP32

Circuit Digest has a new tutorial ESP32 based Bluetooth iBeacon. ESP32 is a small single board computer that can easily be programmed to do different tasks. Many ESP32 boards include Bluetooth so it’s possible to program them to be an iBeacon.

The article first explains how to detect beacons on Android using nRF Connect. This is similar to our post Testing if a Beacon is Working. There’s also a useful table that explains the different ranges for received signal strength (RSSI):

Creating your own beacons means you can customise the advertising and do other IoT-related things at the same. The downside is bare ESP32 boards aren’t as physically robust, easy to configure nor power friendly as a dedicated beacon.

View iBeacons

The Problems of Using Bluetooth RSSI

There’s some older but nevertheless useful research from Chung-Ang University, Seoul, Republic of Korea on A Measurement Study of BLE iBeacon and Geometric Adjustment Scheme for Indoor Location-Based Mobile Applications.

The research looks into detecting beacons on smartphones and using the received signal level (RSSI) to infer distance. The aim was to understand the nuances of the variation of signal to be able to create an automatic attendance checker system.

The researchers looked into the differences between iOS and Android phones, the affect of device placement height, differences between iBeacons from different manufacturers, the affect of reducing to minimum transmit (Tx) power, indoors versus outdoors and the affect of obstacles and WiFi.

iOS showed notably shorter maximum distances of 85 meters and the difference between the maximum distances of iOS and Android turned out to be very large. RSSI readings on Android phone decreased more gradually with distance while iOS showed a sudden drop in RSSI after 10 meters. RSSI readings on the Android platform had more temporal (stability) variation than iOS.

The researchers found it difficult to create a model that could take into account all the variations of RSSI. They said:

We believe that our work provides evidence on the challenges for designing an indoor localization system using commercial-off-the-shelf (COTS) iBeacons devices.


The researchers were trying to create a very accurate RSSI-based system that could use any smartphone and any beacon manufacturer. This isn’t possible. Instead, accuracy has to be compromised, hardware restricted or a different technique used.

Most RSSI systems such as these use gateways rather than smartphones to perform Bluetooth scanning. This removes the smartphone model variability. Using only one beacon model reduces variability.

Newer Bluetooth Direction Finding provides a newer way than RSSI to obtain much better accuracy.

Bluetooth RSSI Measurement for Indoor Positioning

There’s a research paper by researchers from Taiwan on A practice of BLE RSSI measurement for indoor positioning. The paper looks into received signal strength (RSSI) to distance conversion, the significance of antenna plane (orientation) and measurements in two different situations, a low noise classroom and a more noisy manufacturing site workshop.

Techniques employed included developing a signal propagation model, trilateration, modification coefficients and Kalman filtering.

The hardware used included an Arduino Nano 33 (Bluetooth 5) and Linkit 7697 (Bluetooth 4.2). Over 1.6 million samples were collected generating over 13Mb of data.

“Multiple factors affected the RSSI, such as the device performance, antenna direction and radio wave refraction”

A positional accuracy of 10cm was achieved in ideal conditions dropping to meter level accuracy in more challenging setups and environments. The sensitivity of the (ceramic) antenna was found to fluctuate widely with orientation/topology. The researchers concluded that the key factor for reliable indoor positioning, based on RSSI, is maintaining good signal measurement quality.

Fingerprinting Positioning Using Multiple Advertising Slots

There’s interesting research from Spain on Multi-Slot BLE Raw Database for Accurate Positioning in Mixed Indoor/Outdoor Environments. It looks into fingerprinting with beacons simultaneously advertising six slots rather than one slot.

Fingerprinting is where you first measure the signal levels at various known points and then later compare new data with the old to work out the position. This is usually performed with one signal from each beacon. The researchers increased this to six signals to attempt to improve positional accuracy.

Tests were performed at the campus of the University of Extremadura in Badajoz in the Physics and Mathematics buildings and also outside. Beacons were set up to transmit four slots using the Eddystone protocol and two using the iBeacon protocol. Different transmit powers were used for each slot. Measurements were performed using three different smartphones with a custom developed Android application. The resultant data is available on Zonodo.

The researchers compared a simple Nearest Neighbours algorithm (NN) using all the slots, the one slot with the highest transmission power and the average of all slots from the same beacon. The results showed that using all the slots or just one per beacon gives similar results for accuracy, floor, and Tag ID recognition. Results using the averaged values increased the accuracy by 10%.

Beacon Signal Stability Observations

As previously mentioned, we perform signal strength and stability tests across beacons. The data feeds into our consultancy work. Here are some high level observations.

The following graph shows the standard deviation of the RSSI @ 1m, for some of our beacons, measured over a 60 second time period:

beaconsignalstability

Smaller bars are better and represent beacons
whose RSSI varied the least over time.

We found that beacons belonged to one or two groups. Firstly those with very stable RSSI and secondly those with an RSSI that had a standard deviation between about 4 and 6 dBm.

Signal stability is more important when you are using the RSSI to infer distance, either directly from the RSSI itself or indirectly via, for example, the iOS immediate, near and far indicators. RSSI varying without a change of distance might cause more spurious triggering. However, you should keep in mind that environmental factors can often cause variation much larger than the 4 to 6 dBm found in this test. Moving obstacles, for example people, will cause significant variation in RSSI.

Bluetooth LE advertising moves pseudo-randomly between radio channels. The channels use different radio frequencies that, in turn, results in fading of the signal at different distances. We experienced and mitigated similar behaviour in our LocationEngine™. Different radio frequencies experience different constructive and destructive interference at different physical locations. Beacons that move more between channels can cause more rapidly varying received signal strength (RSSI).

Processing iBeacon RSSI Using AI Machine Learning

There’s new research from China on Regional Double-Layer, High-Precision Indoor Positioning System Based on iBeacon Network.

The project used extended Gaussian filtering to delete and filter significant abnormal data values caused by multipath radio noise indoors. A deep neural network was also used to fingerprint data.

The system resulted in a maximum error positional error of only 1.02m.