Arduino Forum

Forum 2005-2010 (read only) => General => Exhibition => Topic started by: obor on Oct 14, 2008, 10:23 pm

Title: R/C Arduino & Xbee based
Post by: obor on Oct 14, 2008, 10:23 pm
Here is my first version of an RC transmitter/receiver based on Arduino.

The transmitter uses an Arduino Diecemilla, the receiver use a Sparkfun wee. The wee (Sparkfun) is smaller and lighter than the  Arduino to better sit in the plane.  
Transmission is done with Xbee Pro modules in 2.4GHz.
You can see more details and photos on my blog:  http://effetdebord.blogspot.com/
Title: Re: R/C Arduino & Xbee based
Post by: jds on Oct 15, 2008, 12:33 pm
Very nice!

Any possibility I can have a peek at your code?
Title: Re: R/C Arduino & Xbee based
Post by: obor on Oct 15, 2008, 08:03 pm
Thanks for your interest.
Yes, I will put the code hex  on my blog soon. It's written in c/c++ and you'll need avrdude to download it.
Title: Re: R/C Arduino & Xbee based
Post by: jds on Oct 15, 2008, 09:04 pm
ok, thank you!
Title: Re: R/C Arduino & Xbee based
Post by: Syvwlch on Oct 16, 2008, 03:19 am
So this establishes an RF link over XBee between two arduinos, one which reads human inputs (couple joysticks, some buttons) and the other which controls actuators (servos, speed controllers, etc...) on a flying model aircraft?

Neat!

What are the cross-talk and interference risks and what is the range, compared to regular RC transmitters/receivers?
Title: Re: R/C Arduino & Xbee based
Post by: obor on Oct 16, 2008, 09:12 am
Yes, you are right this is exactly an RC transmitter/receiver using Arduino.
On transmitter  side there is: Arduino Diecemilla + Xbee Pro
Or receiver side there is: Sparkfun Wee + Xbee.
Trasmitter takes input from joysticks (4 currently) and send it to the Xbee.
Receiver takes data from the Xbee and control servos through regular pulse.
I used my own protocol between the 2 Xbees. It allows many possibilities with high precision, at least 10 bits per channel.

Regarding interference risk, there are pretty low. First Zigbee is already used in some radio systems (XPS for instance). Then, when it starts, the Xbee choose a "free" channel, and then emit with its own PanID on that channel. This greatly limit the risk of collision between 2 transmitters.

Regarding Range, the XBee pro allow more than 1km range. I have not tested myself, but so far it works fine as you can see on one of the video on my blog.

Title: Re: R/C Arduino & Xbee based
Post by: jds on Oct 16, 2008, 10:03 am
I would like to add that XPS can be found at http://www.xtremepowersystems.net/index1.php

I am not sure what XPS is using in their system, but they claim that their system has a range of 5 mile.
Title: Re: R/C Arduino & Xbee based
Post by: Syvwlch on Oct 16, 2008, 01:34 pm
Very nice. I've seen some very expensive gear plant itself a foot deep into a hillside due to interference with traditional gear.

How difficult would it be to make this bi-directional, and how much bandwidth is left over?
Title: Re: R/C Arduino & Xbee based
Post by: The_Bongmaster on Oct 16, 2008, 03:08 pm
hey if this works out cheaper than a normal 2.4 Ghz radio set then i might be up for trying it myself :)

i have a Esky usb controller that would be a good candidate for the TX box. I would like to use it for indoor flying, the others there all seem to be using 2.4 sets so i tend to feel a little left behind :P so making my own set would be a good catch up if its cost effective :)
Title: Re: R/C Arduino & Xbee based
Post by: jds on Oct 16, 2008, 08:46 pm
I noticed on your website that you had your first flight! Congratulations, it seems to work nice!
Title: Re: R/C Arduino & Xbee based
Post by: obor on Oct 16, 2008, 09:33 pm
"How difficult would it be to make this bi-directional, and how much bandwidth is left over? "
Making communication  bidirectional is easy, but probably  not very efficient because of the acknowledge.

Regarding bandwith, for sure there is still some space for other datas. However I am sure about the current data loss I have. I am under the impression that the more the bandwith is high, the more there is character loss. This is one of the reason why I added to my protocol a crc to check data integrity and to avoid this problem.

"if this works out cheaper than a normal 2.4 Ghz radio set ..."
A xbee pro is approx 40$ and you'll need at least 2. Then add the arduino + wee 34$+20$  + hardware and you'll be at 140$ or more. It seems that you can buy 2.4Ghz small plane for that price.  So I doubt that you can't find cheaper.

"I noticed on your website that you had your first flight! Congratulations, it seems to work nice! "
Yes I did yesterday. The plane flew with no suprise even while I was flying far away. This is encouraging to continue developments.
Title: Re: R/C Arduino & Xbee based
Post by: Syvwlch on Oct 16, 2008, 09:54 pm
Thanks for the answer. Sound like a good way to get a little feedback from on-board sensors to the pilot. A climb rate indicator (e.g. with a warbling tone pitching up or down accordingly) would be great for us glider fliers.
Title: Re: R/C Arduino & Xbee based
Post by: The_Bongmaster on Oct 16, 2008, 10:56 pm
"A xbee pro is approx 40$ and you'll need at least 2. Then add the arduino + wee 34$+20$  + hardware and you'll be at 140$ or more. It seems that you can buy 2.4Ghz small plane for that price.  So I doubt that you can't find cheaper."

well i could make up my own boards from the atmega168 cutting a bit off the price there. and i can recycle other components.
it would be an intresting project too :)

im doing rc on a shoestring here :D i have an indoor plane i built from packing foam, and it flies from the tests i done.

but the radio kit i have is a 3ch 35mhz set, making a 4+ channel set would be good :)

if i can find a cheap 2.4 ghz set for my planes then i will try that, but would like to look into other options ;)

edit: just noticed sparkfun has xbee starting form $22 (not inc postage)
Title: Re: R/C Arduino & Xbee based
Post by: obor on Oct 18, 2008, 08:09 pm
I forgot to add the cost of the Xbee Shield. It is approximately an additional 40$ which makes a total of 180$.
Title: Re: R/C Arduino & Xbee based
Post by: obor on Oct 21, 2008, 10:46 pm
I have updated my blog with more details about the hardware and the code to download.
Have fun,
Title: Re: R/C Arduino & Xbee based
Post by: Syvwlch on Oct 22, 2008, 12:29 am
Nice writeup, lots of pictures etc... Thanks for sharing all this!
Title: Re: R/C Arduino & Xbee based
Post by: obor on Nov 11, 2008, 11:06 pm
Few more updates on my blog.
Has anyone tried to use the code and do something with it ?
Title: Re: R/C Arduino & Xbee based
Post by: Brad Burleson on Nov 21, 2008, 12:32 am
I'm a bit late on this but nice work.

I've been inspired; I've got a couple of old 3' R/C sailboats I built with my kids a number of years ago that could be modified for fun.

Plus I was thinking of adding GPS feedback from the receiver as well as partial automation (controlling the sail servo with an accelerometer).

Heck, it might be a fun test bed - loss of R/C signal won't ever cause more than a ding in the paint, plus speeds and distances are pretty low.

So I think I understand the hardware required but I've got a few questions about how you did the software:

1) I assume you are using the XBee's in transparent mode, as opposed to API mode?

2) How often do you poll the potentiometers?  The Xbee?  Or are you simply looping between the two?

I'm curious about timing as I'd like to have an LCD display on the transmitter displaying GPS data received from the sailboat via the XBee.

Thanks again,

Brad.
Title: Re: R/C Arduino & Xbee based
Post by: obor on Nov 21, 2008, 09:46 pm
hello,

1/ yes, I use Xbee in transparent, just like a modem
2/ potentiometers are read on interrupts, when conversion is done. Meanwhile, data is written on serial port.
Title: Re: R/C Arduino & Xbee based
Post by: Brad Burleson on Nov 23, 2008, 07:55 pm
obor-

Thanks for the info.  I'd been thinking of using interrupts but was a bit hesitant due to my inexperience (and the fact that I want to use AFSoftSerial at the same time).

Perhaps I'll give it a try.

Brad.
Title: Re: R/C Arduino & Xbee based
Post by: ScottKidder on Nov 28, 2008, 09:03 pm
My Spektrum DX7 (2.4 ghz) was about $340 with the RX and a few servos that I really didn't need. A CCPM Heli needs 6 channels but for smaller application that sounds great.