Title: Distance Measurement Shows Double the Actual Value on nRF52840

I am using an nRF52840 and  nrf52832 to measure distance, but the reported value is almost twice the actual distance. For example, when the actual distance is 1 meter, the reading is around 2 meters.

What could be causing this issue? Is there a setting or calibration step I need to adjust in the Nordic SDK?

I am currently working on this project and would appreciate a quick response.

  • You might want to say something about how you are doing the measuring. My crystal ball is out of order at the moment.

  • Thank you for your response regarding distance measurement. My actual device is placed at a distance of 1 meter, but the measured distance value is inaccurate. I would like to achieve more accurate distance measurements. What can I do to improve the accuracy?

  • Tape measure?

    No seriously I don't know as it's an area of BLE I've not focused on. What I will say is distance requires (I think) two synchronised time sources and a fast/high resolution timer needed to capture the time for the RF to travel the distance in question, in this case 1M.

    RF moves at the speed of light, 300,000km per second.

    So you need a resolution of 1/300^6. I'm impressed it can do 2M with only a 64MHz crystal.

  • Hi

    So, while what Andrew is suggesting is correct, you should be able to get far better measurements than almost a 1 meter margin of error. I assume you're using the Distance Measurement sample in the nRF Connect SDK for testing here. And the main issue when seeing large error margins here is that you need to do zero distance calibration, which is explained in the documentation of the sample here: https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/samples/bluetooth/nrf_dm/README.html#zero-distance_calibration 

    Additionally, right above it you can see a section on high precision calculations that is a config you can enable to increase the precision of your distance measurement.

    Lastly, as somewhat of a side note since the following is not supported on the nRF 52 series. On the nRF54L15, we have support for the new BLE distance measurement solution from the Bluetooth spec. called channel sounding. We have some experimental samples for that available as well here https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/samples/bluetooth/channel_sounding_ras_initiator/README.html, but it's quite a bit to dig into, so I'd suggest starting out with the technical overview of the technology available here: https://www.bluetooth.com/channel-sounding-tech-overview/ 

    Best regards,

    Simon

  • Still pretty incredible that it can do that resolution.

    Then I started thinking how it would be done without a much higher clock and I thought if the receiver was able to echo the signal with a known latency then the required clock would be half and only one precision clock would be needed. Even so that's still high but if there was multiple echoing each time would half the clock requirement at the expense of doubling the time needed to do the measurement.

1 2