3D Robotics

Adding wireless telemetry to ArduPilot

You may have noticed that we had wireless telemetry in our flight testing last week. It's really easy to add. The first thing to keep in mind is that you should use Xbee modules in a different frequency range than your RC equipment. If you've got 72Mhz RC gear, you can use 2.4Ghz Xbee modules. We use Xbee Pro wireless modules with a Adafruit adapter board on the aircraft side, and a Sparkfun USB adapter board on the ground/laptop side. If you've got 2.4Ghz RC gear, you should use 900Mhz Xbee modules. We use a Xbee Pro with the wire antenna for the aircraft, and and Xbee Pro with a SMA antenna connector (and a good 900Mhz antenna) on the ground, with the same adapter boards as above. Next, you need to set up your Xbee modules. They ship with a default of 9600bps, which you must change to 4800 bps for ArduPilot 1.0 or 57,600bps for ArduPilot 2.x. Connect them with your FTDI cable (see instructions here) then use Digi's X-CTU utility to change the baud rate to 4800 or 57,600 (in the modem configuration tab--press the Read button and then click on and change the baud rate line). You should also give them unique Network IDs so they'll be paired. Just use any 3-digit number, and just make sure you've set it the same on both modules. (Don't use 999 if you're going to be flying around me--that's mine!). When you're done with the settings, click "Write". Remember that after you change the baud rate you have to switch back to the PC Settings tab and change the baud rate there, too, or the utility won't be able to communicate with the module. (Switch it back to 9600 when you're switch to the second module, if it's still in the default mode, and repeat the process.) On the ArduPilot side, use three jumper wires to connect the following pins circled in red on the board below: --Xbee RX to ArduPilot FTDI port TXO --Xbee 5v+ and GND to the VCC and GND pins next to the FTDI port.

It will end up looking like this:

(Note: the above is to get telemetry from the Autopilot. If you just want to see the NMEA data from the GPS module, connect the TX pin to ArduPilot's RXI pin, right next to the to TXO pin, instead.) On the ground side, connect the other Xbee module to your laptop with your FTDI cable, as described here. That's it! If you open up a terminal program on your laptop and set the baud rate to 4800 or 56,000, depending on which ArduPilot software version you're using, you should see ArduPilot telemetry coming in. Anytime there is a "Serial.println" in the code, that data will be sent through the Xbees to the ground. You can record any data you want, and even GPS datalog from the ground! Couldn't be easier. BTW, if you want to test the range of your Xbee link, connect the plane-side Xbee module's RX and TX pins together to create a loopback circuit and use the X-CTU utlitity's range test function. For the modules we're using you should get around a mile. Once you've got the wireless connection set up, you can use our Ground Station to display real-time telemetry with ArduPilot 2.1 and up:

E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones

Comments

  • Developer
    BTW my PAN ID is "777", so please no body use it in case you are close to me. =P.

    Automatik:

    I don't think so... I'm not using loops, (only the main loop, obviously)... But i have independed modules synchronized to increase performance. For example the serial TX/RX is a complete independent module, and i just exchange data using a global variables... Then i just parse the incoming data and display it with the normal gauges... Nothing complex... The only thing is causing this is when i use images, to make a simple artificial horizon..
  • Ahh! Thanks Chris. Here's what the Adafruit site says about setting the network ID. While I went hunting, you answered me, great turnaround man!
    ---
    "Overview

    The most basic way to communicate using the XBee modems is point to point. That means one modem communicating with another modem. Serial data goes in one XBee, is transmitted wirelessly, and goes out the other & vice versa.

    If you just want a wireless link - between two microcontrollers, computers, Arduinos, etc. then start here!
    Setting the network ID

    For this simple network, we want two modems to talk only to each other. That means that if you're in a school, lab or workshop other people's XBee's can interact with yours causing some major confusion

    A good way to avoid this is to set the network ID (otherwise known as the PAN - Personal Area Nework - ID) to a unique value. By default all XBee's use PAN ID #3332. The ID is 4 bytes of hexadecimal and can range from 0000 to FFFF"
    ---
  • Found Xbee at these three places, Sparkfun, Adafruit, and Digi.Com

    http://www.adafruit.com/index.php?main_page=product_info&cPath=...
    http://www.sparkfun.com/commerce/product_info.php?products_id=8742
    http://www.digi.com/products/model.jsp?lid=EN&pgid=130&pfid...

    Digi.Com is the online sales site given by the supplier of the Xbee. LadyAda shows prices in the plus or minus $20 range per unit if purchased directly from suppliers.
  • Jordi said: "'Im planning to write an small ground station with labview, the problem with labview is that consume a lot of CPU resources, and my laptop fan is spinning at max speed trying to cool it down when i'm using it (Dell M1330), so the battery last like 1 hours instead 3 1/2. Very bad when you are in the field far away from a power plug."

    Jordi,
    there might be a chance that you are doing something "wrong" - for ex: memory leak or using / building huge uninitialized array in a loop, etc. I have been using LabVIEW since mid 90s and know that things can "get out of hand" .... One old trick is to use timeout function in a loop but give it value of 0ms to wait. See if that helps.
  • 3D Robotics
    You set the network ID so they only talk to each other.
  • Xbee telemetry transmission would be an exciting addition! What happens if two flyers are using Xbee at the same time? Do the units know which is their mate? Or would data transmissions overlap or fail in some way?
  • Moderator
    Several members have done exactly that... can't remember the exact threads, so I 'll go through the postings.
  • What is the ground station supposed to do? Display text or also graphics? Maybe it could be native Win32 application.
    Btw, I was able to plug my notebook to car's 12V plug, and it worked ;) With battery removed.

    Another thing - Google Earth supports something like dynamically updated place (KML). It would be nice to use it, feed data from telemetry somehow to this so that plane is displayed in Google Earth in realtime. I'm not yet sure if this is possible to do.
  • Developer
    The best option is Realterm, like Michal says..

    I'm planning to write an small ground station with labview, the problem with labview is that consume a lot of CPU resources, and my laptop fan is spinning at max speed trying to cool it down when i'm using it (Dell M1330), so the battery last like 1 hours instead 3 1/2. Very bad when you are in the field far away from a power plug.
  • Thanks Chris. I don't like Arduino studio, it's rather slow (thanks to Java).
    I do all programming in MS Visual Studio, and now I found freeware Realterm for serial monitoring. And it also allows to send data to serial - for example to run simulation of GPS data.
This reply was deleted.