How to control a robot wirelessly using xbee modules

arduinowirelessxbee

I want to be able to control my robot wirelessly from my pc via xbee modules. So one xbee should be connected to my computer while the other one will be to the arduino on my robot. I've done a lot of research on xbees but Im still very confused. For example I'd like to control it manually using arrow keys and also be able to control other functions on the robot like headlights etc. But frankly I dont know where to start. Can someone give me a brief introduction to how this can be achieved? Thankyou.

Best Answer

You didn't mention what version of the XBee and/or Arduino you intend to use. I'm assuming the XBee series 1 (cheapest) on a Uno (reasonably cheap). In addition to the obvious XBee -> Arduino "breakout" board (that will convert the 5v Uno signals to 3.3v XBee signals and vice versa) - you will also need the USB -> XBee interface (what they call "explorer boards" often).

Option A - write your software on the PC to send serial data out through the PC-XBee to the Uno-XBee, which will then translate your commands into appropriate Arduino-ish pin actions. (see other answer provided)

Option B - more relevant to this site. Forget the PC (except for programming your Uno and XBees). The XBees have a wondrous feature, line passing, utilizing their built in ports and ADC circuitry. As an extreme simplification - a change in voltage at an IO pin on the source XBee will be reflected on the destination XBee(s) pin(s). Directional buttons can then easily be constructed on a PCB/breadboard as a control transmitter, and the corresponding actions programmed into the UNO on the far end that reads these IO signals from its XBee. One fun variation is the ability to get multiple XBees to listen, allow you to build robot swarms that all follow the commands being sent. If this is more to your liking, you can ask a more specific question about line passing on XBees.