Finding distance from RSSI value of Bluetooth Low Energy enabled device

后端 未结 4 1126
Happy的楠姐
Happy的楠姐 2020-11-28 02:26

I am working on Bluetooth low energy concept project. I am getting the RSSI value between 1 and 100. As I move the tag the RSSI value increase as the peripheral moves away

相关标签:
4条回答
  • 2020-11-28 02:39

    Finding distance from RSSI is bit tricky and it depends on lots of factors, even test environment and antenna orientation etc. Following paper is having some study regarding the same http://www.s2is.org/Issues/v1/n2/papers/paper14.pdf

    0 讨论(0)
  • 2020-11-28 02:52

    I answered this in another thread, repeating it here.

    In line-of-sight (no obstacles causing change in RSSI), -6dB seems to be double the distance.

    If you at 1m distance read RSSI -40dB then 2m gives -46dB, 4m gives -52dB, 8m gives -58dB, 16m gives -64dB.

    You can not get an exact position, only a circular maximum distance.

    Using triangulation with 2-3 or more devices you get a much more accurate positioning result. You can get this purely from Advertisement packages but you must either Disable scan -> Enable scan or tell iOS CoreBluetooth to report all adv packages.

    In foreground mode you can do this but in background mode you can't get all adv packages. You must connect and read RSSI to do it in the background.

    0 讨论(0)
  • 2020-11-28 02:54

    There are quite a number of RSSI-based localization techniques like triangulation and fingerprinting. None of them are perfect. RSSI is affected by many factors like obstacles, multipath fading, antenna polarization and cross-body shielding.

    The theoretical relationship between RSSI and distance is something like this:

    RSSI[dbm] = −(10n log10(d) − A) 
    

    where d is the distance and A is the offset which is the measured RSSI 1 meter point away from the BLE device.

    Simply google for RSSI[dbm] = −(10n log10(d) − A) and you will find some sources about it.

    0 讨论(0)
  • 2020-11-28 02:54

    In swift 4.2

    func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral, advertisementData: [String : Any], rssi RSSI: NSNumber) {
    if let power = advertisementData[CBAdvertisementDataTxPowerLevelKey] as? Double{
       print("Distance is ", pow(10, ((power - Double(truncating: RSSI))/20)))
       }
    }
    

    More detailed answer Here

    0 讨论(0)
提交回复
热议问题