4

Using Kontakt SDK, I've implemented a simple application to monitor and range Kontakt beacons in my area. I've noticed that the reported distance of detected beacons fluctuate heavily (e.g. beacon is really at 10m but it comes back as 2m and could jump around in distance quite significantly), even if the beacon is not that far away. I've gone through the documentation and played with all the different variables on the beacon hardware side (tx power / frequency), SDK side (scan mode and related) and tried multiple devices - nothing I do seem to improve the accuracy. Just wondering if anyone might be able to point me in the right direction on what could be the issue.

I do know that a beacon signal can be vary significantly based on many factors of the environment and hardware of the receiving device itself; but, I'm at a lost how one can possibly create a user experience that is based on accurate proximity to beacons, when there doesn't seem to be a way to get consistent distance information?

Any type of guidance, input or suggestion would be greatly appreciated. Thanks.

sherman
  • 159
  • 1
  • 10

3 Answers3

6

If you are implementing in Android you face this heavy fluctuation problem because of absence of noise reduction algorithm in android. But the same you can check in IOS and the results are way better beacuse IOS supports noise reduction algo. Now there are 3 things you can do based on the received RSSI/Distance value from the beacon -

a) Implement noise reduction algorithm by yourself for your app. (I suggest this is tough one.)

b) Implement Gaussian Filter for the values you receive. What I mean is store all the RSSI/distance values you receive from the beacon in an arraylist and for every 10 values, sort it in ascending order, exclude 3 minimum and 3 maximum values and for remaining 4 values calculate the average and the average value would be your final value. (This is easy solution and reliable.)

c) Implement Kalman Filter for the values you receive. This is the best available filter till date. However it is very tough to implement than Gaussian Filter but the results from this filter are the best.

You can choose any solution from above :)

2

In addition to what davidgyoung already said: BLE is currently not a promising way to measure distances. Even just by frequency hopping the calculated distance jumps around 2-3 times the real distance when using raw data. See my Q&A to that here: Bluetooth-Low-Energy RSSI changes periodically on Android devices

It depends on your requirements: Do you want the user to stand still without moving or rotating the device for up to a minute? Also can the user avoid any moving obstacles, Wi-Fi sources nearby or other interferences? Device temperature plays a role as well. Then you can get fairly stable values by taking the median or mean. Another good option would be a Kalman filter. From that using the log-normal-shadowing model you can calculate the distance:

d=d0*10^((RSSI0-RSSI)/10n) 

The distance d is in meter, n is 2 in free space and larger 2 in real conditions. It has to be calibrated for each environment. RSSI0 is the RSSI value measured at distance d0.

If the user is supposed to move however, forget about distance. That is at least my conclusion after spending weeks on that topic.

Community
  • 1
  • 1
Chris
  • 4,238
  • 4
  • 28
  • 49
1

A few tips:

  • Set your expectations properly. Distance estimates with beacons are only estimates. They are highly susceptible to reflections, obstructions, radio noise, and varying receiver antennas on different phone models. The latter is a particular problem on Android devices.

  • Set the tranitter power as high as possible to maximize the signal to noise ratio.

  • Calibrate the beacon for the new transmitter power level.

  • Set the advertisong frequency as high as possible (10 Hz or more is best) to provide as many statistical samples of RSSI as possible. This gives less varying distance estimates.

  • Make sure your beacon is not in connectable mode. When connect able, some Android devices can only read one sample per scan cycle, typically once per second.

  • Try an off the shelf scanner app like Locate to see if it gives better estimates. If it does, you can try using the open source Android Beacon Library upon which it is based.

You'll still see variation and inaccuracies after doing all these things, but you will maximize the results that are possible. Distance estimates are most useful for determining which beacon is closest when several are visible. They are less useful for measuring absolute distance.

davidgyoung
  • 63,876
  • 14
  • 121
  • 204