Detecting Moving Beacons

There’s a new question at GrindSkills on Can Bluetooth beacon be detected while it’s in motion? This deals with similar issues to our previous post on Using Bluetooth to Measure Travel Time.

Both scenarios don’t consider the scanning and advertising periods. Our previous post on Why Bluetooth LE Scanning Doesn’t Always See Devices (the First Time) explains the relationship between these timings.

In order to reliably detect moving beacons it’s necessary to scan more often and have smaller gaps between scanning. Also, if you have control over the advertising device, more frequent advertising will make detection more reliable.

BeaconZone Consultancy

Managing Bluetooth LE Advertising Congestion

Bluetooth LE advertising congestion happens when there are too many Bluetooth devices in an area. As we will show, this rarely happens but with new Bluetooth technologies this situation is becoming more likely. We provide some ways to mitigate congestion.

Bluetooth LE advertising transmits periodically the period of which is configurable from typically 100ms to about 10 seconds.

Bluetooth LE advertising (from Bluetooth SIG)

If two Bluetooth devices happen to transmit at the same time, it’s like two people shouting at the same time. The signal is corrupted, the receiver can’t make sense of the signal and it is lost. This usually doesn’t matter because it’s likely the signal is seen the next time it is sent. The random advDelay in the above diagram ensures that the two sends don’t clash again. It’s very unlikely advertisers clash in the first instance because the transmit duration is very small compared to the advertising period. The above diagram isn’t to scale. Here’s an oscilloscope trace showing some real timing:

The advertising duration is very small, of the order of 1 to 2 ms (milliseconds). Advertising is also sent three times, on three different radio frequencies, so that if one is blocked, the radio signal might be heard on one of the others. All this means that advertising collisions rarely occur.

However, there are some newer Bluetooth protocols that as they are starting to roll out, are making collisisons more likely:

  • Bluetooth 5 advertising extensions – This allows advertising of more data, that takes longer than the typical 1 to 2 ms and hence increases congestion.
  • Bluetooth longer range – This transmits further thus effectively increasing the number of beacons advertising in a given area.
  • Bluetooth Mesh – This works by having relay beacons listen and re-transmit advertising, usually several times, to improve reliability.
  • Bluetooth direction finding – This also has longer advertising to send a constant tone extension (CTE) that is received by AoA hardware. However, of more affect is advertising more frequently. While beacons on assets used to advertise typically every second or longer, direction finding tends to use faster advertising to improve latency.

You can check how many devices are advertising by using a scanning app on Android. We recommend Nordic Semiconductor’s nRF Connect because it can decode the latest Bluetooth protocols. Use Android for full visibility because Apple made the poor design decision to obfuscate iBeacon advertising to coerce developers to only use the Apple iBeacon-specific APIs. Apple also hides devices’ MAC addresses making them more difficult to physically identify.

If you have a problem with congestion you might be tempted to increase the transmission power or advertise more often to increase the chances of being seen. However, this is counter-productive because you will be increasing congestion, especially if your devices are the main contributor to the congestion.

Instead:

  • Lower the transmit power so that beacons cover a smaller area. You can fine tune this using nRF Connect to measure the distance you need rather than needlessly advertising further. This will also conserve battery life.
  • Increase the advertising period to make collisions less likely.
  • Increase the receiver scanning period to make detections more likely.
  • Seek out and remove unwanted devices advertising too frequently, such as fitness devices, smartphones, displays and even cars.

Need more help? Consider our consultancy services.

Battery Power Use When Advertising Multiple Bluetooth LE Channels

Most beacons can transmit more than one type of advertising , for example iBeacon, Eddystone and sensor data. In practice, no beacon can send more than one kind of data simultaneously. Instead, they send the different data sequentially, one transmission very shortly, milliseconds, after the other. Many manufacturers describe this as sending data in different channels which shouldn’t be confused with different Bluetooth LE frequency channels used to reduce the affects of wireless interference.

Some devices such as Minew and Sato can send 6 channels that can include iBeacon, Eddystone UID, Eddystone URL, Eddystone TLM, sensor, acceleration and device info:

Sato setup: Channel types are shown at the bottom

Transmitting one type of data takes of the order of 1 millisecond (ms) every configurable 100ms to 10secs period. It’s during the sending that the majority of the battery power is used with the beacon sleeping between transmissions. The following oscilloscope trace shows the battery power used, over time, with one channel:

Care should be taken to configure only those types of data that are required. If you configure more than one channel then there’s a corresponding, almost linear, increase in use of battery power for every extra channel.

Bluetooth LE Advertising Channels

Bluetooth LE works at 2.4GHz, the same frequency used for WiFi and microwave ovens! There are two main types of Bluetooth LE transmission: advertising where the device only sends out data and connection-orientated using Generic Attributes (GATT) .

Bluetooth LE uses frequency hopping for increased reliability when there might be noise on a particular channel. When advertising, it uses channels 37, 37 and 39. If subsequently connected, it uses other channels:


Frequency Channels from RF Wireless-World

When only advertising, the transmission is very short of the order of 1 or 2 milliseconds. In between advertising, there is no transmission which is one of the main reasons why Bluetooth LE has very low power use:

Power use over time

Read about Choosing an Advertising Interval

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.