Search code examples
androiddistancebeacon

what is the formula to get distances by beacon?


I noticed there are two formula to get distance by beacon LINK

(1)d = 10^((Measured Power - Instant RSSI)/10*N)

N is the constant for the environmental factor. It takes a value between 2-4. The measured power is the RSSI value at one meter.

This is another formulaLINK:

 (2)d=A*(r/t)^B+C 
  r is the RSSI measured by the device and t is the reference RSSI at 1 meter. A, B, and C are constants.

Which one is the formula I should use? Or Are these two formulas equivalent?


Solution

  • The first formula is from physics for calculating path loss or radio waves. Use the first formula if you are making theoretical calculations for academic purposes.

    The second formula is a power curve that has a similar shape. It is useful for simulating the first formula when need to do a curve fit, because it is supported by a number of statistical software packages (the first formula is generally not supported to do this). Use the second formula if you need to calculate the curve fit for measured data points of distance vs. RSSI for one or more Bluetooth receivers.

    The Android Beacon library uses the second formula in order to best match distance vs. RSSI for various phone models.