Quote of the Day
Something I wish I’d been reminded of when I was learning to code – just watching coding tutorials is like going to the gym just to watch someone else lift weights. It’s valuable to see how experts do it, but to actually build your coding skills—you’ve got to code!
— Madison Kanna, software developer. I am a huge fan of her twitter feed and blog. I see many people watch Youtube videos and think that simply watching videos will make them proficient at complex tasks. Unfortunately, there is a huge gap between watching and doing.
I recently have been working on Bluetooth Low Energy (BLE) systems and estimating the distance between two devices based on the Received Signal Strength Indicator (RSSI) value is one of my tasks. There are all sorts of uses for this distance information in wireless systems. A few years ago, I worked on one wireless product for department stores that would use customer distance and angle information to determine where a customer was in the store and where they lingered while they were shopping. This information can be used to assess the ‘stickiness’ of displays and to send messages to the customer’s phone about nearby products they may be interested in.
These types of calculations are also performed in other applications. For example, I have done similar calculations with cell phone systems. While cell towers normally use GPS to determine phone positions, if GPS is not available they can use power-based range estimates to locate phone positions (example). This certainly is part of the E911 standard, which specifies emergency cell services in the US.
All these applications estimate range using some form of Equation 1.
- R is estimate range between the two radios (in meters).
- N is the path-loss exponent (unitless, value of 2-4, with 2 being for free space). At most frequencies, N=2. In the case of 2.4 GHz, losses can be higher (link, link).
- RSSITdB is received signal power level (in dBm) at 1 meter from the antenna.
- RSSIRdB is received signal power level (in dBm) at R meters range.
This post will present a derivation of Equation 1.
Equation 1 is nothing more than the inverse square-law for electromagnetic waves with signal powers expressed in dB and the signal losses modeled with range powers from 2 to 4. We begin the derivation by restating the inverse square law for electromagnetic waves (Equation 2).
- K is a constant that will cancel out in further work.
- RSSIR is the received power (W).
- PT is the transmit power (W).
The range calculations do not normally use the actual transmitted power, but use the received transmit power at a reference distance (usually 1 meter), which is modeled by Equation 3.
Let’s now construct the ratio of Equation 3 to Equation 2 (Equation 4).
We can convert Equation 4 to dB as shown in Equation 5.
This derivation shows that Equation 1 is really just a slight reworking of the inverse square law.