Saturday, October 22, 2011

Accuracy Test 2 - Xbee RF Trigger with Mobile Receiver - Outdoor Trials

The first Accuracy Test 1 revealed the expected signal interference by walls and doors. Not surprisingly the accuracy and strength of the signal becomes immediately unstable when you step outside of a room. I repeated the test This is not necessarily a problem but I decided to tweak the delay a bit in the receiver sketch* to smooth things out a bit before continuing on to outdoor trials;
Having discerned in Test 1 that line of sight is key to stable Xbee signal, one of the main things I hoped to learn in this test was whether the voltage of the power source played any significant part in strength and range. Also, I wanted to test range in an unobstructed environment. The following results were collected on my lawn with the Arduino/Xbee Shield/Xbee system powered by various mobile power supplies;

This test will be done using two Arduino Duemilanove units as in test 1. The sender unit will be plugged, via USB cable, into the computer and the other will be powered by a range of modular power sources.

The mobile receiver unit in the photo is using a 9V battery and has a servo attached to pin 9, which is triggered when the Xbee's come in range of one another. Read more about servo receiver.

The three mobile power sources I tested with are;
  • 3.7V single cell lipo
  • 6V battery pack made up of 4x1.5V AAA size batteries
  • Typical 9V battery
I was surprised to find very little difference in range between power sources but a much greater range and degree of accuracy, when unobstructed, than in Test 1. I assume that the steady, computer power source Im using to run the sender data sketch;
Following this trial I intend to try using the Xbee system with both send and receive units being powered modularly. Read more here.




*Editing the delay in the receiver sketch or adding an 'if' statement into the void loop could both be used to alter the rate at which the receiver unit looks for serial data from the sender or to integrate other components to your smart system. E.g;


#include

Servo myservo;

int pos = 0;
int potpin = 0;
int val;

void setup(){
myservo.attach(9);
Serial.begin(9600);
pinMode(13,OUTPUT);
}

void loop(){
val = analogRead(potpin);
//val = map(val, 0, 1023, 0, 179);

if(Serial.available() > 0 && val > 500){
digitalWrite(13,HIGH);

for(pos = 0; pos < 180; pos += 1) { myservo.write(pos); delay(15); } for(pos = 180; pos>=1; pos-=1)
{
myservo.write(pos);
delay(15);
}
delay(500);
Serial.flush();
}
else {
digitalWrite(13,LOW);
//delay(1000);
}
}




No comments:

Post a Comment