Bluetooth - measure distance between two devices

I am new to applying Bluetooth technology. Therefore, I apologize in advance for what may be a naive question. My question, is it possible to get an approximate measure of distance between two Bluetooth enabled devices that will always be within 20 feet of each other? For instance, if a Bluetooth enabled device moves away from a master device can I measure the reception signal, or something, to get a sense of relative proximity to one another? If not, is there a module that would allow this can of measurement between two intelligent devices.

In general, no. A normal bluetooth module would not have that capability. Such a thing could be built, but you would need multiple antennas (for triangulation), or support built into the radio stack (in order to time responses to a specific signal).

Radio waves in air travel roughly 1,000 feet per microsecond, so the timing would be, to say the least, tricky. Given a 72 MHz device, accuracy would be VERY poor.

Why would you need triangulation if you’re only interested in straight-line distance. Theoretically, you could have a one-time calibration where you measured signal strength at a couple measured distances and then it would be interpolated on future readings.

Signal strength is not simply a function of distance. Distance is only one factor, and not even the biggest factor. Furthermore, class 1 devices are required to dynamically adjust transmit power based on signal strength.

@ godefroi -
Yes, I need a means to measure the point-to-point distance between two intelligent objects. If I cannot use Bluetooth, is there another device that allows one to do this e.g. motion detector?


Good to know about the dynamic transmit power. Thanks.

I don’t think this would work because it sounds like he wants them in near proximity. I think most GPSs that we can get are doing really good if they’re accurate within 10m.

How about infrared? Isn’t that what some of the electronic tape measures use?

We need to know more about the application.

The plan is to have up to seven physically mobile devices that will be within 20 feet of each other. The devices will perform differently based upon their relative distance to one another. Each device will be Bluetooth enabled. The design assumes one of the devices will be a central command & control system receiving information regarding each devices relative proximity to the other devices. The central command & control device would send commands to all the other devices based upon this information. The key is having each device being able collect their distance from the other 6 devices.

Why not use RFID so activate the central device. Measuring distance will be very difficult or impossible.

. The only device I could find is a area reflective motion detector that emits infrared rays from an LED. Using the reflection of those rays the sensor measures the distance to the object. Unfortunately it appears one that is small enough for my project only measures distances up to 10 cm.

@ Gus -
Curious, what is the advantage of RFID over Bluetooth? Thanks.

Using sound is a reliable and cheap way of measuring distance without triangulation.

@ JesseH -
Not sure what gadgeteer module I would use.

JessieH means something like this:

There isn’t an ultrasonic rangefinder module for Gadgeteer yet but they are very easy to connect with an Extender module. However, it’s difficult to have several of those close proximity without them interfering with each other. Also, you would be able to detect that there is an object near but you wouldn’t necessarily be able to tell which object it is (assuming they move around).

What if the master device had an IR strobe and all the children had IR detectors. If they all had a very precise RTC and they were in sync, then it would be possible for the children to report back over BT the exact time they received the strobe and the master could then calc distance. For position…well, if all the devices had strobes and detectors then the master could initiate a chain reaction where each device sent it’s strobe in sequence. This would make it possible for each device to calculate the distance of every other device. Using the combined distances from all the devices, you could triangulate with high precision the location of every other device. This may be too much for NETMF though… It will require very high real-time precision.

@ ianlee74 -
You are on to something. What if I use a series of BT commands instead of IR? As you mentioned, the master would send a BT command to each device, one at a time. When the device receives the command it would send a time sync command to the first of the six devices. It would then send a series of time stamped “ping” messages. The ping message would be a single character. The receiving device would time stamp when it received a ping. The receiving device would then send the ping time stamps back to the originating device. One could account for BT latency. The receiving device would analyze the responses and send a statistically valid average of elapsed ping times to the master. The times would translate to distances. I don’t need to know locations, just distances.

I appreciate everyones time in responding to my question. Thank you!

@ Bob: that’s exactly the scheme I was referring to:

Even assuming a 100 MHz device (faster than the Spider), assuming your timing was accurate to within one clock tick (it won’t be, not even in the neighborhood), your absolute theoretical maximum resolution would be about 10 feet, since light would travel about 10 feet per clock tick. It’s clear that this is a non-starter.

Better to use sound, where you’re looking at about 1.1 feet per millisecond. Now you’re in a range that can be measured, given native code (this is NOT going to work in managed code). This is why range finders use ultrasonic waves. They’re sound, just too high-pitched for you to hear.

One could imagine a scheme where each micro was equipped with an ultrasonic transmitter and an ultrasonic receiver. You would send a pulse, and the other micro would receive the pulse and respond with another that contained enough information to tell how long it took to process the pulse. You could then subtract that out, divide by two, and given the speed of sound (which would be approximate unless you knew the local altitude), you could work out how far apart you were.

This is how ultrasonic range finders like the Ping))) work, except that the response is an echo instead of a reply from another micro.

There aren’t RTCs that precise… even if there were, the crystal you drove the RTC with isn’t that precise. Even the best crystals that are commonly available would put you off by tens of feet. Even if your crystal was perfect for some specific temperature, it would vary enough over the normal temperature range that it would only be accurate sometimes. Light just moves too fast for these things to measure.

Measuring distance with radio waves is the same as measuring distance with light/laser. Both travel at the same speed, and are really fast.

To get any kind of resolution you need REALLY fast equipment. To get 15cm resolution you need to measure in nanoseconds, you need a timer running at 1GHz, or faster. There are other ways of measuring short times, but none of them are simple, and most are part of some doctoral theses. On top of that you need transmitter and receiver chains with extremely fast response times.

Timestamping an radio message with a time to the nearest 0.1 seconds(the fastest RTC I have seen) would give you a resolution of 30000 kilometers.