2

I'm using AltBeacon library for RSSI and TxPower values.

RSSI = -90 TxPower = -83

I found that calc distance is done by using this formula:

d = 10 ^ ((TxPower -Rssi) / 10n) (n ranges from 2 to 4)

So in my case that would be (n = 2):

d = 10 ^ (7 / 10 * 2) = 2.2387211385683394

Am I doing the calculations correctly or this formula is bad? Also, if there exists better formula for calculation of distance is it possible to get a reference that is possible to use in bachelor thesis?

MaaAn13
  • 264
  • 5
  • 24
  • 54

1 Answers1

4

There are two ways to go about coming up with a formula: use (1) science or (2) engineering.

A scientific approach is to try to understand the theory of how RSSI is related to distance, and come up with a formula that predicts it based both on theory and experiments. Based on the work of others, a path loss formula similar to what you have shown is the correct approach.

However, this assumes perfect conditions and data (RSSI measurements) that are not influenced by unrelated factors to signal loss theory that gives us the equation. These factors include A/D converter errors and biases in the RSSI sensor, variations in antenna sensitivity on each of the Bluetooth radio channels, and many other factors.

Since very difficult to impossible to come up with a scientific formula to account for all of these complications, a common engineering approach is to plot a curve of RSSI vs distance, look at the curve to find a similarly shaped mathematical curve, then run a regression to come up with a formula that fits the data to that mathematical curve. That formula can then be used to convert RSSI to distance.

With this approach, it does not matter the theory, what matters is the ability to use the formula to predict distance. I used this technique on the first iPhone and Nexus 4 that supported BLE and came up with this formula It is not perfect, and works less well on different phone models. But it works better than a path loss formula suggested by science, probably because it takes into account other real world factors that a path loss formula does not. For best results, run your own regression in each device/beacon pair.

Whatever formula you use, understand that distance estimates will be poorer the further you get away as the signal to noise ratio gets weaker and the effects of obstruction and multipath get more profound. Expect reasonable results at 1-3 meters and little ability to discern between 10m and 30m.

davidgyoung
  • 63,876
  • 14
  • 121
  • 204