Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
StackOverflow
xDismiss
JointheStackOverflowCommunity
Signup
HowtocalculatedistancefromWifirouterusingSignalStrength?
Iwouldliketocalculatetheexactlocationofamobiledeviceinsideabuilding(sonoGPSaccess)
Iwanttodothisusingthesignalstrength(indBm)ofatleast3fixedwifisignals(3fixedroutersofwhichIknowthe
position)
GooglealreadydoesthatandIwouldliketoknowhowtheyfigureouttheexactlocationbasedonthethisdata
Checkthisarticleformoredetails:http://www.codeproject.com/Articles/63747/ExploringGoogleGearsWiFiGeo
LocatorSecrets
editedAug25'15at17:51 askedJun27'12at0:09
MohammadArman IhabHajj
4,370 2 19 39 1,155 1 13 28
1 Thisquestionappearstobeofftopicbecauseitisaboutelectricalengineering.Isuggestmigratingto
electronics.stackexchange.comDannyVarodDec12'13at22:40
@lhabHajj,myrequirementsameasyours.Havetosolvedthisout?Pleaseshareyourideasothatother
canalsolearnfromthat.Thankyou.anddev Jun9'15at12:35
5Answers
FSPLdependsontwoparameters:FirstisthefrequencyofradiosignalsSecondisthe
wirelesstransmissiondistance.Thefollowingformulacanreflecttherelationshipbetweenthem.
FSPL(dB)=20log10(d)+20log10(f)+K
d=distance
f=frequency
K=constantthatdependsontheunitsusedfordandf
Ifdismeasuredinkilometers,finMHz,theformulais:
FSPL(dB)=20log10(d)+20log10(f)+32.44
FromtheFadeMarginequation,FreeSpacePathLosscanbecomputedwiththefollowing
equation.
FreeSpacePathLoss=TxPowerTxCableLoss+TxAntennaGain+RxAntennaGainRx
CableLossRxSensitivityFadeMargin
WiththeabovetwoFreeSpacePathLossequations,wecanfindouttheDistanceinkm.
Distance(km)=10(FreeSpacePathLoss32.4420log10(f))/20
http://stackoverflow.com/questions/11217674/howtocalculatedistancefromwifirouterusingsignalstrength 1/4
4/8/2017 geolocationHowtocalculatedistancefromWifirouterusingSignalStrength?StackOverflow
TheFresnelZoneistheareaaroundthevisuallineofsightthatradiowavesspreadoutintoafter
theyleavetheantenna.Youwantaclearlineofsighttomaintainstrength,especiallyfor2.4GHz
wirelesssystems.Thisisbecause2.4GHzwavesareabsorbedbywater,likethewaterfoundin
trees.Theruleofthumbisthat60%ofFresnelZonemustbeclearofobstacles.Typically,20%
FresnelZoneblockageintroduceslittlesignallosstothelink.Beyond40%blockagethesignal
losswillbecomesignificant.
FSPLr=17.32*(d/4f)
d=distance[km]
f=frequency[GHz]
r=radius[m]
Source:http://www.tplink.com/en/support/calculator/
answeredJun28'12at16:28
IhabHajj
1,155 1 13 28
Goodanswer,andIhaveafollowupquestion.Howaccuratearethemeasurements?InotherwordscanI
getaccuraciesintheinches/centimetersrange?ChiwdaJun5'16at9:13
Tocalculatethedistanceyouneedsignalstrengthandfrequencyofthesignal.Hereisthejava
code:
publicdoublecalculateDistance(doublesignalLevelInDb,doublefreqInMHz){
doubleexp=(27.55(20*Math.log10(freqInMHz))+Math.abs(signalLevelInDb))/
20.0;
returnMath.pow(10.0,exp);
}
Theformulausedis:
distance=10^((27.55(20*log10(frequency))+signalLevel)/20)
Example:frequency=2412MHz,signalLevel=57dbm,result=7.000397427391188m
ThisformulaistransformedformofFreeSpacePathLoss(FSPL)formula.Herethedistanceis
measuredinmetersandthefrequencyinmegahertz.Forothermeasuresyouhavetouse
differentconstant(27.55).Readfortheconstantshere.
Formoreinformationreadhere.
editedOct14'14at6:18 answeredAug21'13at14:05
Eugene MarioKutlev
77 7 1,567 3 23 39
Thanksforspecifyingthatitshouldbetheabsolutevalueofsignallevel,Iwassearchingforsometime
whatIgotwrong!YiannisTsimalis Mar24'15at14:54
@YiannisTsimalisbeginnerquestion:shoulditbeabsolutevalueorjustmultiplybynegativeone?Whatif
thesignallevelwaspositivedBm?user12202013Jan13'16at15:55
@user12202013hmmIthinkitdependsonhowyouraccesspointworks.Imean,generally,thedBm
systemindicateshownoisyyoursignalis.Ifthevalueishigher,thenthesignalisnoisier,whichmeans
actually,thatthesignalisweaker.OratleastthisishowIunderstandit..YiannisTsimalis Jan14'16at
10:13
K=32.44
FSPL=PtxCLtx+AGtx+AGrxCLrxPrxFM
d=10^((FSPLK20log10(f))/20)
Here:
http://stackoverflow.com/questions/11217674/howtocalculatedistancefromwifirouterusingsignalstrength 2/4
4/8/2017 geolocationHowtocalculatedistancefromWifirouterusingSignalStrength?StackOverflow
K constant(32.44,when f inMHzand d inkm,changeto27.55when f inMHzand
d inm)
FSPL FreeSpacePathLoss
Ptx transmitterpower,dBm(upto20dBm(100mW))
CLtx , CLrx cablelossattransmitterandreceiver,dB(0,ifnocables)
AGtx , AGrx antennagainattransmitterandreceiver,dBi
Prx receiversensitivity,dBm(downto100dBm(0.1pW))
FM fademargin,dB(morethan14dB(normal)ormorethan22dB(good))
f signalfrequency,MHz
d distance,morkm(dependsonvalueofK)
Note:thereisanerrorinformulasfromTPLinksupportsite(mising ^ ).
Example:Ptx=16dBm,AGtx=2dBi,AGrx=0,Prx=51dBm(receivedsignalstrength),CLtx
=0,CLrx=0,f=2442MHz(7'th802.11bgnchannel),FM=22.Result:FSPL=47dB,d=
2.1865m
Note:FM(fademargin)seemstobeirrelevanthere,butI'mleavingitbecauseoftheoriginal
formula.
Youshouldtakeintoacountwalls,tablehttp://www.liveport.com/wifisignalattenuationmayhelp.
Example:(previousdata)+onewoodenwall(5dB,fromthetable).Result:FSPL=FSPL5
dB=44dB,d=1.548m
Alsopleasenote,thatantenagaindosn'taddpoweritdescribestheshapeofradiationpattern
(donutincaseofomnidirectionalantena,zeppelinincaseofdirectionalantenna,etc).
Noneofthistakesintoaccountsignalreflections(don'thaveanideahowtodothis).Probably
noiseisalsomissing.Sothismathmaybegoodonlyforroughdistanceestimation.
editedJun16'16at17:49 answeredDec1'14at21:59
kestasx
821 5 14
Ok,I'mseeingalotofdifferentformulasbeingdescribedhereandmostofthemaresimilarinsomefashion.
Areyousureyouaredividingby20intherightplace(distanceeq.)?Causethatwouldjusteliminatethe20
term.intheanswersbelowthereseemtobethesignallevel(absolutevalue)isincludedinthedivision
MazzeJun15'16at8:39
Also,Don'tknowifI'mdoingthiswrong,butyourexampledoesnotseemtoreturnthecorrectvalue.I'm
gettingaveryweirddistance.Pleaseseeforyourself:WolframAlphaMazzeJun15'16at8:53
Distance(km)=10^((FreeSpacePathLoss92.4520log10(f))/20)
editedFeb28'13at22:32 answeredFeb28'13at22:10
Boaz MAX
2,699 1 14 36 21 1
1 Howdoesthischangeifdistanceismetersinsteadofkm?bubbly Jul26'13at13:56
thesimpleanswertoyourquestionwouldbeTriangulation.Whichisessentiallytheconceptinall
GPSdevices,IwouldgivethisarticleareadtolearnmoreabouthowGooglegoesaboutdoing
this:
http://www.computerworld.com/s/article/9127462/FAQ_How_Google_Latitude_locates_you_?
taxonomyId=15&pageNumber=2.
Frommyunderstanding,theyuseaservicesimilartoSkyhook ,whichisalocationsoftwarethat
determinesyourlocationbasedonyourwifi/cellphonesignals.Inordertoachievetheiraccuracy,
theseserviceshavelargeserversofdatabasesthatstorelocationinformationonthesecell
towersandwifiaccesspointstheyactuallysurveymetropolitanareastokeepituptodate.In
orderforyoutoachievesomethingsimilar,Iwouldassumeyou'dhavetouseaservicelike
SkyhookyoucanusetheirSDK(http://www.skyhookwireless.com/locationtechnology/).
http://stackoverflow.com/questions/11217674/howtocalculatedistancefromwifirouterusingsignalstrength 3/4
4/8/2017 geolocationHowtocalculatedistancefromWifirouterusingSignalStrength?StackOverflow
However,ifyouwanttodosomethinginternal(likeusingyourownrouters'locations)thenyou'd
likelyhavetocreateanalgorithmthatmimicsTriangulation.You'llhavetofindawaytogetthe
signal_strength and mac_address ofthedeviceandusethatinformationalongwiththelocations
ofyourrouterstocomeupwiththelocation.Youcanprobablygettheinformationaboutdevices
hookeduptoyourroutersbydoingsomethingsimilartothis(
http://www.makeuseof.com/tag/checkstealingwifi/).
answeredJun27'12at16:21
SuviVignarajah
4,513 15 30
thisisatrickyandchallengingtask,you'vegotmekeenonlearningmoreaboutthisaspectoflocation
services..pleasepostanynewinformation/insightyougetonthisproblem,i'minterestedinknowinghowyou
solveitSuviVignarajahJun27'12at16:23
http://stackoverflow.com/questions/11217674/howtocalculatedistancefromwifirouterusingsignalstrength 4/4