Signal strength and the RSSI pin
The Received Signal Strength Indicator (RSSI) measures the amount of power present in a radio signal. It is an approximate value for signal strength received on an antenna.
Measuring the signal strength at the receiving antenna is one way to determine the quality of a communication link. If a distant transmitter is moved closer to a receiver, the strength of the transmitted signal at the receiving antenna increases. Likewise, if a transmitter is moved farther away, signal strength at the receiving antenna decreases.
The RSSI is measured in dBm. A greater negative value (in dBm) indicates a weaker signal. Therefore, -50 dBm is better than -60 dBm.
XBee module's pin 6 can be configured as an RSSI pin that outputs a PWM (pulse-width modulation) signal representing this value. To do so, configure P0 as RSSI [1]:
The XBee Grove Development Board includes an LED connected to the XBee module's pin 6. When this pin is configured as the RSSI pin, the LED lights every time the connected XBee module receives data. Its intensity represents the RSSI value of the last-received data: a brighter light means a higher RSSI value and better signal quality.
Configure the amount of time the RSSI pin is active, and therefore the amount of time the LED will remain lit, by modifying the RSSI PWM Timer (RP) setting:
RP value is expressed in hexadecimal notation. For example, a configured value of 0x1E is equivalent to 30 in decimal and means that the pin will be active for three seconds (30*100=3000ms.) So the LED will light for a total of three seconds, representing the last RSSI value.
After the RP time has elapsed and no data has been received, the pin will be set to low and the LED will not light until more data is received. The pin will also be set to low at power-up until the first data packet is received. A value of 0xFF permanently enables the pin; when configured in this way, it will always reflect the RSSI value of the last-received data packet.
Although the luminosity variations of the RSSI LED may be difficult to distinguish, the LED can be used to verify successful receipt of data packets. Each time the XBee module receives data, the LED is solid during the configured time.
Note Received Signal Strength (DB) parameter
The RSSI value can also be obtained by reading the XBee DB parameter value. It represents the RSSI absolute value of the last received data packet expressed in hexadecimal notation.
Is RSSI the best indication of link quality?
One thing to keep in mind is that the RSSI is only an indication of the RF energy detected at the antenna port. The power level reported could be artificially high because it may include energy from background noise and interference as well as the energy from the desired signal. This situation is worse in an interference-prone environment where it is possible to get consistently high RSSI readings, yet still have communication errors.
If the application is attempting to measure "link reliability" and not just "signal strength," it may be helpful to factor in "% packets received" or similar data.
Tip A range test is always a good idea, as it allows you to measure link performance in terms of signal strength and packet success rate. This will help you determine the reliability of your RF system. For more information, see Example: perform a range test.