Localization of a BLE Device Based on Single-Device RSSI and DOA Measurements

: Indoor location services often use Bluetooth low energy (BLE) devices for their low energy consumption and easy implementation. Applications like device monitoring, ranging, and asset tracking utilize the received signal strength (RSS) of the BLE signal to estimate the proximity of a device from the receiver. However, in multipath environments, RSS-based solutions may not provide an accurate estimation. In such environments, receivers with antenna arrays are used to calculate the difference in time of flight (ToF) and therefore calculate the direction of arrival (DoA) of the Bluetooth signal. Other techniques like triangulation have also been used, such as having multiple transmitters or receivers as a network of sensors. To find a lost item, devices like Tile © use an onboard beeper to notify users of their presence. In this paper, we present a system that uses a single-measurement device and describe the method of measurement to estimate the location of a BLE device using RSS. A BLE device is configured as an Eddystone beacon for periodic transmission of advertising packets with RSS information. We developed a smartphone application to read RSS information from the beacon, designed an algorithm to estimate the DoA, and used the phone’s internal sensors to evaluate the DoA with respect to true north. The proposed measurement method allows for asset tracking by iterative measurements that provide the direction of the beacon and take the user closer at every step. The receiver application is easily deployable on a smartphone, and the algorithm provides direction of the beacon within a 30 ◦ range, as suggested by the provided results.


Introduction
Bluetooth is one of the most widely used wireless communication technology standards in the world, with over 5.4 billion Bluetooth-enabled devices shipped in 2023 alone [1].With the introduction of Bluetooth low energy (BLE) as a part of the Bluetooth 4.0 specification [2] in 2010, the applications of this communication standard have expanded into the Internet of Things (IoT), device networks, and location services.In recent years, the use of BLE devices has accelerated in location services like indoor navigation, asset tracking, point of interest information, and space utilization.A market study of Bluetooth estimates that there are approximately 200 million devices currently deployed for asset tracking and item finding solutions and expects the number to be doubled by 2027 [3].These BLE devices, classified as Bluetooth beacons, perform proximity sensing by advertising their presence that is recorded by a scanner device like a smartphone or a tablet.Beacons are widely used to track lost items, and various manufacturers have implemented these devices, commonly known as Bluetooth tags.Some of the popular implementations include Tile © and Chipolo © .
Achieving the same results by localization of the Bluetooth signal has proven to be a challenge due to multipath fading.Some research has been carried out on estimating the DoA of the Bluetooth signal and on range.Techniques like trilateration, triangulation, and fingerprinting (reviewed in Section 2) have been used to identify the angle of arrival (AoA) of the Bluetooth signal.In some cases, researchers used an antenna array to calculate the difference in ToF to estimate the AoA in multipath fading environments.In other research works, multiple scanner devices were used to determine the location of the beacon.
In this paper, we begin with a brief review of the related work in the field of Bluetooth signal localization focused on asset tracking and provide details on existing implementations of beacons for different localization applications in Section 2. The rest of the paper is organize as follows.In Section 3, we describe the problem statement in detail by considering the existing work conducted in this field.Section 4 provides details on the Bluetooth channel spectrum and features of a transmitted packet of BLE, such as advertising channels, RSS, etc.In Section 5, we discuss in detail the aspects of RSS measurements, evaluating the orientation and heading of the scanner device, data recording and denoising techniques, and measurement methods for estimation of the beacon's location.Section 6 describes the system design, including down-selection of the hardware used for the beacon and exploration of currently existing beacon implementations (e.g., iBeacon, Alt-beacons, Eddystone beacons, etc.) to adopt the one that supports our research.In Section 7, we show the results for sample experiments in a real-world scenario and provide data on the accuracy of our algorithm to identify the location of a beacon.Finally, the paper ends with a conclusion and potential further work in Section 8.

Contributions of This Research
In summary, contributions of the research described in this paper include the following: • Provide a solution for estimating the DoA of a BLE device using a single and easily available measuring device such as a smartphone; • Provide an algorithm to determine the DoA of a BLE device using RSS from the advertisement packet without channel ID information; • Provide an alternative to the conventional way of asset tracking and item finding by locating BLE devices without the need for onboard beepers; • Provide a new way of measurement using a single measuring device that gradually guides the user closer to the beacon.

Related Works
BLE devices are intended for applications that require low data rates and low power.A BLE device broadcasts its presence over advertising channels before establishing a connection to another compatible BLE device (described in more detail in Section 4).This ability to broadcast continuous has made them ideal for use as beacons in proximity sensing applications.These applications include providing users with information on a point of interest when they are in the region, indoor positioning, and item or asset tracking.Existing implementations of Bluetooth-based tags by manufacturers like Tile © [4] and Chipolo © [5] use the merits of BLE beacons to locate the position of items with the help of a smartphone application.A beeper on these tags allows users track lost or misplaced items to which they are attached.Although these devices have been successful in the consumer market, they rely on the user to track and locate the beep generated by the tag.Monitoring the Bluetooth signal as opposed to following the beep can be a good alternative for finding a lost item, and achieving this has been a challenge in the field of signal localization.
Substantial research has been carried out on Bluetooth signal localization for indoor positioning and asset tracking with the idea of primarily estimating the proximity between two BLE devices or between two smartphones by monitoring their RSSI [6][7][8].The three widely used techniques for indoor positioning are trilateration, fingerprinting, and centroid methods.Effective trilateration and filtering techniques for Bluetooth localization using multiple beacons are discussed in [9,10].Studies on using the trilateration method in indoor positioning and its accuracy can be seen in [11,12].The authors of [8,[13][14][15][16] proposed the use of various fingerprinting techniques for localization of BLE beacons with [8] focusing on detecting the proximity between smartphones and BLE beacons.In the papers [17][18][19], estimation of the location of a beacon by monitoring RSS with the help of an antenna array for deriving the DOA and direction of departure (DOD) is discussed.In [18,19], research is focused on using the antenna array method for localization of BLE signal in warehouse asset management.These techniques require multiple BLE beacons for a single measurement or require an antenna array for estimating the DOA of the BLE signal.These requirements result in limitations to some applications, such as finding lost items in a home environment where it can be impractical to have additional hardware pre-installed in the BLE device.In our research, we present a novel method of finding a BLE beacon using a single scanner device, which can be a smartphone or a tablet/iPad commonly available in home environments.
In recent years, ultra-wideband (UWB) technology has been used in indoor positioning and localization applications.Apple and Samsung have advanced this technology into their flagship smartphones [20,21] and created new devices (Apple air tag and Galaxy smart tag) that can assist in finding lost items.UWB is a short-range wireless communication technology similar to Bluetooth or WiFi but operating at a higher frequency.Because of its operation at a higher frequency band, UWB avoids the congested 2.4 GHz band where other communication technologies like Bluetooth, WiFi, and NFC exist.The larger bandwidth of UWB and shorter pulses of about once every 2 nanoseconds allow for realtime positioning of devices at a higher accuracy.Utilizing this technology requires a UWB-enabled transmitter and scanner devices.At the time of writing this paper, only a few scanner devices (smartphones) support UWB, including Apple iPhone (iPhone 11 Pro/Pro Max, and all models from 12 to 15i) and Samsung Galaxy (Note 20 Ultra, S21 Plus/Ultra, and all models from S22 to S23).
Despite higher accuracy compared to Bluetooth, UWB-enabled scanner devices are currently limited, and BLE is still the most widely used wireless communication technology in indoor positioning applications across multiple industries.In large indoor environments such as warehouses, most localization and positioning applications use BLE and upgrading the existing infrastructure to UWB can be an expensive process.With the number of Bluetooth-enabled devices being much larger than UWB-enabled devices, Bluetooth is still the preferred choice in many indoor positioning applications in warehouses, shopping malls, etc.Therefore, in this research, we focus on BLE-based localization techniques.

Problem Definition
In recent years, multiple manufacturers have developed BLE beacons focusing on finding lost items.While the introduction of Bluetooth 5.1 specifications has allowed us to detect the AoA and angle of departure (AoD) of the Bluetooth signal, which helps to accurately track a beacon, it requires the scanner device to have an antenna array.Several design considerations must be made in the development of these antenna arrays, like antenna spacing, grounding, and antenna efficiency, to improve their effectiveness.
Implementations of BLE beacons have suffered from lower accuracy as Bluetooth signals can be blocked and bounced off of objects, making it difficult to approximate the exact location of the beacon without any prior knowledge of the channel information over which the beacon is broadcasting.The task of estimating the AoA using a single receiver without an antenna array by monitoring the RSS, which is defined as the focus of this research, is complex, and the implementation can help users with hearing ailments track and locate an item.This can also be extended into robotics applications, such as finding the home base of a robot or communicating with different robots in a larger area like a warehouse without the need to upgrade the existing infrastructure to UWB or add antenna arrays to BLE receivers.

Bluetooth Low Energy
The original design of Bluetooth wireless technology, which is now referred to as Bluetooth Classic, was intended for short-range communication applications like audio streaming, mobile printing, file transfers, etc. Bluetooth Classic transmits data over 79 channels that are 1 MHz wide in the 2.4 GHz unlicensed ISM band and only supports point-to-point device communication.
Bluetooth low energy was later introduced as part of the Bluetooth 4.0 specification optimized for low power consumption while supporting the same transmission power [22].Low power consumption is achieved by turning off the radio when it is not in use and by reducing data transmission rates.In addition to the features supported by Bluetooth Classic, BLE supports positioning features and multiple topologies for device-to-device communication.These desired features and its ease of integration with other devices made BLE one of the most popular modes of wireless communication among IoT applications that require low power consumption [23,24].
BLE signals are also transmitted over the 2.4 GHz radio band but consist of 40 channels that are 2 MHz wide, as shown in Figure 1.Among the 40 channels, three widely spaced channels numbered 37, 38, and 39 at 2402 MHz, 2426 MHz, and 2480 MHz, respectively, are used for device discovery and are known as primary advertising channels.They are intentionally spaced to avoid interference with Wi-Fi channels, which are also on the same 2.4 GHz ISM band.The remaining 37 BLE channels are used for bi-directional data transfer after the connection is established with another device and are also occasionally used as advertising channels (specifically named secondary advertising channels).During typical BLE device communication, the device discovery state starts by sending an advertising packet on one or three of the primary advertising channels.The advertising packet is sent periodically with a preset advertising interval ranging from 20 ms to 10.24 s with a step size of 0.625 ms until it is discovered by another device and a connection is established.The continuous broadcast of advertisement packets in the discovery state before advancing to the connection state is used in positioning applications.The positioning applications run on a scanner device to read the RSS measurements from the advertising packets and derive the proximity or location of the devices.These implementations are called Bluetooth beacons or simply beacons.In this paper, we present the implementation of a Beacon by referring to some of the existing and popular implementations like iBeacons and Eddystone beacons.The BLE device used for the implementation of our beacon supports Bluetooth v5.0.The RSS of the advertising packets broadcasted by beacon will serve as the input data of a localization algorithm using a single scanner device such as a smartphone, as discussed in detail in Section 5.3.

Single Scanner-Based DoA Estimation
A lot of research has been conducted in the field of Bluetooth signal localization for indoor navigation and device positioning ([6-10,13-19]) with many algorithms using the RSS of the advertising packets to estimate the position of the beacon.In some algorithms, DoA is estimated through triangulation by measuring the difference in ToF between two antennas.Some implementations of triangulation with antenna array can deliver both 2D and 3D tracking with sub-meter precision and a 5 • accuracy.In other research, multiple scanner devices set up in the form of a sensor network are used to act as an antenna array for estimation of DoA by calculating the difference in ToF between each device [17][18][19].In this paper, we explore the estimation of DoA for beacon positioning without the aid of an antenna array and using a single scanner device.The scanner device we used is an easily accessible smartphone with Bluetooth capabilities, an in-built magnetometer, and a GPS receiver.As most smartphones are not equipped with an antenna array, the ToF difference calculation cannot be used for DoA estimation.In Sections 5.1-5.3,we further discuss in detail the method of using a single scanner, including the design of the scanner application, the process of capturing data, and the algorithm for filtering and processing the data to estimate the location of the beacon.

RSS Measurements on Advertising Channels
With the BLE proximity profile, the beacon device broadcasts an advertising packet periodically at a pre-configured advertising interval.Different implementations of the beacons and services have different advertisement packet structures.However, in general, the advertisement packet contains one-byte transmit power level data, which is the measured radiated transmit power at 1 m distance from the beacon.
The proximity monitor device scans the advertising channels for advertisement packets.Scan results are timestamped and RSS-captured per broadcast as part of advertisement packet decoding by the BLE protocol stack software layer [25].Convenient APIs are provided by all major operating systems, including Windows, Linux, macOS, iOS, and Android, to retrieve the scan results.The RSS value in the scan results can be used together with the transmit power level data from the advertisement packet to determine the approximate distance between the reporter and monitor devices [26].
RSS of radio signals measure of power level that a receiver receives from an RF transmitter device.This measure is typically monitored by wireless devices to ensure signal quality and switch to different access points or base stations when it falls below a threshold level.

Heading Measurements Using Magnetometer
To estimate the direction of arrival of a signal, it is important to know the orientation of the scanner device and its position in the three-dimensional space.In this research, the scanner device is a smartphone that also has an in-built magnetometer (as a part of the inertial measurement unit or IMU) used for navigation applications.A magnetometer provides data on the strength and direction of a magnetic field.Magnetometer data are dependent on the orientation of the phone with respect to the horizontal plane, and an accelerometer can be used to calculate the pitch and roll angles of the device to determine the orientation when moved away from the parallel horizontal plane.For this project, we are only using two-dimensional readings of the heading angle from true north and ignoring the tilt information.This information can yield the angle of orientation of the phone, and with location services enabled, the GPS coordinates and declination angle provide the phone's orientation from true north.Both iOS and Android provide convenient API to acquire heading measurements from the built-in IMU in real-time [27][28][29].

Measurement of RSS Profile over Heading Direction
The basic idea of the proposed method for BLE beacon signal DOA estimation with a single scanner device (i.e., smartphone or any other mobile devices such as tablet, laptop, etc.) is illustrated in Figure 2. A user holds the scanner device in hand and takes a set of measurements of the RSS of the BLE beacon signals and the heading direction of the scanner while rotating 360 • in the same standing location.The principle underlying assumption of the proposed method is that the measured RSS value is the highest when the heading direction of the scanner points towards the BLE beacon.However, it is well known that RSS measurements fluctuate significantly due to various fast and slow fading effects in the multipath radio propagation channels [26].Thus, it is impractical to estimate the DOA of beacon signals accurately from the raw RSS and heading measurement data.As explained in detail in this paper, we designed a number of sensor data processing and fusion methods to achieve robust DOA estimation using the measurement configuration in Figure 2.  The types of antennae that are typically integrated into BLE devices include chip antenna, micro-strip antenna, and metal plate antennae, among others [30].As design engineers often need to trade off antenna performance to satisfy other design constraints, the antenna radiation pattern of wireless devices is commonly not omnidirectional [30,31].The antenna radiation pattern of a wireless device is primarily determined by the antenna's design, construction, and positioning within the device enclosure package.Thus, wireless devices often exhibit directionality in signal reception characteristics.In addition, when a user holds the device in hand, as shown in Figure 2, the user's body will also affect the signal reception directionality.For example, the RSS of the received beacon signal is higher when pointing the scanner directly towards the beacon as compared to the scenario where the beacon is located right behind the user.If a human body blocks the line-of-sight signal path between the scanner and the beacon, it may substantially attenuate the beacon signals.
In the measurement scenario shown in Figure 2, we have considered different rotation speeds of the user, ranging from 2 rpm to 12 rpm.With a rotation speed of 2 rpm, the user rotates 12 • per second and takes 30 s for one complete rotation of 360 • , while with a rotation speed of 12 rpm, the user rotates 72 • per second and takes 5 s for one complete rotation.The advertising interval of the BLE beacon device can be set to any value between 20 ms and 10.24 s with a step size of 0.625 ms [25].In practice, in order to collect a sufficient amount of data for processing within a reasonable time period, the advertising interval should be set to a smaller value.For example, when the advertising interval is set to 20 ms, it is possible to collect up to 50 measurements per second.Thus, depending on the user's rotation speed, the number of measurements collected for one rotation can range from 250 for 12 rpm to 1500 for 2 rpm.
During the measurement process, the scanner device continuously scans the advertising channels to capture the advertisement packets (i.e., beacon signals) coming from the target BLE beacon device.Once an advertisement packet is received, the scanner decodes the RSS value and immediately takes a measurement of the heading direction with the magnetometer.Then, the data, including both RSS and heading measurements, are timestamped and passed to the upper application layer process for further processing.Thus, with such a measurement process, each measurement data sample consists of three parameters, including a timestamp, RSS, and heading, which are captured concurrently.Specifically, for a set of N s data samples, we can represent the dataset as follows: for 0 ≤ i < N s , where the parameters t i , P r (t i ), and θ(t i ) are the timestamp, RSS measurement data, and heading measurement data, respectively.In the next section, we will present a space-time data processing and fusion method that is used to derive reliable DOA estimation from the measurement dataset defined in Equation (1).

Space-Time Data Processing and Fusion Method
The RSS data collected over varying heading directions with the measurement configuration shown in Figure 2 typically show large random variations, which are the result of small-scale fading effects in multipath radio propagation environments.Similar to the idea of removing the small-scale fading effects through local averaging as presented in [26], in this paper, we propose a systematic space-time data processing and fusion method to combine the RSS and heading measurements collected at multiple locations to derive reliable DOA estimation from BLE beacon signals.
The basic idea of the proposed data processing and fusion method is illustrated in Figure 3.With the proposed method, at location P 1 shown in Figure 3, a user uses a scanner device to take simultaneous measurements of RSS and heading direction, as illustrated in Figure 2.Then, the user steps aside to a nearby location P 2 to take another set of measurements of RSS and heading direction.As defined in Equation ( 1), each measurement data sample consists of three parameters, including a timestamp, RSS, and heading, which are captured concurrently.The two locations can be one or two steps apart (i.e., approximately one to two feet apart).There are no strict requirements or constraints on the relative positioning of the two locations, except that the distance between the two scanner measurement locations d ss is much smaller than the distance between the target BLE beacon device and the scanner measurement locations d ts .Additionally, there is no need to know the exact values of distances d ss and d ts .The block diagram of the proposed space-time data processing and fusion method is illustrated in Figure 4.With this method, the measurement data collected from each location are first processed through two functional blocks for data binding and denoising over the time axis.In the temporal data binding operation, for each location, the time axis of measurement data is segmented into a total of N t consecutive bins of an equal time duration δ t .Then, the data within each time bin are combined using the median, i.e., for 0 ≤ n < N t , where τ n and τ n+1 are the boundaries of the nth time bin.Here we use the median instead of the average to combine multiple measurements within each time bin for noise reduction because it is well known that the median is more statistically robust to outliers than average while outliers are often observed in RSS measurements [26].Due to the variable delays in the networking protocol stack, the timestamps of measurement data are irregularly spaced.Thus, another benefit of data binding over the time bins of equal width is that after binding, the data samples are in the form of an equally-spaced discrete time sequence, which is well suited to further processing with discrete time-signal processing algorithms.The denoising over time axis is obtained using the well-known exponentially weighted moving average (EWMA) filter [32], i.e., for 0 < n < N t , where the weighting parameters are set to values between 0 and 1; that is, 0 < w p < 1 and 0 < w θ < The measurement data from two locations (i.e., the locations P 1 and P 2 as shown in Figure 3) are collected in sequence at different times.Therefore, to combine the data samples from two measurement locations, the timestamp data are removed from the dataset after denoising over time; that is, an individual data sample is transformed from {t n , Pr Parameter n is then treated as a general indexing parameter instead of the discrete time index.With the removal of timestamps, the denoised measurement data samples { Pr [n], θ[n]} can now be viewed as the RSS measurements parameterized by the heading direction angle, i.e., Pr (θ), In the spatial data binding process, the denoised data samples Pr (θ) from two locations are first simply combined into one single dataset.Then, the heading direction angles between 0 • and 360 • are segmented into a total of N θ consecutive angle bins of an equal angular width δ θ .The data within each angle bin are combined using the median operation, i.e., for 0 ≤ k < N θ , where θ k and θ k+1 are the boundaries of the kth heading direction angle bin.Similar to the temporal data binding, here we use the median instead of the average to combine multiple data samples within each angle bin for noise reduction because it is well known that the median is statistically more robust to outliers than the average.After spatial data binding, the RSS profile over heading direction angle Pr (θ k ), 0 ≤ k < N θ , is further processed for smoothing using a moving average filter with a window size of 2L + 1, i.e., for 0 ≤ k < N θ , where l ′ = mod(l, N θ ), and the mod is the modulo operator.The modulo operator is required here since the heading direction angle is defined in the range between 0 and 360 • covering a complete circle.Finally, the RSS profile over heading direction, Pr (θ), is used to estimate the DOA of the BLE beacon signals, i.e., θ = arg max θ Pr (θ). (8)

Navigation towards the Target BLE Beacon
The DOA of the BLE beacon signal for two scanning locations that are a small distance (d ss ) apart is represented by θ.The user can employ this estimation and move in the direction of θ to take further measurements until they get closer to the BLE beacon.An illustration of navigating towards the BLE beacon by taking measurements at multiple locations can be seen in Figure 5.For this research, we assume that users can physically look for and find the BLE beacon when they are 1 m away.The RSS value received by the scanner is dependent on the transmission power that is set at the BLE beacon.The scanner can receive high RSS values from a distant beacon if the transmission power of the beacon is high.To create a balance between range and power consumption, we set the transmission power of the BLE beacon as 10 dBm.After conducting multiple experiments, we determined the baseline of RSS values to be 65 dBm, which can help identify if the BLE beacon is within 1 m.The scanner device will notify the user that the BLE beacon is nearby when the RSS values are consistently higher than the determined baseline.

System Design and Implementation
To conduct experimental studies to determine the accuracy of the proposed algorithm, in this research, we built a measurement system that includes a BLE signal transmitter and a scanner device.The transmitter is based on the Arduino BLE 33 sense board (shown in Figure 6), which has a small form factor with an ARM cortex M4F microcontroller and an on-board nRF52480 Bluetooth module.The nRF52840 chipset on this version of the Arduino board supports Bluetooth v5.0 with up to 8 dBm transmission power and data rates of up to 2 Mbps.Using the readily available Arduino libraries, it is programmed to broadcast Bluetooth advertisement packets at a set interval with a specific transmission power and identifiers required for the scanner device to discover it.A smartphone with an inbuilt IMU sensor and a GPS receiver is selected as the scanner device, which also allows for the effortless development of a scanner application with an intuitive user interface.

Design and Implementation of BLE Beacon Device
The class of BLE devices that broadcast their presence through advertising packets are known as Bluetooth beacons and are widely used in applications like asset tracking, proximity sensing, and item finding.Some of the popular implementations of BLE beacons include iBeacon by Apple, Eddystone beacons by Google, and open-source AltBeacons.In this research, we programmed the Arduino Nano 33 BLE sense board as an Eddystone beacon in UID mode since it provides the best programming flexibility of its frame data.The packet structure of an Eddystone beacon, when used in UID mode (Figure 7), allocates 1-byte for frame type information, 1-byte for TX power, 16-bytes for beacon ID (10-bytes for Namespace ID and 6-bytes for Instance ID), and 2-bytes reserved for future use.The 10-byte namespace ID is unique for every Eddystone BLE beacon and can be useful for classification and organization among multiple Eddystone beacons.TX power for a BLE beacon signal can range from −20 dBm (0.01 mW) to +20 dBm (100 mW), and for this research, we set the value to 10 dBm considering a balance between the Bluetooth signal range and power consumption of the device.We also set the advertisement interval to 20 ms and programmed the beacon ID with a unique alpha-numeric string that allows the scanner device to find the right beacon among other nearby similar beacons.

Design and Implementation of iOS Scanner Application
The scanner device we used is an iPhone 14 (iOS 16), which has an in-built Bluetooth chipset, an IMU sensor, and a GPS receiver.Using Apple's iOS 16 software development kit (SDK), we developed an application with an intuitive user interface that allows users to start/stop the scan, calibrate the scanner, view the results of their scan, and obtain information on the next scan location.The application programming interface (API) provided by IOS SDK has CoreLocation and CoreBluetooth modules that allow for ranging and monitoring of BLE beacons.Monitoring is used in applications that involve proximity sensing from a specific fixed location while ranging scans the advertisement packets of the beacon to estimate the distance.For this research, we used the CoreBluetooth API to scan the advertisement packets at a rate of 50 Hz and read the RSS values from the packet structure.The CoreLocation module of the API provides the current location of the scanner devices, and combining that with the magnetometer readings, we calculated the orientation of the smartphone with respect to true north.Figure 8 is a screen capture of the scanner application, which finds the programmed beacon device, captures and timestamps the RSS values from the BLE beacon, and provides heading information at different measurement locations.The final heading information is the approximate DOA of the beacon device ( θ) calculated using the estimation algorithm discussed in Section 5.4.

Calibration of Scanner Device
Since the BLE beacon's advertisement packets are received by the Bluetooth chipset located inside the scanner device, it is important to calibrate the device to account for different locations of the Bluetooth chipset on the printed circuit board (PCB) for different models of the smartphone.We provided a calibration option on the scanner application that allows the user to calculate the calibration offset, which is used for adjusting the measurements on every consecutive scan.
The algorithm for estimating the calibration offset is the same as the DOA estimation algorithm but measured from one location.The calibration process can be started by placing the BLE beacon approximately 1 m away from the scanning location, pointing the scanner device directly at the beacon, and selecting the 'calibrate' button on the application.Algorithm 1 provides the detailed step-by-step instructions of this process.At the end of the process, the scanner application is calibrated to mitigate the position of the Bluetooth chipset, and the offset angle is remembered for future scans.

Measurement Procedure
As described in Section 5.4, one measurement consists of two scans from locations that are separated by a distance of d ss .The measurement results in a heading direction, which provides the DOA of the BLE beacon.This estimate can be used by the user to move closer to the beacon and take another measurement if required.To start the estimation of DOA using the calibrated scanner application, the user must select 'Start Scanning', which will start concurrently recording the RSS, heading, and timestamp information.The user rotates 360 • and selects 'Stop Scanning', which will populate the result for 'Scan1' on the scanner application.Another scan from an adjacent location will result in 'Scan 2' followed by the DOA estimate labeled as 'Beacon angle'.After navigating in the direction provided by 'Beacon angle', another measurement can be made if necessary to get closer to the beacon.The scanner application notifies the user if the beacon is within 1-2 m, allowing them to look for the beacon physically.
Algorithm 2 describes in detail the measurement procedure for DOA estimation using the scanner device.

Experimental Results
To validate the accuracy of our proposed denoising algorithm, we conducted some experiments to simulate the finding of a lost item attached to the BLE beacon in a home environment.This involved placing the beacon at a known location, using the scanner device to scan the beacon, and logging the number of steps required to reach it.In the following sections, we first demonstrate the gradual impact of the denoising algorithm using data at one measurement location, show the results of two experiments in realistic conditions, and finally, provide the accuracy and error range of the algorithm by considering multiple measurement scenarios.

DOA Estimation
The denoising algorithm presented in Section 5.4 uses the raw data from two individual scans at a measurement location and undergoes multiple steps to achieve an RSS profile over heading.For this part of the research, we placed the beacon at a height of 1 m above the ground and recorded one measurement (two individual scans separated by distance d ss ) from the scanner device at a distance of 5 m from the beacon and plotted at different stages of the algorithm.With the distance between the scanning locations being d ss = 2 f eet, the scatter plot of the raw data for both the scans is shown in Figures 9 and 10.The subplots show RSS over heading, RSS over time, and heading over time to better represent the scan over time and space.From these figures, it can be seen that the raw measurement data are extremely noisy, which is caused by the multipath and shadow fading effects in indoor environments, as well as various noise and interferences in the 2.4 GHz band.So, the goal of the measurement and data processing techniques proposed in this paper is to derive a reliable estimation of a target BLE device's location gradually from a series of noisy measurement data that are taken by following a well-defined procedure.The raw data must be filtered and smoothened for accurate estimation of the DOA.We first employed the time-binding step of our denoising algorithm by segmenting the raw data into consecutive bins of equal time duration δ t = 250 ms and calculating the median of data in that window.For example, at scan location 1 of this measurement, a scan time of 60 s (scan rotation speed of 1 rpm) resulted in 240 consecutive bins (N t = 240).The median of 12-13 data samples of each bin was calculated with an overlap of 50% to smooth out any noise.The scatterplots of the result of this time-based binding process are smoother with outliers removed, as shown in Figures 11 and 12.It can be seen from these plots that the RSS values are higher between 225 • and 275 • for location 1 and between 75 • and 100 • and 200 • and 300 • for location 2.
The time-bound data over equal time bins was denoised over time using the EWMA filter for both scan locations.In this research, we set different EWMA weights for the RSS and time data: w p = 0.6 and w θ = 0.9.The scatter plots of the result show clear further smoothening of the data curves and removal of noise in Figures 13 and 14   In the next step of our denoising algorithm, we combined the denoised data from both scan locations into a single dataset.The timestamp information was removed, and the resultant data, which consisted of RSS and heading information, was bound over space by segmenting the heading angles into consecutive bins of equal angular width δ θ = 5 • .The RSS data falling within each bin was combined by computing the median, and finally, the data was further smoothened by applying a moving average filter with a window size of (2L + 1) = 5.The scatter plot of the spatial bound data after applying moving average (Figure 15  For this experiment, the actual heading direction of the BLE beacon with respect to the scanner device was known to be θ 1 = 247 • at scan location 1 and θ 2 = 250 • at scan location 2. The expected DOA of the BLE signal can hence be defined as the average of these heading angles θ = 248.5 • .The error in estimation θ ϵ is the difference between the actual direction of the BLE beacon with respect to the scanner device θ and the estimated DOA θ; that is, In this experiment, the error was determined as θ ϵ = |248.5We also conducted experiments to validate the measurement method discussed in Section 6.4 at a home environment that has different layouts suitable for the experiment and is impaired by multipath radio propagation.We placed the BLE beacon in one corner of a room at a height of approximately 1 m from the ground and started the measurement process from a different room/hallway on the same floor.This section describes two experimental setups with different layouts and discusses the measurement steps required in each setup to reach the BLE beacon.

Experimental Setup 1
For the first experiment, we considered a two-room space divided by a wall with a combined size of approximately 700 sqft, as shown in the layout diagram in Figure 16.The BLE beacon was placed on a table at one end of a room, and the first measurement was started from the far end of another room (labeled as measurement 1) using a pre-calibrated scanner device.At the first location (two scans) the DOA was estimated by our algorithm as θ1 = 194.325• , and after moving in that direction by a few feet, we made another measurement (labeled as measurement 2).The new DOA estimated at this location was θ2 = 175.06• , which pointed us to the right room.By moving a few feet with the scanner pointed at the DOA, we made another measurement followed by two more with θ3 = 255.276• , θ4 = 215.026• , and θ5 = 14.96 • each taking us closer to the BLE beacon.After measurement 5, the RSS values recorded were higher due to the proximity of the scanner device to the BLE beacon, which allowed the scanner application to suggest to the user that the beacon was within reach.In this experimental setup, we were able to navigate towards the BLE beacon, which was located in a different room and roughly 40 feet away, by making 5 measurements (10 scans).The results for this experiment are summarized in Table 1.For the second experiment, we considered a three-room space connected by a hallway with a combined size of approximately 700 sqft, as shown in the layout diagram in Figure 17.The BLE beacon was placed in the corner of a room, and we started the first measurement from one end of the hallway (labeled as measurement 1) using a pre-calibrated scanner device.Similar to the first experiment, the estimated DOA after the second measurement suggested moving into the right room, and three more measurements after that took us close to the BLE beacon.The measurements for this scenario can be seen in Table 2.We conducted extensive measurements to evaluate the accuracy of the proposed estimation algorithm and the measurement method.We placed the BLE beacon at 13 different known locations with different surrounding environments and used a pre-calibrated scanner device to estimate the DOA.For a better assessment of the algorithm accuracy and to better understand the impact of multipath fading on the DOA estimation, we placed the BLE beacons no more than 3-10 m from the scanner device and took only one measurement (two scans).For all the scans, the actual known direction of the BLE beacon, the estimated DOA, and the angular error in the estimation are presented in Table 3. From the data in Table 3, θ 1 and θ 2 are the actual direction of the BLE beacon from the scanner device at 2 scan locations, θ is derived from Equation (9), θ is the estimated DOA, and θ ϵ is the angular error in estimation derived from Equation (10).
Table 3. Results with differences between the actual heading and the estimated DOA.The above data show that the average angular error is approximately 24.8 • with a maximum of 101.53 • and a minimum of 4.44 • .The histogram of the data represented in Figure 18 also shows that almost all (92.3% of the total measurements) of the estimated DOA are under 60 • and the majority (77% of the total measurements) of the estimated DOA are under 30 • error.The field of view for the central vision of the human eye is approximately 60 • , and by applying the same standards, our algorithm performs well in item-finding applications.
Our algorithm requires the data to go through four stages of denoising and filtering.The first stage requires data binding over time by finding the median among a set of N s /N t data samples within each of the N t bins, which has a complexity of O(N s log(N s /N t )), assuming N s data samples are uniformly distributed in N t time bins.The next step, denoising over time using EWMA, has a time complexity of O(N t ) since EWMA is a simple FIR filter.This is followed by data binding over space by finding the median among a set of 2N t /N θ data samples within each of the N θ bins, which has a complexity of O(N t log(2N t /N θ )), assuming 2N t data samples are uniformly distributed in N θ angular bins.Finally, smoothing over space, which is a moving average filter, has a complexity of O(N θ ).

Conclusions and Further Work
In this paper, we presented an alternate approach to finding the location of a BLE beacon for applications that involve finding missing items.An Arduino BLE 33 sense board was developed as an Eddystone BLE beacon and a scanner application was developed on an iOS device to find the beacon.By utilizing the RSS information, which is a part of the advertising packet transmitted by a beacon, and the inbuilt magnetometer and GPS of an iOS device, we were able to design an algorithm that effectively navigates the user towards the Beacon in multipath fading environments.Through experimental results, we successfully demonstrated the accuracy of the designed algorithm and the method of measurement in different layouts of a home.Our results show that, from 13 different measurements in finding a beacon using the proposed algorithm and measurement method, the estimated DOA was within 60 • of the actual direction 92.3% of the time and within 30 • 77% of the time.Additionally, the results presented in this paper can be easily reproduced with other scanner devices like Android smartphones and different BLE beacons like iBeacons or Alt-Beacons.
Although a home environment can be a good testing ground to show the effects of multipath fading, our research did not include testing in an outdoor environment or with many Bluetooth signal sources (like a crowded mall) where these effects are amplified.This research did not evaluate the battery consumption for the beacon and the scanner device (i.e., a smartphone) while capturing raw data.This evaluation can be part of an extension of this work.The newer version of Bluetooth (i.e., version 5.4) introduced additional features such as periodic advertising with response (PAwR) and encryption of advertising data, which allows for secure bidirectional communication between the beacon and the scanner.In our research, we tested with Bluetooth v5.0, which only supports uni-directional advertising.Adapting and testing our proposed algorithm and measurement method with the newer Bluetooth v5.4 by utilizing PAwR can be a good extension of this research.This research can also be extended into the field of home and warehouse robotics.

Figure 2 .
Figure 2. A smartphone is used as a scanner to take simultaneous measurements of the RSS of the BLE beacon signals and the heading direction of the phone.

Figure 3 .
Figure 3. Measurements of the RSS profile over heading direction are taken at two locations that are a small distance d ss apart.

Figure 5 .
Figure 5. Navigating towards the BLE beacon by taking measurements in 4 locations.

Figure 8 .
Figure 8. iOS application for tracking the Eddystone beacon.

Algorithm 1 :
Calibration procedure Open application; Start calibration; Stand 1 m away from the BLE beacon; Point the scanner device at the beacon; Hold scanner device steady and rotate d 360 • ; Stop calibration.

Figure 14 .
Figure 14.Scatter plot of denoised data at scan location 2.
) shows the RSS values are high between 230 • and 250 • .The DOA of the BLE beacon signal can be estimated by finding the global maximum of the RSS values over the heading direction ( θ = 252.35• ).

Figure 15 .
Figure 15.Subplot 1 (top): Plot of spatially bound data of scan locations 1 and 2. Subplot 2 (bottom): Plot after applying a moving average filter on spatially bound data.

Figure 16 .
Figure 16.Layout of the room showing the BLE beacon's location and all measurement locations.

Figure 17 .
Figure 17.Layout of the scenario with walls in between.

Figure 18 .
Figure 18.Histogram of the difference between the estimated DOA and actual direction of the BLE beacon.
1.The boundary sample at n = 0 is set without weighting, i.e., Pr [0] = P r [0] and θ[0] = θ[0].Space-time data processing and fusion method for reliable estimation of the RSS profile over heading direction.

Table 1 .
Experimental results for Layout 1.

Table 2 .
Experimental results for Layout 2.