1

I did some brief search on the matter, but it doesn't really help. I want to detect when people approach each other too closely, and - possibly, in the future - leave too great a distance between one another.

All are very interesting articles, and I suppose that I could always build them all & take my own measurements, but would rather save the time, if it is not going to be very accurate, so I am hoping that someone here can speak from experience.

Ideally, I would prefer BLE 5.1, for AOA / AOD, to get extreme accuracy - and direction - but ESP32 doesn't have that, nor is it likely to any time soon (unless I can add it on, somehow? related question)

How accurate would it be if I want to know when two devices approach within 1 metre, 2m, 5m, 10m? And what about far away, towards the edge of reception?

I want to achieve this with something wearable, so like the look of the LILYGO® TTGO T-Wristband DIY Programmable Smart Bracelet

enter image description here

but the actual hardware is for another question, maybe another site.

Does anyone have any experience in this? Can you provide an approximation of granularity of measurement at various distances?

2

Haven't tried it myself, but a few things to consider:

  • If you had the two devices with line of sight to each other in a very very large open space, then there should be a direct relationship between RSSI and distance. However that is nearly never the case. With obstacles, reflections, multipath, and more, there's significant variation in the observed RSSI.

  • Take your favorite phone, and download a BLE scanner on it, which shows RSSI (e.g. nRF connect, but there are tons of others). It'll probably discover a good handful (or a wheelbarrow, depends) of devices around here. Observe the RSSI variations of any device while not moving at all. You'll notice that spreads which are easily over 10 dBm, sometimes a lot more. Remember that 3 dBm means a factor of 2 and 10 dBm a factor of 10. Note however that you can't compare the readings of two different devices: different TX power, different antenna...

  • Now start moving your phone. Turn around so that you are between the device and the phone. You can keep your phone in the same place and observe a drop in signal strength.

So no, you can't get any sort of accurate distance just from the RSSI, though you can get a vague idea.

Another reference point: Apple's Core Location framework, when it reports a beacon, only reports the following proximity values (iBeacons advertise a calibrated RSSI at 1 m to assist):

  • The proximity of the beacon could not be determined.
  • The beacon is in the user’s immediate vicinity.
  • The beacon is relatively close to the user.
  • The beacon is far away.

They state:

Ranging reports when the two devices are far apart, near to each other, or in the immediate vicinity of each other; it does not offer a precise distance, nor should you rely on the strength of a beacon's signal to compute that information yourself.

So after experimenting with a pair of your own devices, you could determine a threshold over which you are sure that the devices are within a given distance. Depending on your goal, you could be very lax or very restrictive, it's up to you. But don't expect something more accurate than "very close", "quite far" and "somewhere in between".

(Things are different if you have multiple beacons in range and a fingerprint of the area, but that's a completely different topic).

As for max range, that depends a lot on TX power, antennas, sensitivity, cases, relative position, and most importantly obstacles. I've seen BLE devices unable to talk to one another beyond a few short meters, and I've detected BLE devices 20 meters away across many obstacles, possibly more. Only experiments with your chosen devices in the target environment/context will get you a better sense of what is possible.

Without obstacles with high TX power devices you can supposedly reach hundreds of meters with line of sight, but of course this is a scenario that never happens.

One important thing to note is that for detection to happen, you need to advertise and scan. Battery-operated ESP32-based devices are pretty bad at that, as unless I missed something, you can't do that in combination with deep sleep. So you get a pretty high power consumption, and you probably won't last more than a few hours on any battery that would fit in a wrist-mounted case.

Nordic Semi chips of the nRF5 series are better at that, though there are quite a few other options. Wrist-mounted options based on the nrf52832 include Espruino's Bangle.js, though it features quite a few things you might not need (GPS, heart rate monitor, accelerometer, magnetometer...).

9
  • Thanks for an *excellent and informative answer (+1). "o, you can't get any sort of accurate distance just from the RSSI, though you can get a vague idea" confirms my suspeicions d put me off even starting with ESP32, although "experimenting with a pair of your own devices, you could determine a threshold" might be worth investigating. I suspected that I woudl ahve to go Nordic, and you suggestion, although 4 tiemsa s expensive, has BLE 5.2, so AOA and AOD. I will probably go with that, price as it is. Shoudl keep me busy for a few months :-) Jan 12 at 10:45
  • 1
    @MawgsaysreinstateMonica remember that AOA/AOD require a phased array antenna on top of support by the chipset. IIRC the phased array antenna is on one side for AOD and on the other for AOD. Also remember that AOA/AOD do not directly solve the distance issue: they tell you the direction instead. This is useful for precise geolocation if you have several fixed beacons/gateways as you can do (supposedly more accurate) triangulation rather than (inaccurate) trilateration. Haven't played with any that yet, though...
    – jcaron
    Jan 12 at 11:50
  • 1
    Note that I don't think the Bangle.JS has support for the AoA/AoD features (pretty sure it doesn't). There are lots of Espruino BLE tutorials here: espruino.com/Bangle.js#tutorials Documentation for NRF.setAdvertising: espruino.com/Reference#l_NRF_setAdvertising
    – jcaron
    Jan 12 at 12:07
  • 1
    There's an excellent document about BLE direction finding here: bluetooth.com/wp-content/uploads/Files/developer/… It's very detailed!
    – jcaron
    Jan 12 at 12:09
  • 1
    @MawgsaysreinstateMonica I'm not even sure there are actually any devices out there with AoA/AoD support yet. Lots of talks about it, chips that support it, but I have yet to see a full device. I haven't searched a lot though so I may have missed it. If you want to locate people (or rather, phones) in pre-defined area then there are solutions involving beacons, fingerprinting, KNN, etc. which provide reasonable accuracy. But you need to install and maintain hundreds if not thousands of beacons for proper coverage.
    – jcaron
    Jan 12 at 12:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.