My project involves controlling multiple robots (maybe around 30 at most) from one PC through XBee’s. Each will have its own XBee, Arduino Uno, and Sabertooth. One main XBee at the host computer will send out commands which will be interpreted by the Uno’s according to ID, then commands will be sent to the Saberooth. I have been working on this for a few days now and I am now wondering about the camera system. Each robot will have a mini camera on it that will also be radioed back to the host PC. I never thought about all the interference, how do they handle mech warfare? Is it possible to have a lot of the same (lets say 2.4Ghz) cameras in the same room? I am trying to find the cheapest way possible, any suggestions or insights…?
That might (X)be a problem!
Alan KM6VV
I have been reading up and apparently you are supposed to only have 4 per area… and mech warfare uses IP cameras, which are too expensive for this… Is there another method?
If you can have multiple receivers (and not need to ACK) then a “broadcast” method with addressing could work. BlueTooth needs pairing, so that’s probably out, maybe Xbee can work broadcast? Otherwise, I’d look into some sort of IR broadcast. Any broadcast system could allow individual queried responses, of course.
I don’t know Xbee. does it have a broadcast mode with addressing?
AX.25 Packet radio system (Amateur Radio example, licensed) is possibly what you need.
Alan KM6VV
XBee does not have enough bandwidth to handle live images. I am only concerned with the camera feeds, not the controls. I have decided to just use IP cameras, thank you for the help
If you haven’t ordered yet… viewtopic.php?f=26&t=7545
I’m excited to break these things down.
I am fleshing out a similar networking robotics problem. I intend to offload some machine vision tasks to a PC, and so I will run into speed issues with multiple data paths (commands and sensor feedback via xbee, video via wifi). But for my prototype, I think this’ll work fine.
If a large number of video transmitters are to be used, then powering up/down the individual transmitters only when an image is needed might solve interference issues.
Awe, they are out of stock now Thank you for the link though.
@zoomkat
I have found a way to eliminate use of the cameras on each robot, thank you.
I do have a few questions though…
What is the cheapest microcontroller that has a TX,RX, and a 5V power rail to interface with an XBee, interpret the commands based on how its programmed, and then run a sabertooth 2x5? That is all it needs to do…
I can’t seem to get any cheaper then the Arduino Uno, is this correct?
Thank you!
They are reasonably cheap, you can probably get cheaper… You could go with one of the different Arduino Clones like:
seeedstudio.com/depot/seeedu … th=132_133 ($22.50)
nkcelectronics.com/arduino-p … 28516.html ($19)
…
Or you could try out some different PIC based systems (I don’t have much experience here, but for example)
Basic Micro has their Nano 8 (only 4 IO pins) for: $3 and a cheap board for $7 or $10
Or their Nano 18 for $8 and board for $15 (I have played a little with these)
Lots of other Pic systems - but I have no experience with them
Personally I prefer the Arduinos, but …
Good Luck
Kurt
I also forgot to mention, that while not the cheapest, this new board (societyofrobots.com/axon_mote/) looks sort-of interesting as it has built in XBEE support. I believe it is XBEE 2, which is fine, but I have not done any code for this…
Thank you for the links kurte, so what if went for the Seeedduino, this Xbee shield, and a sabertooth 2x5, this would all work together? And would I need series 1 XBee or series 2?
Sorry friend. Probably a bunch of mech warriors and robo builders bought 2 or more at a time like myself.
they MIGHT work well with each other…
For me with the XBee shields, they all appear to be hard coded to use TXD/RXD which are the same pins that the USB uses. I have heard that they can both work but not at the same time. Also I believe they allow you to re-jumper the shield and if you unpower or remove the Arduino or some such thing you can configure the XBEE to talk directly with USB… (Again never tried). ]
I have shied away from this approach as I like to use the USB port. I often have debug code that I wish to sometimes output and I might also put in a quick and dirty input monitor that each time through the main loop I check to see if there are any characters to process. So for my Arduinos and XBEES I have been using these: parallax.com/Store/Accessori … roductName
I can always connect them to digital pins 0,1 if I wish to use them the same way as the shields or I can plug them into other pins. On Arduino Megas I use one of the other hardware USARTS. In Botboarduino/Arduino UNO, I plug them into some other digital pins and use a Software Serial port. (On my current Arduino Hex project, which is currently running on the Beta BotBoarduino board - I am using the beta of NewSoftSerial)…
Sabertooth - 2x5 you can probably use one of the hardware PWM pins to generate the pulses…
But that is just my 2 cents worth…
Kurt
Note: either shield or the board I mentioned can handle XBee 1 or XBee 2.5…
EDIT: This shield looks pretty interesting… seeedstudio.com/depot/bees-s … th=132_134 May have to try one of them out…
Thank you for the information!
They also have this shield seeedstudio.com/depot/xbee®-shield-p-419.html?cPath=132_134
I’m just going to buy the seeeduino, sabertooth 2x5, and the seeed XBee shield. I will let you guys know how everything gos
What is the cheapest microcontroller that has a TX,RX, and a 5V power rail to interface with an XBee, interpret the commands based on how its programmed, and then run a sabertooth 2x5?
You might check out the bare bones kit below. Do all the programming and setup using a regular arduino board, then when complete swap chips with the bare bones board.
I now have an Arduino Uo, Seeed XBee Shield, XBee pro series 1, XBee series1, and a sabertooth 2x5.
I have the arduino working through USB but I can not get XBee working. I have configured both for 115200 Baud, channel C and ID 1111. I can barely find any documentation on the Seeed shield (sparkfun.com/tutorials/192. There is a table here [urlhttp://garden.seeedstudio.com/index.php?title=XBee%C2%AE_Shield]here that has positions for the two switches on the shield, which one do i do? I am trying to send commands to the arduino that are then interpreted and sent to the Sabertooth, I have dealt with XBees before so I just need help with the shield and the arduino, thank you guys!
Hi,
Again I don’t have that shield, but my look at it when you mentioned it was that it was somewhat configurable for which IO pins to use.
From the document ion you have the choice of IO pins 11-12, or connected up to TXD/RXD (IO pins 0,1) or to FT232? (Uno does not have this?)
OK if you hook up to TXD/RXD, it is shared by the USB, which could be an issue. Or at least for me, I like to be able to debug using USB… But if you go this way, you will find that a baud rate of 115200 does not work. If you look at the Atmega328 data sheet you will find that the USART would be off by (-3.5% or 2.1%), which will not give you reliable communications. I know on other processors I have tried to configure for 115200 the actual baud rate sent was 125000. So using USARTS I have often used the baud rate 62500, which has about a 0% error, but this is an non-standard baud rate for XBee, but you can configure them to this (hex baud…)
If you go to IO pins 11-12, this is on non USART io pins, so you will need to setup a software serial port. On my Botboarduino JR testing I am using the New Software serial library (Beta version). It may be able to run at 115200, especially for output only, but for XBEES I decided to go slower. I left my xbee at 62500 and got nothing. Looking at their code if the baud rate is not in their table, it does not do anything. So I configured for 57600. It was working, but I have not done much testing as I am currently mainly focused on PS2 for input.
Kurt
Thank you for the response, I now have the Xbees working. I am now having problems with the sabertooth…
I am using this code as a base
[code]// Sweep
// by BARRAGAN http://barraganstudio.com
// This example code is in the public domain.
#include <Servo.h>
Servo myservo; // create servo object to control a servo
// a maximum of eight servo objects can be created
int pos = 0; // variable to store the servo position
void setup()
{
myservo.attach(9); // attaches the servo on pin 9 to the servo object
}
void loop()
{
for(pos = 0; pos < 180; pos += 1) // goes from 0 degrees to 180 degrees
{ // in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable ‘pos’
delay(15); // waits 15ms for the servo to reach the position
}
for(pos = 180; pos>=1; pos-=1) // goes from 180 degrees to 0 degrees
{
myservo.write(pos); // tell servo to go to position in variable ‘pos’
delay(15); // waits 15ms for the servo to reach the position
}
} [/code]
And it works just fine with the motors. DIP switches are set to microcontroller mode.
This is how everything is wired…
http://i1007.photobucket.com/albums/af195/bucketlamp/arduino_sketch.jpg
The problem is when I use my code, the motors start moving randomly, or not at all.
[code]
#include <Servo.h>
Servo motor_left; // create servo object to control a servo
Servo motor_right;
int incomingByte; // a variable to read incoming serial data into
int pos_left = 180; // variable to store the servo position
int pos_right = 180; // variable to store the servo position
const int ledPin = 13; // the pin that the LED is attached to
void setup()
{
Serial.begin(9600);
motor_left.attach(9); // attaches the motor on pin 9 to the servo object
motor_right.attach(10); // attaches the motor on pin 10 to the servo object
pinMode(ledPin, OUTPUT);
}
void loop()
{
if (Serial.available() > 0) {
incomingByte = Serial.read();
if (incomingByte == 'W') {
pos_left==180;
pos_right==180;
motor_left.write(pos_left);
motor_right.write(pos_right);
delay(15);
digitalWrite(ledPin, HIGH);
}
if (incomingByte == 'A') {
pos_left==0;
pos_right==180;
motor_left.write(pos_left);
motor_right.write(pos_right);
delay(15);
}
if (incomingByte == 'S') {
pos_left==0;
pos_right==0;
motor_left.write(pos_left);
motor_right.write(pos_right);
delay(15);
digitalWrite(ledPin, LOW);
}
if (incomingByte == 'D') {
pos_left==180;
pos_right==0;
motor_left.write(pos_left);
motor_right.write(pos_right);
delay(15);
}
}
} [/code]
As you can see, when “W” is sent to the arduino, the P13 LED turns on, and when “S” is sent the LED turns off. This works fine, but the motors do nothing.
Can someone help me
Got it working