Click here to Skip to main content
15,907,395 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi everybody!
I'm working on an indoor localization project! Actually it's a small project for myself. I need to know how to calculate distance between client and access point using RSSI. I have signal strength in db, as an example -15db, but I don't know how to find the distance.
I need a sample code.

Many thanks.
Updated 6-Jul-12 6:22am
lamiaa ashraf 10-Sep-17 11:19am    
I have the same problem , have you solved it .
if yes, please tell me

Can it tell you the distance? RSSI is received signal strength indicator. This will only ever be db measurement which could also subject to the Fresnel effect by lots of things, walls, windows e.t.c. There are interference issues such as microwaves e.t.c.

If you want to estimate accurately you actually have quite a complete calculation. The following is an example website which does this calculation.

Wifi Range Calculator[^]

Perhaps you could use latency but you're measuring latency against the speed of light over a short distance so I doubt the clock would be accurate enough.

Taking a scientific approach would measure the db at various distances and plot a strength v distance curve and then create formula which closely follows the curve.

Personally I think you need a mathematician to explain the calculation before working on the code.

The alternate option which considering time spent might actually be cheaper, would be to by a GPS locator.
Share this answer
aghorbanmehr 6-Jul-12 16:22pm    
Thank you for your answer.
I know everything about complexity of this calculation and I Have read a lot of articles about it. A lot of articles full of complex mathematical calculations that I couldn't understand them. But I think I should calculate the distance in an ideal situation, I mean a building without any interference and noises. I should place three access points in 1,6 and 11 channels in three different places of this area. Then my application should be installed on a laptop and it should indicates the place of the laptop (approximately).
I'm trying to find an algorithm or sample code that calculates this distance.
Member 10298029 25-Sep-13 21:39pm    
Hi,how about your project goes these days? how about the accurency for example in 50 meter squrer?Thank you!
Jaxam 19-Apr-13 16:16pm    
I am having the same problem of trying to locate where my laptop is in the building i am in. Assume that I know the exactly location of where each access point is and also assume that the enviroment is interference free, ie. no wall, no other magnet around, how would i calculate the distance base on the rssi?

lamiaa ashraf 10-Sep-17 11:18am    
I have the same problem , have you solved it .
if yes, please tell me
try below link, it may help you.
Share this answer
Hi everyone!,
I have the same question for my assignment.

I do not know how to find the distance from RSSI ?
I need the formula to get distance from RSSI and then find exact location using Trilateration.

I need to get to know the logic first and afterwards code this in JAVA.

Thank you for your help in advance.
Share this answer
Have you got the solution?
If yes pls share....
Share this answer
how to find distance using signal strength?
when WIFI release its signal ,they are oscilating in environment. distance travelled by signal is depends up on the strength of the signal. may due to obstacles signals loss their power.(signal energy is observed by bodies)
when user get a signal strength(for example -25db)at some distance d,
then by using equation

d=10^((27.55-20*log(base10)(frequency)+signal strength)/20)
note: this distance is from wifi box to user
Share this answer
OriginalGriff 14-Feb-20 4:22am    
Two things:
1) While I applaud your urge to help people, it's a good idea to stick to new questions, rather than 7 year old ones. After that amount of time, it's unlikely that the original poster is at all interested in the problem any more!
Answering old questions can be seen as rep-point hunting, which is a form of site abuse. The more trigger happy amongst us will start the process of banning you from the site if you aren't careful. Stick to new questions and you'll be fine.

2) You're assuming that the WiFi field is omnidirectional, and that isn't generally the case - the aerials in the router generate a "pancake" shape field that is thicker than it is high to increase signal strength in the horizontal plane. Since most devices are in the plane or slightly above or below it, you get a "better signal" through most of the used environment that way that you would with a "globular" signal.
So the Db measurement is not the only thing you'd need - you'd need the vertical angle as well.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900