Comments: XBee Shield Hookup Guide

Pages

Looking for answers to technical questions?

We welcome your comments and suggestions below. However, if you are looking for solutions to technical questions please see our Technical Assistance page.

  • --------------------- Tech Support Tips/Troubleshooting/Common Issues --------------------

    Having issues using this shield on your Arduino? Make sure that you check these things:

    1.) Check that the XBee_Serial_Passthrough.ino file is upload to the Arduino Uno with Atmega328P

    2.) Check that the switch is flipped ot the DLINE

    3.) Check your connections (i.e. your solder joints)

    5.) Check your power.

    4.) Ensure that the settings are set to the correct configuration to send data with your XBee.

    5.) If you are using an Arduino Mega, make sure to use the pins that are able to do software serial communication https://www.arduino.cc/en/Reference/SoftwareSerial.

    6.) If you are using a Arduino Leonardo or any board with an Atmega32U4, make sure that you are using the correct function to send data. Serial.print() just pipes data to the Serial monitor while Serial1.print() sends data through the UART. This is explained on the product page for the Arduino Leonardo https://www.arduino.cc/en/Main/ArduinoBoardLeonardo and in this code => https://learn.sparkfun.com/tutorials/pro-micro--fio-v3-hookup-guide#example-1-blinkies

  • cowan / about 10 years ago / 2

    Just a comment about using this shield with an Arduino Mega: The Mega doesn't support change interrupts on some of its pins, including pin 2 which is the pin this shield sends the RX to (in DLINE mode). So in order to get receiving data to work on a Mega, either use UART, or join pin 2 to one of the supported pins, and use that pin for RX. Supported pins: 10, 11, 12, 13, 50, 51, 52, 53, 62, 63, 64, 65, 66, 67, 68, 69

    • -------------------- Tech Support Tips/Troubleshooting/Common Issues --------------------

      Yup, common problem that comes up a lot when using this shield with a different Arduino package. =) After redefining the pins, you can always bend the pins if you soldered to the shield and reroute them similar to this tutorial => http://mcukits.com/2009/04/06/arduino-ethernet-shield-mega-hack/ . =)

      • Member #1536574 / about 5 years ago * / 1

        Thanks guys! I managed to make it work for my Mega by bending pins 0 and 1 out, using AltSoftSerial and connecting pins 0 and 1 to pins 48 and 46 (respectively), while having the switch in UART (MICRO for me) mode.

        • From the original comment that was sent to my e-mail, it looks like you had issues using a different shield (Arduino Wireless SD Shield) on the Arduino Mega 2560 when using the software serial? I'm glad to hear that you got it working. From what I remember when testing it out, the software serial define should match the rerouted pins when using the SparkFun XBee Shield. However, the Arduino Wireless Shield has a different pinout looking at the Eagle design files.

          Software serial should work if you define the pins for the Mega and reroute pins 0 and 1. AltSoftSerial is an alternative software serial library that can also be used with your XBee. As a quick note, I recommend adding some sort of logic level converter to safely translate the voltages between the Arduino Mega and the XBee like the SparkFun XBee Shield.

          • Member #1536574 / about 5 years ago / 1

            Thank you for your reply. I used AltSoftSerial for other reasons, SoftwareSerial works as well. I don't fully understand your recommendation about a logic level converter. I've never experienced any issues with voltage levels between the Mega and Xbee. Could you elaborate?

            • The Arduino Mega 2560 is a 5V system. The XBee is 3.3V system. To protect the I/O pins on your XBee, a logic level shifter is recommended. Otherwise, there is a possibility that you may blow out the XBee's pins or it may not work as expected. I'd rather have the converter around than replace an XBee radio. ;P

              Here's some resources.

              • Member #1536574 / about 5 years ago / 1

                Thanks for your explanation bboyho. I've read the resources, and did some research. The Arduino Wireless SD Shield already seems to provide 3.3V to the Xbee modules: "The Arduino Wireless SD Shield provides a 3.3v regulated Digi Xbee slot..."

                https://www.dfrobot.com/product-529.html

  • Member #1644644 / about 4 years ago * / 1

    Apologies if this is a Q better served for tech support;

    I recently received Xbee Arduino kit produced by your firm. I have a motion detection sensor and I want to use my Arduino w/ shield as remote radio. I want configure the xbee connected to shield's firmware to use a DIO pin as input and solder my sensor's signal out to said DIO pin, then configure my explorer board's radio to have same DIO as output to an LED/buzzer/etc.

    Does this seem like it would work or is my plan flawed?

    Thanks,

    • Member #1644644 / about 4 years ago * / 1

      I managed to connect the two Xbees via the DIO pins with the configuration I mentioned. Not sure if it was necessary but I put the switch into the UART position and the set up works. I have a WHDTS RCWL-0516 on the remote with it's signal going to DIO0. And on the base radio (connected via usb explorer board) I have a vibrating motor soldered to DIO 0 and gnd.

      When the sensor detects movement in it's range my vibrating motor goes off so now I have a silent alert system for myself.

      https://sites.google.com/site/xbeetutorial/ is a fairly useful guide for anyone looking for more learning materials on zigbee/xbee.

  • Member #502491 / about 8 years ago / 1

    Can someone explain the syntax for this line that was used in the example sketch?

    XBee.println(hl ? "HIGH" : "LOW");

    Why do we need to use this line instead of just writing the following? I know this line won't work (because I tried it), but why?

    XBee.println(hl);

    Additionally, why do we declare 'hl' as a char data type? We set 'hl' by taking the returned value of the function 'ASCIItoHL', which is an int data type. Should we just declare 'hl' as an int?

  • water_arduino / about 8 years ago / 1

    The tutorial was wonderful at first. But then the examples were somewhat meaningless when it came to real world problems. How can I have 2 zigbees both mounted on their respective shields and redboards, then measure an analog input with one, which then corresponds to an analog output on the other? Or something related to this? I am having one hell of a time even reading serial outputs using the shields.

  • Member #750922 / about 9 years ago / 1

    What is the DLINE position ? Thank you.

  • Member #687838 / about 9 years ago / 1

    Has anyone tested this with Intel Edison Arduino Breakout Kit? I am struggling it to get it to work.

  • dksmall / about 10 years ago / 1

    In order to use a software UART with pins 2 & 3, don't you need to short the pads on SJ1 and SJ3?? I don't that mentioned anywhere.

    • jimblom / about 10 years ago / 2

      It should work out of the box. We put a big ol' glob of solder across those jumpers during production to set them. You can kind of see them in this picture (bottom-right corner).

      • dksmall / about 10 years ago / 1

        Ok, I feel better now, thought I was missing something.


If you've found an issue with this tutorial content, please send us your feedback!