Author Topic: Connecting an Xbee to the Axon  (Read 7175 times)

0 Members and 1 Guest are viewing this topic.

Offline adastaTopic starter

  • Beginner
  • *
  • Posts: 5
  • Helpful? 1
Connecting an Xbee to the Axon
« on: December 10, 2009, 05:36:09 PM »
Hello Folks,

I have used the Axon board quite successfully on several projects, but each time I that I need to connect it to an Xbee I have quite a bit of trouble. 

The different voltage levels for each chip (3.3V on the Xbee) and 5 volts on the Axon Atmega640 means that you can't connect them directly.  I have tried using a sparkfun level converter :
http://www.sparkfun.com/commerce/product_info.php?products_id=8745

along with a sparkfun Xbee explorer regulated board :

http://www.sparkfun.com/commerce/product_info.php?products_id=9132

to connect the chips.  This produces a clean looking transmission on my oscilloscope, but the Axon cannot receive or transmit any data. 

The only solution that I have found is to use a inverter (7404) to buffer the signal between the axon and the Xbee explorer board.  This works well with Series 1 Xbees, but fails with Series 2.5 Xbees.   

Can anyone think of  an  electrical reason for the atmega640 finicky UART port?   How do you all connect your Xbee to your Axon?  Is there a good board that I can purchase?

Thanks for the help.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots
Re: Connecting an Xbee to the Axon
« Reply #1 on: December 11, 2009, 03:33:54 AM »
The Axon UART Rx will work fine getting 3.3V logic, no problem. Built-in resistors protect it from damage.

The Xbee however is a different story, as a 5V signal might damage the 3.3V tolerant Rx pin. If you look at the schematic of your converter:
http://www.sparkfun.com/datasheets/BreakoutBoards/Level-Converter-v10.pdf
you'll see its just a simple two resistor voltage divider for Rx - the *simplest* circuit in the world. But its quickly obvious why it isn't working - SparkFun chose the wrong resistors! Shocking!

That voltage divider they chose results in a 1/2 voltage output (two 10k resistors). So if you feed it 5V signal, it outputs a 2.5V signal - thats too low (what voltage does your oscope say?). You need ~3.3V. Sooooo doing the math:

(5V-3.3V)/10k = (3.3V-0V)/X
X = 3.3V*10k/1.7V
X = 19.4kohm resistor

Unsolder and replace the resistor connected to ground to be around 19.4k-ish ohms or less (doesn't need to be exact).

It also drains current according to a quickie Google search at about ~180mA during xmit, meaning you can't use the Axon 3.3V regulator (as you probably already know). An external 3.3V regulator is all you need.

Now looking at that XBee Explorer datasheet:
http://www.sparkfun.com/datasheets/Wireless/Zigbee/XBee-Regulated-v10.pdf

It appears they are using a diode to drop the signal by ~1.2V on the DIN pin, and a 1k resistor to absorb some current. Except there are two problems:
5V-1.2V is 3.8V - still too high!
and they have the diode backwards, at least in the schematic (so it won't work)

There you have it, SparkFun can't even get a voltage divider or a diode correct :P

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,938
  • Helpful? 98
Re: Connecting an Xbee to the Axon
« Reply #2 on: December 11, 2009, 08:43:42 AM »

Now looking at that XBee Explorer datasheet:
http://www.sparkfun.com/datasheets/Wireless/Zigbee/XBee-Regulated-v10.pdf

It appears they are using a diode to drop the signal by ~1.2V on the DIN pin, and a 1k resistor to absorb some current. Except there are two problems:
5V-1.2V is 3.8V - still too high!
and they have the diode backwards, at least in the schematic (so it won't work)

There you have it, SparkFun can't even get a voltage divider or a diode correct :P

You have misinterpreted the SparkFun schematic. Take another look at that schematic.
The diode functions by blocking a positive voltage to the XBee. The DIN line is pulled up with a internal resistor (see AT command PR) for a logic high but allows an external signal to pull it to logic low. Kind of like an Open Collector circuit. This works perfectly on the Series 2 XBee modules I have with a 5V PIC but have heard problems with the 900MHz XBee Pro modules.
This may be due to the voltage drop across the diode with a logic low signal. The DIN pin would be a diode drop above ground. If this is not low enough then the XBee's DIN doesn't see a logic low.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots
Re: Connecting an Xbee to the Axon
« Reply #3 on: December 11, 2009, 05:43:52 PM »
Ah yes, I didn't realize that other LED is also connected with the 3.3V pull-up. I take back my diode comment ;D

What voltages does your oscope read on that DIN pin? I'm curious what the diode voltage drops are.

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,938
  • Helpful? 98
Re: Connecting an Xbee to the Axon
« Reply #4 on: December 11, 2009, 10:37:34 PM »
Good question. I'll have to measure the voltage and report back.

Offline madsci1016

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,450
  • Helpful? 43
Re: Connecting an Xbee to the Axon
« Reply #5 on: December 12, 2009, 12:06:35 AM »
I use an 900 pro Xbee on a regulated board connected directly to an Axon Uart and have no issues at all. It has worked for a few months now.

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,938
  • Helpful? 98
Re: Connecting an Xbee to the Axon
« Reply #6 on: December 14, 2009, 03:25:01 PM »
Ok, I measured the DIN pin on the XBee with the diode in series from the PIC's Dout line.
The low level signal is 0.52 Volt.
« Last Edit: December 14, 2009, 04:42:38 PM by waltr »

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots
Re: Connecting an Xbee to the Axon
« Reply #7 on: December 14, 2009, 07:04:13 PM »
The low is fine. Whats the high level signal?

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,938
  • Helpful? 98
Re: Connecting an Xbee to the Axon
« Reply #8 on: December 16, 2009, 05:08:32 PM »
Ok, charged the battery and re-measured the serial signal levels.

PIC output to XBee regulator board: High = 4.65V, low = 0.14V
DIN on XBee pin: High = 3.20V, low = 0.50V


Offline bonzo

  • Beginner
  • *
  • Posts: 1
  • Helpful? 0
Re: Connecting an Xbee to the Axon
« Reply #9 on: December 23, 2009, 01:33:44 PM »
I too am using the sparkfun regulated explorer and am receiving commands just fine, but transmitting does not seem to work.

I have used the same combination of xbee / regulator with an arduino and have not problems transmitting and receiving.

With the axon, I have tried UART2 and UART0 and have tried baud rates of 9600 and 19200 with the same behavior.

Here is the really weird thing : when trying to transmit from the axon, the little green led on the xbee regulator lights up, but nothing is received on the computer and the corresponding green light on the USB explorer does not light up. BUT when I then send more commands from the computer, they are received by the AXON and the green transmit lights up on the AXON and the computer, but what comes across is just gibberish (on the computer). I have tried sending both single bytes and rprintf strings.

Again the thing that is odd is that when the AXON is just sending, the computer does not receive anything, but when the computer sends information to the AXON, the computer does receive information from the xbee, but it is just gibberish.

I have also tried two separate regulated explorers and xbees with exactly the same behavior and both work with arduino.

Any thoughts on this? I am kind of stuck any ideas would be appreciated.

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,938
  • Helpful? 98
Re: Connecting an Xbee to the Axon
« Reply #10 on: December 23, 2009, 02:32:43 PM »
You may need to look at the XBee's DIN pin with an O'scope to measure the logic low voltage level. A DVM may be good enough if you can set the Axon's output low.
The XBees docs say a logic low is less than 0.6V when Vcc is 3.3V. The Axon's output may not be pulling the DIN input low enough with the series diode. Note in my post above the PIC's low output is 0.14V and the XBee's DIN is 0.50V, the Axon's may be a little higher therefore the XBee's DIN may not be pulled low enough to be detected as a valid logic low.
This logic low threshold may shift slightly when the XBee is receiving data therefore making the DIN kinda working but misses a few low bits that shows as garbage on the PC.

I don't know what type of diode Sparkfun has on the board but from my measurements I suspect its a Schottky so replacing the diode won't help.
Another way is to short out the series diode and place a 5V to 3.3V level shifter between the Axon's serial output and the XBee's DIN. Alternately, replacing the series diode with a resistor voltage divider may also work. Lastly, replace the series diode with a series resistor and then clamp the XBee's DIN pin with several series diodes from ground to 3.3V max.


Offline KurtEck

  • Robot Overlord
  • ****
  • Posts: 217
  • Helpful? 12
Re: Connecting an Xbee to the Axon
« Reply #11 on: December 30, 2009, 12:13:38 PM »
Have you had any more luck with this?

I am hooking up an XBEE to the Axon2 with the sparkfun regulated explorer and it appeared like I was not having any luck getting it to communicate.

So I grabbed one of my APPBee-Sip boards from Selmaware.com (which is twice the price and probably twice as big as it has a full built in voltage regulator and an IC that does voltage conditioning...  Will use the Sparkfun version with one of my BAP28 based robots or test board...

Offline webgeek

  • Jr. Member
  • **
  • Posts: 32
  • Helpful? 0
Re: Connecting an Xbee to the Axon
« Reply #12 on: January 06, 2010, 09:45:33 AM »
Quote
So I grabbed one of my APPBee-Sip boards from Selmaware.com (which is twice the price and probably twice as big as it has a full built in voltage regulator and an IC that does voltage conditioning...
And did it work? Thanks!

-Mike

Offline KurtEck

  • Robot Overlord
  • ****
  • Posts: 217
  • Helpful? 12
Re: Connecting an Xbee to the Axon
« Reply #13 on: January 06, 2010, 03:41:23 PM »
Quote
So I grabbed one of my APPBee-Sip boards from Selmaware.com (which is twice the price and probably twice as big as it has a full built in voltage regulator and an IC that does voltage conditioning...
And did it work? Thanks!

Yep it works like champ.  Note it is a lot larger than the sparkfun one and twice the price.


Also note I have been experimenting using the RTS signal of XBEES, which why there is an extra wire soldered into the sprkfun one.  On Basic Atom Pro there are a couple of IO pins which do not output the full 5V so I can get awy with connecting it directly...  Otherwise sparkfun does sell a board that can convert Two input and Two outputs between two voltages.
Kurt


Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots
Re: Connecting an Xbee to the Axon
« Reply #14 on: September 12, 2010, 12:43:56 PM »
The output from the Xbee is only ">= 2.7 V", which is probably too low for the Axon UART. It probably needs closer to >=3.3V. I couldn't find a voltage requirement for UART on a quick glance through the 640 datasheet

Also, selmaware.com has discontinued the AppBee boards . . . anyone know of a good replacement?

Quote
We have discontinued the AppBee XBee adapter boards. For other choices, please visit Parallax selection or other vendors, such as www.sparkfun.com. This page will be left up for reference for a while.



edit: I just found this Parallax XBee SIP Adapter:
http://www.parallax.com/Store/Accessories/CommunicationRF/tabid/161/ProductID/691/List/0/Default.aspx?SortField=ProductName,ProductName
Anyone can verify it works? I'll probably just get it and find out the hard way :P

« Last Edit: September 12, 2010, 01:05:05 PM by Admin »

Offline madsci1016

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,450
  • Helpful? 43
Re: Connecting an Xbee to the Axon
« Reply #15 on: September 12, 2010, 03:00:45 PM »
Something is still fishy here. I have used nothing but a Sparkfun regulated board and both a 900 and 2.4 Xbee with my Axon just fine for a year now. Now the other end is just a regulated board and a 5V Arduino, also works fine.

I have an O-scope home this weekend so i'm going to measure the high level voltage off my Xbee and i'll report back.

Why are we getting such mixed results on this?

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots
Re: Connecting an Xbee to the Axon
« Reply #16 on: September 12, 2010, 03:30:37 PM »
madsci1016, well, you are using an ATmega168 (or whatever your Arduino has), which potentially could accept lower UART voltages. Try on your Axon II and see what happens.

Anyway, I tried the Sparkfun adapter on my Axon II and it didn't work for me, either. The Parallax adapter has been ordered.

Offline madsci1016

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,450
  • Helpful? 43
Re: Connecting an Xbee to the Axon
« Reply #17 on: September 12, 2010, 04:14:02 PM »
madsci1016, well, you are using an ATmega168 (or whatever your Arduino has), which potentially could accept lower UART voltages. Try on your Axon II and see what happens.

Anyway, I tried the Sparkfun adapter on my Axon II and it didn't work for me, either. The Parallax adapter has been ordered.

328, and why would it be different then the 640? And would the Axon 1 be different then the 2?

Quote
I have used nothing but a Sparkfun regulated board and both a 900 and 2.4 Xbee with my Axon just fine for a year now.

Offline madsci1016

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,450
  • Helpful? 43
Re: Connecting an Xbee to the Axon
« Reply #18 on: September 12, 2010, 06:28:19 PM »
Just probed SAGAR. IO line high is 3.35 volts, what I expect out of a 3.3 V device.

Dug into the Atmega 644 data sheet. A logic High min value (or quote "the lowest value where the pin is guaranteed to be read as high")  is 0.6VCC when VCC is 5V; or exactly 3.00V. So it makes sense that it works for me, 3.35 > 3.00.

Admin is right about the Xbee however. Spec sheet says Min high output is 0.82*VCC or 2.7 V

So the problem seems to be people are getting Xbee's with lower output voltages. It's a matter of lottery if it will work with an Axon (1 or 2).

You could add a NPN and a PNP transistor to SFE regulator boards to make it work.

I'm going to SFE to suggest the change.
« Last Edit: September 13, 2010, 02:05:53 PM by madsci1016 »

Offline madsci1016

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,450
  • Helpful? 43
Re: Connecting an Xbee to the Axon
« Reply #19 on: October 19, 2010, 10:30:00 PM »
This one is smaller, I wonder how well  it works:

http://www.seeedstudio.com/depot/uartsbee-v31-p-688.html?cPath=104_109


Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots
Re: Connecting an Xbee to the Axon
« Reply #20 on: October 20, 2010, 10:22:12 AM »
This one is smaller, I wonder how well  it works:

http://www.seeedstudio.com/depot/uartsbee-v31-p-688.html?cPath=104_109

It won't work - there is nothing on board that'll up a 3.3V signal to 5V.
(that I could tell, at least)

Offline madsci1016

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,450
  • Helpful? 43
Re: Connecting an Xbee to the Axon
« Reply #21 on: October 20, 2010, 10:43:33 AM »
Yeah, you are right. They hadn't put up the schematic when I found this, so I just had to guess. But there's nothing on the schematic.

Offline knossos

  • Robot Overlord
  • ****
  • Posts: 278
  • Helpful? 14
Re: Connecting an Xbee to the Axon
« Reply #22 on: October 20, 2010, 01:08:46 PM »
http://www.parallax.com/Store/Accessories/CommunicationRF/tabid/161/ProductID/691/List/0/Default.aspx?SortField=ProductName,ProductName
Anyone can verify it works? I'll probably just get it and find out the hard way :P

Has anyone tried this board out yet to see if it works?
"Never regret thy fall,
O Icarus of the fearless flight
For the greatest tragedy of them all
Is never to feel the burning light."
 
Oscar Wilde

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots
Re: Connecting an Xbee to the Axon
« Reply #23 on: October 20, 2010, 01:24:57 PM »
http://www.parallax.com/Store/Accessories/CommunicationRF/tabid/161/ProductID/691/List/0/Default.aspx?SortField=ProductName,ProductName
Anyone can verify it works? I'll probably just get it and find out the hard way :P

Has anyone tried this board out yet to see if it works?

Yeap, it works. I'm using two of them now.

Offline jgrizou

  • Beginner
  • *
  • Posts: 4
  • Helpful? 0
Re: Connecting an Xbee to the Axon
« Reply #24 on: December 28, 2010, 12:00:20 PM »
Hi,

I am late but I don't want to create a new topic.
I just read it and I woud like to have a final conclusion because I am a beginner.
If I want to connect my XBEE to the Axon II, I cannot do it directly because of the voltage level,
The Uart of the Axon is TTl 5V and the XBEE work with 3.3V.
So there is two board presented here :
 1>>>>>http://www.parallax.com/Store/Accessories/CommunicationRF/tabid/161/ProductID/691/List/0/Default.aspx?SortField=ProductName,ProductName
2>>>>>>http://www.sparkfun.com/products/9132
It look like the one on sparkfun is not working and the one on parallax work fine, could you explain me why.
If I had to adapt the level alone I will use a max232 but none of the product above have one. But the parallax one have one more "chip" than the sparkfun so it is probably an equivalent to max232?
Does someone could close this topic by explaining me how to connect a XBEE to a Axon II UART?
Thanks from France

John

Offline KurtEck

  • Robot Overlord
  • ****
  • Posts: 217
  • Helpful? 12
Re: Connecting an Xbee to the Axon
« Reply #25 on: December 28, 2010, 01:11:02 PM »
You are correct that you need some form of voltage conversion from the 3.5 to 5 volts.  On some platforms the Sparkfun worked fine for me.  However on some processors, such as the Axon2 I had problems with the Sparkfun one, and had better luck with the Parallax one or another one from a different company that is no longer making them.

What is the difference?  If my memory is correct the sparkfun version uses diodes to drop the voltage from 5v to be low enough (from the output of the Axon to the input of XBee.  However it does not do anything to raise the output voltage coming from the XBee  to the Axon. The problem I believe was that the output voltage for a high was not high enough to be read as a high by the UART of the axon...

The Parallax version uses a voltage conversion chip which properly adjusts the voltages going in both directions.

It is pretty easy to hook up to an Axon2.   What I often will do is use a 3 wire servo extension cable, such as this one from lynxmotion: http://www.lynxmotion.com/p-83-servo-extender-cable-12.aspx
I plug one end of it into the Parallax adapter you mentioned, with the black wire connected to Gnd... On the other side of the extension cable, I use an exacto knife to help pull the signal wire out of the 3 pin housing.  I then often use a little heat shrink on that pin.  I plug the cable into one of my unused regulated 3 pin servo connectors on the Axon (minus the signal). I plug the signal wire into  the "R" pin of the desired UART.  I then create a 4th wire.  Often I do this by extracting a lead from another servo extension wire and I heat shrink both ends. I plug one end into the DIN pin of the Parallax adapter and the other end into the "T" pin of the UART...  You probably don't need the RTS line...

Good Luck
Kurt

Offline madsci1016

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,450
  • Helpful? 43
Re: Connecting an Xbee to the Axon
« Reply #26 on: December 28, 2010, 03:44:04 PM »
My comment on the Sparkfun board product pages say it all, and of course no one from sparkfun will respond, since they know they screwed up.

"The MIN High output voltage for an Xbee is only 0.82*VCC or 2.7 V. The MIN High input voltage for a 5V AVR is 0.6VCC or exactly 3.00V.

2.7 is not greater then 3.0, so not every Xbee will be able to talk to 5V AVR with out proper level shifting. You need to add a level shifter to the DOUT line of this board."

Offline Gertlex

  • Supreme Robot
  • *****
  • Posts: 744
  • Helpful? 23
  • Nuclear Engineer Roboticist
Re: Connecting an Xbee to the Axon
« Reply #27 on: June 20, 2011, 09:46:33 PM »
I initially bought the Parallax board, and that worked fine (but twice as big and zero mounting holes? Lame...  With the encouragement of some of the Trossen guys, I went ahead and ordered the sparkfun version, and it is in fact working.

I'm using the Axon, but I'm using the 1.25 mW xbees (e.g. here) rather than the (seemingly) more commonly used 1mW ones.

If it ever turns out to be flaky, I have the parallax one, at least. (And I'll post here again...)
I

Offline joe61

  • Supreme Robot
  • *****
  • Posts: 417
  • Helpful? 16
Re: Connecting an Xbee to the Axon
« Reply #28 on: June 21, 2011, 06:46:21 AM »
The output from the Xbee is only ">= 2.7 V", which is probably too low for the Axon UART. It probably needs closer to >=3.3V. I couldn't find a voltage requirement for UART on a quick glance through the 640 datasheet

Also, selmaware.com has discontinued the AppBee boards . . . anyone know of a good replacement?



This is kind of late, but I have a couple of these http://www.adafruit.com/products/126 that have been working well for me.

Joe

Offline Gertlex

  • Supreme Robot
  • *****
  • Posts: 744
  • Helpful? 23
  • Nuclear Engineer Roboticist
Re: Connecting an Xbee to the Axon
« Reply #29 on: May 06, 2012, 08:41:15 PM »
I initially bought the Parallax board, and that worked fine (but twice as big and zero mounting holes? Lame...  With the encouragement of some of the Trossen guys, I went ahead and ordered the sparkfun version, and it is in fact working.

I'm using the Axon, but I'm using the 1.25 mW xbees (e.g. here) rather than the (seemingly) more commonly used 1mW ones.

If it ever turns out to be flaky,
I have the parallax one, at least. (And I'll post here again...)


So I discovered at Robogames that my Series 2 (1.25mW) xbees were not giving me a clean connection.  Thankfully I had a pair of series 1's with me and was able to compete with those.  However, I was unable to get data back from the robot via the xbees, and I suspect the Sparkfun board is the culprit.  I've not thoroughly investigated this, but there is some discussion on the Sparkfun product page that I think is related to this...  Bummer, really, because all of the other boards are like 40% larger or more.
« Last Edit: May 06, 2012, 08:52:12 PM by Gertlex »
I

 


Get Your Ad Here

data_list