xbee pro communication issue

The problem:

I recently purchased a pair of Xbee radios however one will transmit to the other just fine but the reverse creates unreadable characters. I believe I have isolated the problem down to either the Arduino or the regulated explorer board as I will explain after the description of my setup.

The setup:

The xbee radio i am using is the xbee pro (http://www.sparkfun.com/commerce/produc … ts_id=9099). One of which is hooked up to a Xbee usb explorer (http://www.sparkfun.com/commerce/produc … ts_id=8687), the other is hooked up to an Arduino using the Xbee regulated explorer (http://www.sparkfun.com/commerce/produc … ts_id=9132). The din pin and dout pin are soldered to wires and connected to the arduino digital pins. The Arduino and the Xbee regulated explorer are both powered using an external power supply set at 6 volts. The code on the Arduino is from ladyada’s web page (http://www.ladyada.net/make/xbee/point2point.html).

#include <NewSoftSerial.h>

NewSoftSerial mySerial =  NewSoftSerial(2, 3);


void setup()  {
  pinMode(13, OUTPUT);
  Serial.begin(9600);
  Serial.println("Goodnight moon!");
  // set the data rate for the SoftwareSerial port
  mySerial.begin(9600);
  mySerial.println("Hello, world?");
}



void loop()                     // run over and over again
{

  if (mySerial.available()) {
    Serial.print((char)mySerial.read());
  }
  if (Serial.available()) {
    mySerial.print((char)Serial.read());
  }
  delay(100);
}

Debugging to date:

I have swapped the radios between the two explorers and found that the one hooked up to the Arduino can still receive but when it transmits it still shows up as unreadable characters through the Xbee hooked up to the usb explorer. For this reason I believe the radios are functioning properly. I have also attempted to swap the input and output pins between the regulated Xbee explorer board and the arduino this resulted in the system not working at all until i swapped the order of the pin numbers in the NewSoftSerial() function at which point it shows the same behavior as before.

Any ideas as to why this is malfunctioning would be greatly appreciated.

probably an issue with the voltage level on that XBee 3.3V transmit serial data line.

Is that Explorer board the one with the diode in series with the data line? That has been discussed and a cure was defined for the impudent design of a diode in series (can’t get logic 0 low enough). But this issue may not have been with the Explorer.

It looks like there is in fact a diode on the din line which seems odd since I would think the current would be flowing the other way. Should I attempt to build my own level shifter then see if it works? Also can you recommend a schematic for this level shifter? (if not i will just google around until i find something)

Thank you.

The XBee explorer has a series diode on the XBee’s DIN line. This is to protect the XBee’s input from a 5V device. The XBee should have its internal pull-up enabled that sets a logic high. When an input is at a logic low it sinks current through the diode to pull down the DIN pin. This works fine when used with a PIC processor but have heard of problems with the Arduino.

I’ll guess your Arduino is running at 5V so a level shifted should solve the problem. I’d first try a simple voltage divider between the Arduino’s Dout and the XBee’s Din.

this issue has been previously discussed in this forum. The diode’s voltage drop causes the voltage for a logic 0 to be about 0.6V or so on the microprocessor side. That’s too little margin. It was a bad though cheap design for 3.3 to 5v translation.

So how can I find the impedance of the Din pin of the xbee so I know what values to use for the resistor divider?

So I just made the assumption that it was about 10k ohm and it seems to have worked. I made a voltage divider (http://en.wikipedia.org/wiki/Voltage_divider) with z1 being 330 ohms and z2 being 820. Where z1 is the resistor from the arduino data pin to the xbee din and z2 goes from the xbee din to ground. I removed the diode from the xbee regulated explorer and replaced it with a piece of wire.

Good job and thanks for posting your solution.

This will be helpful to others.

waltr:
Good job and thanks for posting your solution.

This will be helpful to others.

SFE should include a paper note on the cure on all shipments, and build more with a correct the design.

Hello, I have the same issue but could not understand your solution. I have 2 Xbee Pro 900 modules and they are mounted on the arduino shield. When reading the values on the receiving end using Serial.read() it gives me garbage values. You mentioned you resolved the issue by using a voltage divider. Can you point me to which pins correspond to arduino data pin and xbee din. Is there any other suggestions that I could try to make the XBee’s communicate? When sending data with XBee mounted on a Xbee explorer to a xbee mounted on a Arduino it works fine and I can see the values coming through fine. To me this looks like the XBee’s are configured correctly. Any help to resolve this issue would be greatly appreciated. Thanks.