Using iBeacon to Assess Elderly Frailty

There’s a research paper by Thomas Tegou, Ilias Kalamaras, Markos Tsipouras, Nikolaos Giannakeas, Kostantinos Votis and Dimitrios Tzovaras of Information Technologies Institute, Greece on A Low-Cost Indoor Activity Monitoring System for Detecting Frailty in Older Adults.

The paper describes a room-level accuracy indoor localization system, based on Bluetooth RSSI, to assess the frailty in older people.

The implementation used smartphones as detectors:

The researchers identified features to classify degrees of movement between rooms:

The system was able to determine rooms to an accuracy above 93%. The results showed subjects with frailty had distinctive movement patterns that could be identified with high accuracy of 98%.

Read about Beacon Proximity and Sensing for the Internet of Things (IoT)

Bluetooth LE on the Factory Floor

Connected factory implementations require a large number of connected assets for condition-based monitoring, asset tracking, inventory (stock) management or for building automation. Bluetooth is a secure, low cost, low power and reliable solution suitable for use in connected factories. In this post, we examine the reasoning behind some out-of-date thinking on industrial wireless, uncover the real problems in factories and provide some explanations how Bluetooth overcomes these challenges.

Operations teams are usually very sceptical about industrial wireless. They have usually tried proprietary industry solutions using wireless with mixed results. They might have experienced how connections, such as WiFi, can become unreliable in the more electrically noisy areas of factories. The usual approach is to use cable. However, this can become expensive and time consuming. Using cable isn’t possible when assets are moving and becomes impractical when the number of connected items becomes large as in the case of connected factories. As we shall explain, Bluetooth is intrinsically more reliable than WiFi even through they share the same 2.4GHz frequency band.

There’s usually lots of electrical noise in an industrial environment that tends to be one of two types:

  • Electromagnetic radiation emitted by equipment. This typically includes engines, charging devices, frequency converters, power converters and welding. It also includes transmissions from other radio equipment such as DECT phones and mobile telephones.
  • Multipath propagation which is reflection of radio signals off, usually metallic, surfaces and received again slightly later.

It’s important to understand how Bluetooth and other competing technologies react to these types of interference. There’s a useful study (pdf) by Linköping University, Swedish Defence Research Agency (FOI) and the University of Gävle on noise industrial environments.

Noise in industrial environments tends to follow the following spectral pattern:

Electrical noise spectrum

There’s usually lots of electrical noise up to about 500MHz. This means wireless communication using lower frequencies, such as two way radio, exhibits a lot of noise. Pertinently, several wireless solutions for industrial applications use frequencies in the 30–80 MHz and 400–450 MHz bands. Bluetooth’s and WiFi’s 2.4GHz frequency is well above 500MHz so exhibits better reliability than some industrial wireless solutions. Incidentally, in the above charts, the peaks around 900 MHz and 1800 MHz mobile phone signals and 1880–1890 MHz come from DECT phones.

The magnitude of multipath propoagation depends on the environment. It’s greatest in buildings having highly reflective, usually metallic, floors, walls and roofs. If you imagine a radio signal wave being received and then received again nanoseconds later, you can imagine how both the amplitude (peaks) and the phase of the received signal becomes distorted over time. Bluetooth uses Adaptive Frequency Hopping (AFH) which means that packets transferred consecutively in time do not use the same frequency. Thus each packet acts like a single narrowband transmission and there’s less affect of one packet on the next one. However, what is more affected is amplitude which manifests itself as the received overall signal strength (RSSI). RSSI is often used by Bluetooth applications to infer distance from sender to receiver. We will mention mitigations for varying RSSI later.

It’s important to consider what happens when there is electrical noise. It turns out that technologies invented to ensure reliable transmission behave much less well in noisy situations. One such technique is carrier sense multiple access (CSMA), used by WLAN (WiFi), that listens to the channel before transmitting and waits until a free channel is observed. CSMA and automatic auto repeat (ARQ) also have re-transmission mechanisms. The retrying can also incur significant extra traffic that can overwhelm the communication in noisy environment. Bluetooth doesn’t use such schemes.

The previously mentioned research classifies different wireless technologies according to the delay when used in noisy environments:

Bluetooth (and WISA) is a good choice for noisier environments. It’s particularly suited for applications with lower data rates and sending at periodic intervals.

A final consideration is interference between Bluetooth and other technologies, such as WiFi, that use similar 2.4GHz frequencies. As mentioned in a previous post, there’s negligible overlap between Bluetooth and WiFi channel frequencies.

In summary, Bluetooth is more suited to electrically noisy environments and also offers low cost, low power and secure wireless communication.

These conclusions correlate well with our own empirical observations. We have found that Bluetooth advertising is still received in environments we have measured, using a RF spectrum analyser, to be electrically noisy around 2.4GHz . We believe this is because Bluetooth advertising hops across three frequencies such that there’s less likelihood of noise on all three. Advertising is also very short, typically taking 1 or 2 ms, making the coincidence of the noise and the advertising less likely than would be the case of a longer transmission.

It has been our experience that solutions using Bluetooth advertising are more reliable than those using Bluetooth (GATT) connections, especially in noisy environments when it’s difficult to maintain the chatty protocol of a connection over a long time period. In noisy situations, advertising is usually seen on a future transmit/scan if the first advertising is lost. By coincidence or design, Bluetooth Mesh is built on communication via advertising rather than connection and for this reason is also reliable on the factory floor.

However, using Bluetooth isn’t a silver bullet. There are situations where factories, or more usually parts of factories, have reflective surfaces or unusual radio frequency (RF) characteristics stretching into unforeseen frequencies. Poorer performing WiFi also needs to be considered in context of choosing between Ethernet and WiFi gateways and Bluetooth mesh.

It’s important to do a site survey including RF spectral analysis. This will uncover nuances of particular critical locations or coverage that can drive subsequent hardware planning. It can also feed into requirements for software processing, for example particular settings for processing within a real time locating system (RTLS) to cater for more varying RSSI.

Consider a Feasibility Study if you need expert help.

Read about Beacons in Industry and the 4th Industrial Revolution (4IR)

New Bluetooth Direction Finding Feature

A new direction finding feature has been released for Bluetooth 5.1 (pdf). Using more than one antenna, as used by Quuppa, allows for direction finding.

The paper on Enhancing Bluetooth Location Services with Direction Finding explains how location services currently use RSSI to estimate the distance. Direction finding introduces more advanced Angle of arrival (AoA) and angle of departure (AoD) techniques into Bluetooth 5.

“Should smartphone vendors choose to include Bluetooth direction finding with AoA support in their products, item finding solutions could be enhanced to provide directional information.”

As with the move from Bluetooth 4 to Bluetooth 5 it’s going to be while before we see (non Quuppa) products with direction finding. This feature requires specific hardware and software. Before that, it needs SDKs from the SoC vendors. Existing smartphones, beacons and gateways won’t be able to be upgraded.

Read about Using Beacons, iBeacons for Real-time Locating Systems (RTLS)

Testing if a Beacon is Working

It’s often the case you need to know if a beacon is working and advertising the correct information. It’s also sometimes necessary to differentiate between beacons, based on their signal strength, so you know you are setting up the correct beacon. Other times, you might want to know a beacon’s MAC address.

The best scanning app is Nordic nRF Connect that’s written by the manufacturer of the System on a Chip (SoC) in most beacons. Nordic nRF Connect detects all beacons and indeed all Bluetooth LE devices, irrespective of the SoC manufacturer because it just looks for standard Bluetooth advertising. nRF Connect is intelligent in that it works out the kind of beacon and displays the appropriate type of information.

It’s important you use the Android version of nRF Connect. Due to over-zealous efforts by Apple to hide identities, it’s not possible for iOS scanning applications to see advertising iBeacon (UUID, major and minor) information nor the Bluetooth MAC address.

Here’s an example scan:

In the above screenshot you can an iBeacon that has been tapped on to show extra information. All devices have the MAC address and a Received Signal Strength Indicator (RSSI). The MAC address uniquely identifies the device.

Devices that scan for beacons will experience a signal strength (RSSI) that varies depending on the distance to the beacon. It’s expressed in dBm and is always negative. A more negative number indicates the beacon is further away. A typical value of -10 to -30 dBm indicates the beacon is close. A typical value of -110 indicates the beacon is near the limit of detection. You can use this to determine which beacons are closest. You usually configure beacons when they are right next to the phone and have a higher, less negative, RSSI.

nRF Connect also shows the advertising period that’s based on how often the app sees the advertising as opposed to what has been set in the beacon. The value is rarely exactly what you have set because Bluetooth requires some randomisation of the advertising period to reduce the possiblity of collisions between devices, in the vicinity, that are set to the same period. Also, being wireless, not all advertising is seen which causes jumps in the shown advertising period. Read more about choosing the advertising period.

There’s also a ‘RSSI at 1m’ which is the beacon’s self-declared value, in the advertising data, of what the RSSI should be at 1m. This can be used by scanning devices, such as apps, as a form of calibration for determining distance. In most cases this value isn’t used and should be ignored. Read more about power and the measured power calibration value.

Hybrid Localisation Method

In our previous article iBeacon Microlocation Accuracy, we wrote about ways of using beacon RSSI to determine location. However, what if you were to use and combine beacon RSSI with other ways of locating to create a hybrid method? This is the topic of a new research Unsupervised Indoor Localization Based on Smartphone Sensors, iBeacon and Wi-Fi by Jing Chen Yi Zhang and Wei Xue of Jiangnan University, School of Internet of Thing Engineering, China.

The paper describes UILoc a system combining dead reckoning, iBeacons and Wi-Fi to achieve an average localisation error is about 1.1 m.

The paper also compares the trajectories obtained using different localisation schemes:

Obtaining Distance from RSSI

RSSI is the signal strength at the Bluetooth receiver. The signal type, for example, iBeacon, Eddystone or sensor beacon is irrelevant. The value of the RSSI can be used to infer distance.

The accuracy of the distance measurement depends on many factors such as the type of sending device used, the output power, the capability of the receiving device, obstacles and importantly the distance of the beacon from the receiving device.

The output power isn’t known to the receiver so it’s sometimes added to the advertising data in the form of the ‘measured power’ which is the power at 1m from the sender.

The closer the beacon is to the receiver, the more accurate the derived distance. As our article mentions, projects that get more detailed location derived from RSSI, usually via trilateration and weighted averages, usually achieve accuracies of about 5m within the full range of the beacon or 1.5m within a shorter range confined space.

There’s some Android Java code on GitHub if you want to experiment with extracting distance from RSSI. There’s an equation for iOS on GitHub.

Need more help? Consider a Feasibility Study.

Beacons that flash/vibrate at a given distance.

Research Paper on Using Bluetooth for Indoor Locating

There’s a paper by Mariusz Kaczmarek, Jacek Ruminski and Adam Bujnowski of Gdansk University of Technology on the Accuracy analysis of the RSSI BLE SensorTag signal for indoor localization purposes (pdf).

They studied the radio signal from multiple Texas Instruments SensorTag CC2650 devices in order to determine if it could be used to determine location.

They concluded:

“Given the large number of factors governing the received RSSI, calibration is unlikely to be able to compensate for all of
them, leading us to conclude that there is an inherent limit to the accuracy of a BLE positioning system especially when multiple devices are used.”

They suggest:

…that instead of using a single RSSI measurement to estimate distance, try using the average or median value of N measurements collected on the same spot (at least N>20) so that you can reduce the effect of small scale fading.

Improving on Beacon Immediate, Near and Far

We recently highlighted an article on Beacon Trajectory Smoothing. Faheem Zafari, Ioannis Papapanagiotou, Michael Devetsikiotis and Thomas Hacker have a new paper on An iBeacon based Proximity and Indoor Localization System (pdf) that also uses filtering.

They use a Server-Side Running Average (SRA) and Server-Side Kalman Filter (SKF) to improve the proximity detection accuracy compared to Apple’s immediate, near and far indicators.

The researchers found:

The current (Apple) approach achieved a proximity detection accuracy of 65.83% and 67.5% in environment 1 and environment 2 respectively. SRA achieved 92.5% and 96.6% proximity detection accuracy which is 26.7% and 29.1% improvement over the current approach in environment 1 and 2 respectively

What’s interesting here is that the researchers have quantified the accuracy of Apple’s implementation in two scenarios. The accuracy isn’t that good and as the researchers have shown, can be improved upon significantly.

Beacon Trajectory Smoothing

The problem with using RSSI for detecting location is that raw data contains lots of noise. Also, this noise becomes more prevalent in the viewed data when location samples are taken less often. There’s a useful new article at InfoQ on Processing Streaming Human Trajectories with WSO2 CEP.

The idea uses Kalman filtering to smooth noisy human trajectories.

Before and after filtering

This method is particularly useful for large realtime IoT rollouts because it uses a very small memory resource, is very fast and the calculation is recursive, so new values can be processed as they arrive.