Poll
Question: How do you get reliable RSSI readings from the Arduino Uno?
Networking, Protocols, and Devices - 0 (0%)
Project Guidance - 2 (100%)
Total Voters: 2

Pages: [1]   Go Down
Author Topic: Problems determining distance from RSSI using XBee S1 not related to RF  (Read 1632 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

   I'm using a set of XBee series 1 RF modules to determine distance from RSSI. Unfortunately, I see no clear relationship between signal strength and distance, but I know that its NOT related to RF interference (same results in a shielded chamber). So that leaves software/hardware as the cause of the problem

  Here's my setup: two nodes are used, where each node is comprised of an XBee S1 RF Module housed on an XBee Shield, which is connected to an Arduino Uno. The source (fixed node) sends a signal to the receiver (blind node), from which signal strength is measured by the receiver and output to the Arduino at varying distances. The source is powered by a 9V Li-Ion Battery, while the receiver is powered via the USB port on a laptop, from which data is read using the Arduino software.
  The software acquires 100 RSSI values and takes the average to find signal strength at a point as follows:

float XBeeS1::getRSSIAvg(char _nodeNum)
{
  float rssi = 0;
  int i;

   
  Serial.flush();
  Serial.println(_nodeNum);  //poll the remote source node to send a signal
  delay(50);
  if(Serial.available() > 0)
  {
   for(i = 0; i < numReads; i++)
   {
     rssi += pulseIn(rssiPin, HIGH, 200);  //get one reading from the source node
   }
  }
  return rssi/numReads; //numReads = 100
}

If not RF interference, does anyone know what else with hardware/software could be causing me problems?  

  I noticed a paper where Xbee Series 2 transceivers were successfully used to determine a clear relationship between signal strength and distance, so I know its possible (though they use a digi dev board instead of an arduino for the blind node).

Thanks in advance for your help,
Mike  
Logged

Offline Offline
Edison Member
*
Karma: 6
Posts: leet
If you're not living on the Edge, you're taking up too much space!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

In my experiments I still had a good data rate even when RSSI was at a minimum.
IE It can be used to measure short distances only.
Instead try measuring the RF energy level using the ATED? command.
Or retries.
Or data rate.
Want a snipped of code?
Logged

If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 547
Posts: 45935
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Unfortunately, I see no clear relationship between signal strength and distance
There isn't one.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

SBright
  - Thanks for the advice, I had some follow-up questions: I've been using the XBees solely in transparent mode, do you have to set up a network in order to send ATED measurements? How do you initiate a scan, and in what form does the XBee send data to the Arduino?

-Mike
Logged

Offline Offline
Edison Member
*
Karma: 6
Posts: leet
If you're not living on the Edge, you're taking up too much space!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You do not need a network.  You can do it with only one XBee.  To get to Command mode send "+++" with time before and after.  Then ATED.  The serial text results are easy to parse.

http://www.sparkfun.com/datasheets/Wireless/Zigbee/XBee-Manual.pdf
Logged

If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

  I created a simple program to perform an energy scan on the default channel 0x0C but I'm getting constant values
of 54 regardless of where I place the remote node. Do you have an idea of how to properly set up the scan so that
it picks up the power being transmitted by other nodes on the network?

-Mike 
Logged

Offline Offline
Edison Member
*
Karma: 6
Posts: leet
If you're not living on the Edge, you're taking up too much space!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The ATED command scans all the channels.  Each channel should give different results around a normal household, and change over time.  But not nearly as much as when another XBee transmits.  It should go from nearly minimum to maximum when it's nearby. 
Logged

If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

Pages: [1]   Go Up
Jump to: