Wi-Fi DISCUSSION

Can I estimate distance from Wi-Fi RSSI on an ESP32, and what do the dBm values mean?

Started by afiq RSSI distance estimationpath loss modeldBmWi-Fi signal strengthindoor positioning
5 replies 248 views 6 participants
Latest activity · 30 Sep 2026

Can I estimate distance from Wi-Fi RSSI on an ESP32, and what do the dBm values mean?

afiq Wi-Fi Forum
#1

I read WiFi.RSSI() on an ESP32 and get values such as -48 near the router and -75 two rooms away. I would like to turn this into an approximate distance for a simple indoor location project, and found formulas using a "path loss exponent" that give very different answers depending on the constants.

What exactly does the RSSI number represent, which formula is appropriate, and how accurate can distance from RSSI be in practice?

Community replies 5

Re: Can I estimate distance from Wi-Fi RSSI on an ESP32, and what do the dBm values mean?

#2

The value is received signal power in dBm, decibels relative to 1 milliwatt: P(dBm) = 10 × log10(P / 1 mW). So -30 dBm is 1 µW, -60 dBm is 1 nW and -90 dBm is 1 pW. Every 3 dB is a factor of two in power, every 10 dB a factor of ten.

As a rough guide for Wi-Fi, around -50 dBm or better is a strong signal, -70 dBm is usable, and below about -80 dBm links become slow and unreliable; the exact sensitivity depends on the data rate and is listed in the module datasheet. Strictly, RSSI in the 802.11 standard is a relative indicator that each chipset may define in its own way, but the ESP32 API reports it as an estimate in dBm.

Re: Can I estimate distance from Wi-Fi RSSI on an ESP32, and what do the dBm values mean?

#3

The usual model is log-distance path loss: RSSI(d) = A - 10 × n × log10(d), where A is the RSSI measured at 1 m and n is the path loss exponent. Solving for distance: d = 10^((A - RSSI) / (10 × n)), in metres.

In free space n = 2, and the loss at 1 m for 2.4 GHz is about 40 dB, from FSPL = 20 × log10(d) + 20 × log10(f) - 147.55 with d in metres and f in hertz. Indoors n is typically between 2.5 and 4 depending on walls and furniture. Example with A = -40 dBm and a reading of -70 dBm: with n = 2 the formula gives 10^(30/20) = 31.6 m, with n = 3 it gives 10^(30/30) = 10 m. The answer depends heavily on a constant you can only get by measuring your own building.

Re: Can I estimate distance from Wi-Fi RSSI on an ESP32, and what do the dBm values mean?

#4

The accuracy is poor, and it is important to know why before building on it. Indoors the receiver gets many reflected copies of the signal that add or cancel depending on position; moving the antenna by half a wavelength, about 6 cm at 2.4 GHz, can change the reading by 10 dB or more. A person walking through the path, a door closing or a change in antenna orientation does the same. With n = 3, a 6 dB error changes the distance estimate by a factor of 10^(6/30), about 1.6.

So RSSI ranging gives you zones (same room, next room, far) rather than metres. Expect errors of several metres indoors even after calibration.

Re: Can I estimate distance from Wi-Fi RSSI on an ESP32, and what do the dBm values mean?

#5

To get the most out of it, calibrate A and n on site by recording RSSI at known distances, for example 1, 2, 4 and 8 m, and fitting a line against log10(d). Average many samples, or better, take the median over a second or two, because individual readings are noisy.

Use several fixed access points or beacons and combine them: trilateration with three or more anchors or, more robustly, fingerprinting, where you record the RSSI pattern at known spots and match against it later. Keep the antenna orientation of the mobile device consistent, since PCB antennas are far from omnidirectional.

Re: Can I estimate distance from Wi-Fi RSSI on an ESP32, and what do the dBm values mean?

#6

If the project needs real distances, use a technique that measures time rather than power. Wi-Fi Fine Timing Measurement (802.11mc) measures the round-trip time between a station and an access point that both support it, and some newer ESP32 variants expose it in ESP-IDF. Ultra-wideband modules do better still and are the usual choice for indoor positioning at the level of tens of centimetres.

RSSI remains useful for what it measures directly: link quality, antenna comparison and deciding which access point is nearest.

TEP COMMUNITY