View Full Version : Xbee Series 2 Point to Point Duplex Configuration

2010-06-29, 19:26
The link for "Series 2" provided by Arduino.cc does not provide a complete configuration solution:
(http://www.humboldt.edu/~cm19/XBee%20setup.pdf). This article will only provide one way communication. Remote control is only possible with two way communication. For point to point this is achieved by ensuring that the SH/SL and DH/DL parameters mirror each other in the Coordinator and the Router as demonstrated in the following two X-CTU screens:
Assuming that you have followed the above article but selected the more current software "ZIGBEE ROUTER AT" (first), entered a PAN ID and note the SH and SL addressing numbers. When completing the "ZIGBEE COORDINATOR AT" (second) use the same PAN ID and also enter the Router SH/SL numbers in the DH/DL numbers for the Coordinator. This configuration provides two way communication.

Once you have installed the Xbees and you wish to upload a modified program to the Arduino follow these steps: move the two jumpers on the Arduino board to the USB position, remove the Xbee chip from the Xbee / Arduino Shield, connect the USB cable from your PC to the Arduino board, startup the Arduino Programming Environment, then hit the upload button.
To demonstrate Xbee Two Way Comm here is a result received by my PC:
This picture shows readings from RobotTank via Xbee to "SerialPort Terminal". "R" for infrared "P" for Sonic Ping "L" for Light Sensor. When I entered a "s" for a stop command RobotTank stopped and carried out a sonic scan providing an array of "H" for angle and "S" for sonic (cm to object) data to be loaded into a graph object.
The second picture demonstrates a too close object detected by infrared ("R282" up to "R535") thus causing an automatic stop and RobotTank sending morse code of "SOS".

What are the unsolved problems? Firstly the Xbee Shield blocks the Arduino Pin 0 (RX) and Pin 1 (TX) and I do not know what might happen if I soldered wires direct to Pin 1 for the Pololu Micro Serial Servo Controller and the Pololu Low-Voltage Dual Serial Motor Controller (Note the yellow wire sticking up in the RobotTank photo). Did the designer of the Xbee Shield deliberately block Pin 1 to protect the Xbee chip? The recommended solution is to use the NewSoftwareSerial Library but the Servo Library conflicits with this library and may be a barrier to future design. I will try the NewSoftwareSerial Library to determine whether it is a real solution.

The aerial supplied by Robotshop for the Xbee has a male connector and so has the Xbee chip got a male connector!

Many thanks.

Appendix: emails

Subject: RE: DIGI International, Update for Case: 1295307.
Date: Tuesday, 29 June 2010 11:10 a.m.


Thanks for the screen shots.
Yes, I can see why this is only transmitting in one direction. It is due to the DH=0 and DL=0 setting on your coordinator. Right now the coordinator is addressed to itself. The coordinator always has the 16 bit address of 0x0000. You should set the DH and DL of the coordinator to match the SH and SL of the router device respectively.
So, on your coordinator set:
DH=0013A200 and

This will allow the coordinator to transmit to the router.

As a side note, the ZNet 2.5 firmware is quite old and has been superseded by the XBee ZB firmware. I recommend that you upgrade the modules to ZB firmware. This can be done by selecting XB24-ZB in the modem pull down list, select Zigbee Coordinator AT for the function set and 2070 for the version. Then click the "Write" button. The module will be upgraded to XBee ZB
For the Router:
Select XB24-ZB in the modem pull down list, select Zigbee Router AT for the function set
and 2270 for the version. Then click the "Write" button. The module will be upgraded to XBee ZB

Please let me know if there is anything else I can help you with.

Best Regards,

Mark Grierson
Applications Engineer
Digi International


Yes your addressing looks good. Of course, if you use API, the addressing on the modules is irrelevant as packet addressing is contained in the API packet.

I can tell from the screen shots that at the time the router had not yet associated with the Coordinator as the OP, OI and CH are not yet matching the coordinator’s.

If you make changes to the coordinator after the network is formed (i.e. change the SC parameter) it will likely form a new PAN with a new OI and channel. If this happens you will need to issue a network reset of the routers to allow them to join the new network. In AT mode, you can do this by going to the terminal screen and issuing an ATNR0 command.

This will cause the module to discard its network settings and look for a new PAN to join.

Another hint: You may already know this but, If you have the “Always Update firmware” checkbox checked when you try to write a single parameter, the entire firmware will be re-written and this will take a considerable amount of time.

Please let me know if you have any further questions.


Mark Grierson

Applications Engineer

Digi International

2010-06-30, 07:56
Your experience is appreciated and we really hope you post a video!

2010-07-16, 22:37
Problems with the Arduino Duemila, two Pololu Controllers and the Xbee Sheild have been largely overcome with software resets and careful timing. Please refer to the Arduino code:
The C# Terminal Controller is based on "SerialPort Terminal" by Noah Coad, "Practical C# Charts and Graphics" by Jack Xu and Page 700 of "Pro .NET 2.0 Windows Forms and Custom Controls" by Matthew MacDonald. The serial com is on a different thread from that of the Windows Form.
The graph obtains data from Arduino via Xbee. Although the SRF08 Ultra sonic range finder is rotated 90 degrees while collecting the data, the sensor view is too broad to paint a picture of objects in front of the robotTank. A box with a side of 6.5cm facing the robotTank only 24cm distant provides a picture as attached above. Hence I am needing advice regarding a sensor with a narrow beam.

2010-07-19, 09:02
As far as non-contact distance sensors used in air, there are three main types: ultrasonic (http://www.robotshop.com/ultrasonic-range-finders.html), infrared (http://www.robotshop.com/infrared-light-sensors.html) and laser (http://www.robotshop.com/high-end-lasers-obstacle-detectors.html). Laser gives the most accurate result with the least spread. A URG-04LX (http://www.robotshop.com/hokuyo-urg-04lx-ug01-scanning-laser-rangefinder-1.html) would fit well on top of the RobotShop Rover, but you would need to change the processor as well. You can see a comparison of the Maxbotix ultrasonic sensors here (http://www.robotshop.com/Images/lv-maxsonar-ez-beam-width.jpg). You will see they offer a range of detection patterns. Note that for more accurate results, your sensor should be stationary when detecting values. Infrared should provide even better focus, and a combination of sensors, used with a software filter, would help even more. Aside from an upward curve on the left, it looks like the values you are getting for the box seem to be as expected.

2010-07-19, 20:53
Thank you for your reply Coleman. I hoped to achieve remote control without being present.
Cost wise the best option may be to use RB-Dev-15 http://www.robotshop.com/devantech-srf235-pencil-beam-range-1.html with a measurement every 15 degrees.
Do you know of anyone who has used RB-Plx-68 http://www.robotshop.ca/parallax-linescan-imaging-sensor-daughterboard-tsl1401.html perhaps with RB-Plx-69 http://www.robotshop.ca/parallax-basic-stamp-db-expander-daughterboard-to-sip.html and an Arduino Board? A single line scan shown in the graph might give enough information to chose a direction (without cheating!). Is this the only linescan product near this price bracket?
InfraRed is non-linear and inversed. I dont think I could translate the curve to a workable formula. It works perfectly to stop short of an object to avoid a crash but the choice of which way to turn is left to trail and error, perhaps never finding a way around the object.
Many thanks for your help.

2010-07-20, 10:34
Historically, even simple "left-turn" algorythms have proved successful. It is impressive how simple algorythms can accomplish advanced maze navigation, for example. The same can be said for sensors, you can get very creative with simple sensors and provide seemingly advanced "perception" abilities to your robot. It is always best to mix various sensor technologies though. This allows you to compensate for specific weaknesses each technology presents.

The Parallax TSL1401 Linescan Imaging Daughterboard can be used with the Arduino without too much effort due to its "Simple three-pin interface with analog pixel output". It is a quite affordable sensor for what it does. If you want professional grade sensors for navigation, GPS and Laser Scanners are the way to go, along with proximity sensors to prevent bumping into localized obstacles that get overlooked or "appear" in your robot's path.

Experiment, have fun and you will surely be amazed at what you can do with even simple sensors.

2010-09-25, 00:01
The attached photo of the C# application shows a graph created from data collected by the TSL1401DB linescan camera and sent to the PC via Xbee:
The Arduino C Code File is attached and includes a function "getcamera".

The graph is a shot of a lamp shining on a vertical strip of paper.

Has anyone else written Arduino code for the TSL1401DB? There are plenty of documents using BASIC stamp. I would appreciate any comments on the function "getcamera": the timing of the pulses etc. I believe that the exposure should be about 8333 microseconds. Mine I hope is about 8500 on the Duemilanove.

Many thanks

2012-01-31, 14:16
I hope to expand on this work and link back from http://www.rescuerobot.org to this page.

2013-02-23, 10:06

Thank you for posting your TSL1401-DB code on the Arduino forums.

I used your example code for my pgFocus project.

PgFocus (http://valelab.ucsf.edu/~MM/MMwiki/index.php/PgFocus)

2013-02-23, 14:27

Thank you for posting your TSL1401-DB code on the Arduino forums.

I used your example code for my pgFocus project.

PgFocus (http://valelab.ucsf.edu/~MM/MMwiki/index.php/PgFocus)

kbellve: Pleased you have used it. kgordon http://www.rescuerobot.org