• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

how to calculate the distance between two mobiles using bluetoth!!!

sheckoo90

Lurker
Jun 3, 2011
1
0
hello developers how are u /??
am trying to calculate the distance between two android devices !!! using bluetoth....
i have an idea ! but i don`t know if it can be done ...
am thinking to send a request to the other device that using the same app
and this device reply immediately ! then i will have the time of this operation ... but i need to know ! the speed of bluetoth ray .. do i can calculate the distance and i also know that it`s changes between devices ! because ! the bluetoth hardware ??

any one can tell me how to do this???? using bluetoth !! between two mobiles using the same app.."my app"
 
hello developers how are u /??
am trying to calculate the distance between two android devices !!! using bluetoth....
i have an idea ! but i don`t know if it can be done ...
am thinking to send a request to the other device that using the same app
and this device reply immediately ! then i will have the time of this operation ... but i need to know ! the speed of bluetoth ray .. do i can calculate the distance and i also know that it`s changes between devices ! because ! the bluetoth hardware ??

any one can tell me how to do this???? using bluetoth !! between two mobiles using the same app.."my app"
Erm...you do know that radio waves travel at the speed of light, right? There is no way you're going to be able to detect any differences in transmission time, using a cell phone, over the short distances involved in Bluetooth.
 
Upvote 0
Erm...you do know that radio waves travel at the speed of light, right? There is no way you're going to be able to detect any differences in transmission time, using a cell phone, over the short distances involved in Bluetooth.

I just like it that the OP referred to it as a "bluetooth ray". That made me smile. :)

Theoretically you could do this. In reality you can't because you have no idea how long it's going to take just for the other phone to respond to the ping. You also don't know how long it's going to take your phone to pick up that ping response once it's sent. At best you're going to get a rough estimate. Besides, the range for BT is about 15-20 feet isn't it? Can't you just estimate from eyeballing the other device?
 
Upvote 0
I just like it that the OP referred to it as a "bluetooth ray". That made me smile. :)

Theoretically you could do this. In reality you can't because you have no idea how long it's going to take just for the other phone to respond to the ping. You also don't know how long it's going to take your phone to pick up that ping response once it's sent. At best you're going to get a rough estimate. Besides, the range for BT is about 15-20 feet isn't it? Can't you just estimate from eyeballing the other device?
I think we'd need slightly more accurate clocks than we have now, too...;)

It's sort of like timing a speeding bullet by posting a guy with a megaphone down by the target.:D And giving the shooter an hourglass.
 
Upvote 0
I think we'd need slightly more accurate clocks than we have now, too...;)

It's sort of like timing a speeding bullet by posting a guy with a megaphone down by the target.:D

I would think that you might be able to program a clock to constantly sync with an atomic clock somewhere and be accurate enough. From a purely technical standpoint, I think it MIGHT be possible. You would basically have to re-purpose both devices specifically for this task though. Practically, it's not realistic at all.
 
Upvote 0
I would think that you might be able to program a clock to constantly sync with an atomic clock somewhere and be accurate enough. From a purely technical standpoint, I think it MIGHT be possible. You would basically have to re-purpose both devices specifically for this task though. Practically, it's not realistic at all.
I think a cesium clock would be sufficiently precise (it would vibrate almost 9 times in the time required for a radio wave to travel 1 foot in a vacuum, if I'm calculating it right), but the sync would be the problem, and the phone end of things as you say. You would be syncing with the same old (relatively) imprecise phone clock, right? (Edited to add: Oops, I see you said "constantly" sync. That would be some 9 billion syncs per second to keep up with the clock. Not sure my DInc is up to that. ;))

I'm pretty sure this could be done in a controlled laboratory setting with some fairly sophisticated equipment, but a cell phone is hopelessly inadequate for the job, and in a real-world situation there are going to be a lot of confounding factors (like the fact that radio waves are emitted in all directions, and bounce).
 
Upvote 0
I'll give you an easier way: distance yourself from your other device until the connection stops, that way, you'll know you went further than 10 meters.

Problem solved.
Or else that there was a wall in the way. ;)


P.S. Wasn't there an app that was supposed to measure distances by triangulation, using the camera and accelerometer? I seem to remember the reviews were not enthusiastic.
 
Upvote 0
There is another way; if you assume that bluetooth is instant - ie over that distance the signal is recieved pretty much as soon as it's sent - you can use that to synchronise the two phones. Send an audible tone at the same time as the bluetooth sync signal and use the difference in time between the two to work out distance.

If you want to really show off you could factor in altitude from the GPS and air pressure from a weather app to make it more accurate.

Why you'd need to do it is beyond me
 
Upvote 0
Both devices would have to be syncrhonized to a VERY accurate (think Cesium) clock, and the sending device would have to precisely timestamp it's response, not from the time that it received the request or from the time that it processed the request, but from the time that the response hit the antenna. Then the receiving devic would have to do the calculation based on when the response hit its antenna, not from the time that the interrupt request received and/or processed. That just ain't gonna happen on a 1GHz cell phone. And it definitely ain't gonna happen as a generic app that works any Android phone.
 
Upvote 0
As long as you know the two signals are sent at exactly the same time you don't need any time information from the first phone - kind of like counting after lightning but yes processing delays on the reciever would bugger it up and over 10meters it's probably too close.

You could also display two white dots on the phone screen and measure the distance in pixels between them with the camera, as long as you know the model of phone you ought to be able to work out distance.
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones