After my first very basic range experiments (see previous blog Bee-Chat) I questioned myself if there is a more accurate way to determine signal strength. Of course there is and you only have to look into the XBee manual.
Search for "RSSI" (RX Signal Strength Indicator) and you will find at least two sections where the RSSI function is described in detail.
For example in AT-mode, which means the XBee is either capable of command or transparent mode, you could type in "hello" then put the XBee in command mode with "+++" and then enter "ATDB". You get a hexadecimal value which "returns the RSSI value (measured in –dBm) of the last received packet". This only works if there is a direct connection, but for the moment this is the case and it does the job.
|Very simple distance check|
The lower the value the better.
I got hexadecimal "1A" when laying two XBees side by side. As far as I understand this means -26dBm. I tried some other positions (inside my house) and the value went up to hexadecimal "5C"/ decimal 92 in the corner furthermost away.
This opens a lot of options for future applications.
If you are one of those people who regularly forget where they left their keys, two XBees could help. Or you need any sort of very simple distance meter (yes, radio waves are not that great for accurate distance measurement), proximity sensor or whatever application where a raw value of distance of two things is needed - two XBees would do. A lot of things might be possible with this already embedded function...