# Arduino Nano + Raspberry Pi = UAV Ground Station?

I'm a programmer by trade, and an amateur aerospace nut, with some degree-level training in both fields. I'm working on a UAV project, and while the good people over at DIY Drones have been very helpful, this question is a little less drone-related and a little more general robotics/electronics. Essentially, I'm looking at options for ground stations, and my current rough plan is something like this:

I have a PC joystick with a broken sensor in the base, which I plan to dismantle, separate the handle from the base, insert an Arduino Nano into the (mostly hollow) handle and hook it up to all the buttons and the hat thumbstick. Then, where the hole is that used to accept the stem to the base, I fit a bracket that runs horizontally to hold a smallish touchscreen (think Razer's Project Fiona tablet with only one stick), behind which is mounted a Raspberry Pi. The Nano talks to the RPi over USB as a HID input. The RPi will be running some custom software to display telemetry and other data sent down from the UAV.

My main question whether that Nano would have enough power to run the XBee that provides the telemetry link without causing lag in the control inputs. It's worth mentioning that the UAV will be doing fly-by-wire moderation, so slight stutters won't result in wobbly flying, but serious interruptions will still be problematic - and annoying. It's also worth mentioning that this will only be used as a simplified "guiding hand" control; there will ALWAYS be a regular remote control available (not least because of EU flight regulations) so this is just for when I don't want to use that. If that Nano won't do, what are my options? My first thought is to get a second Nano and get that to drive the XBee (the RPi has two USB ports after all) but there may well be a better way.

• Please add some pictures to the question if possible, it definitely helps in understanding what you want. – georgebrindeiro Feb 8 '13 at 17:35
• Will add a system diagram soon. – anaximander Feb 12 '13 at 9:50

The Arduino Nano should be able to interface with the XBee no problem.

If all you are using the Arduino for is forwarding a message that comes from the RPi, you might as well just use an XBee Explorer board (basically a FTDI Chip with a socket fit for an XBee). After configuration, all you need to do is to write to a serial port to get the XBee to send a message... All processing is done in-chip.

• I also need something to handle inputs from five buttons, a slider and a thumbstick and pass them to the XBee. The RPi should also get to see these inputs, although it doesn't really matter whether that's in series or parallel. – anaximander Feb 12 '13 at 9:50
• Concur. You'll get better real time characteristics by far off an Arduino running a well defined control loop than off a Raspberry Pi running a full Linux stack. – Jay Beavers Feb 18 '13 at 15:50

If I'm understanding your architecture (from joystick to UAV) correctly, it is this:

${[\text{joystick}]-\text{wires}- \atop [\text{RPi}]-\text{USB HID}-}-[\text{Nano}]-\text{XBee}-[\text{UAV}]$

You're considering laying it out like this:

$[\text{joystick}]-\text{wires}-[\text{Nano}]-\text{USB HID}-[\text{Rpi}]-\text{USB HID}-[\text{Nano}]-\text{XBee}-[\text{UAV}]$

The Nano should be more than powerful enough to run the XBee and the controls. Even if it wasn't fast enough, I doubt that you could improve it by adding the latency introduced by two USB HID links and the processing onboard the RPi.

• That's more or less it. The first is what I had originally, but then I started wondering whether the Nano would have the power to handle all three routes (joystick -> XBee, joystick -> RPi, RPi -> XBee) without introducing lag into any of them. I guess the easiest way is to wire it all up an the bench and test it; if it turns out to be slow then I can look into other options. – anaximander Feb 13 '13 at 9:13