XBee and Raspberry Pi

XBee projects like the adapter, xBee tutorials, tweetawatt/wattcher, etc. from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
lilje053
 
Posts: 2
Joined: Mon Jul 16, 2018 5:19 pm

XBee and Raspberry Pi

Post by lilje053 »

Hi,

My lab is conducting a project where we need to attach an XBee (not sure what model yet) to a Raspberry Pi 3 Model B. The Raspberry Pi has a GPS hat soldered onto it and we need the micro USB port to power the Pi. Is there a way to attach the XBee to one of the USB ports using an adapter or what would be the best way to attach it? I am not very educated on this kind of technology but my job is requiring me to learn it quickly. Thank you for the help.

User avatar
Franklin97355
 
Posts: 23903
Joined: Mon Apr 21, 2008 2:33 pm

Re: XBee and Raspberry Pi

Post by Franklin97355 »

Find out the model you will be using and get back to us. Most xbees do not require USB to communicate.

User avatar
daveh225
 
Posts: 54
Joined: Sat Mar 30, 2013 7:15 pm

Re: XBee and Raspberry Pi

Post by daveh225 »

XBees communicate over UART, so you can connect one to the TX and RX pins on the Pi. It's powered by 3.3V. They use a 2mm pitch connector so they're not breadboard friendly. Adafruit do make a breakout board for them, but it's designed to take a USB connection. You can use it without USB as each pin is broken out, or you can find non-USB boards (less expensive since they don't have the USB chip and connector) from other suppliers.

You can also get USB splitters that might solve your issue by providing data to the XBee, (via the breakout board), and power only to the GPS. If the GPS communicates over USB as well as gets its power from it then this won't work, you'll need some kind of USB hub.

User avatar
pmseattle
 
Posts: 6
Joined: Wed Dec 12, 2018 11:32 am

Re: XBee and Raspberry Pi

Post by pmseattle »

lilje053 wrote:Hi,

My lab is conducting a project where we need to attach an XBee (not sure what model yet) to a Raspberry Pi 3 Model B. The Raspberry Pi has a GPS hat soldered onto it and we need the micro USB port to power the Pi. Is there a way to attach the XBee to one of the USB ports using an adapter or what would be the best way to attach it? I am not very educated on this kind of technology but my job is requiring me to learn it quickly. Thank you for the help.

I don't know if you found the answer to your question yet, but I am using an XBee S2C module with my Pi 3 B and have been running it now for a few years, since about the time the Pi 3 B first came out. I have it plugged in to one of the USB connectors with a SparkFun XBee Explorer. Adafruit sells, or did at one time, a similar device made by Parallax which needs a cable to connect to the Pi. I downloaded the necessary libraries from Digi, also their very comprehensive documentation. It was surprisingly quick and easy to get everything up and running. My code on the Pi is written with Python. I think it's easier to run an XBee on the Pi with a USB adapter than it would be using the Tx/Rx pins on the GPIO connector, since you will have to provide a 3.3V supply to the XBee as well as a reset. An XBee can pull a fair amount of current while transmitting, especially if it is an XBee Pro, and I would be concerned about using the Pi's 3.3V regulator to supply the XBee. The USB adapter is powered by 5V and you can have a very stiff 5V supply - I think the one I use was a 2.5 amp USB adapter from Adafruit. With the USB adapter all you need to do is plug the XBee into the adapter, plug the adapter in to the Pi, and it's ready to go with no external wiring required. One other nice thing with the USB adapter is that it has an RSSI indicator LED that is useful for verifying that your device is actually communicating via RF.

User avatar
lilje053
 
Posts: 2
Joined: Mon Jul 16, 2018 5:19 pm

Re: XBee and Raspberry Pi

Post by lilje053 »

pmseattle wrote:
lilje053 wrote:Hi,

My lab is conducting a project where we need to attach an XBee (not sure what model yet) to a Raspberry Pi 3 Model B. The Raspberry Pi has a GPS hat soldered onto it and we need the micro USB port to power the Pi. Is there a way to attach the XBee to one of the USB ports using an adapter or what would be the best way to attach it? I am not very educated on this kind of technology but my job is requiring me to learn it quickly. Thank you for the help.

I don't know if you found the answer to your question yet, but I am using an XBee S2C module with my Pi 3 B and have been running it now for a few years, since about the time the Pi 3 B first came out. I have it plugged in to one of the USB connectors with a SparkFun XBee Explorer. Adafruit sells, or did at one time, a similar device made by Parallax which needs a cable to connect to the Pi. I downloaded the necessary libraries from Digi, also their very comprehensive documentation. It was surprisingly quick and easy to get everything up and running. My code on the Pi is written with Python. I think it's easier to run an XBee on the Pi with a USB adapter than it would be using the Tx/Rx pins on the GPIO connector, since you will have to provide a 3.3V supply to the XBee as well as a reset. An XBee can pull a fair amount of current while transmitting, especially if it is an XBee Pro, and I would be concerned about using the Pi's 3.3V regulator to supply the XBee. The USB adapter is powered by 5V and you can have a very stiff 5V supply - I think the one I use was a 2.5 amp USB adapter from Adafruit. With the USB adapter all you need to do is plug the XBee into the adapter, plug the adapter in to the Pi, and it's ready to go with no external wiring required. One other nice thing with the USB adapter is that it has an RSSI indicator LED that is useful for verifying that your device is actually communicating via RF.
Thanks for the response! I just have a couple questions to clarify some things. I'm not sure what you mean by USB adapter? Is that basically just an android charger with the micro USB plugged into the SparkFun XBee Explorer and the USB plugged into the pi? Also, what are the libraries from Digi for and how do you which ones to download? Again, thank you for the responses!

User avatar
pmseattle
 
Posts: 6
Joined: Wed Dec 12, 2018 11:32 am

Re: XBee and Raspberry Pi

Post by pmseattle »

Thanks for the response! I just have a couple questions to clarify some things. I'm not sure what you mean by USB adapter? Is that basically just an android charger with the micro USB plugged into the SparkFun XBee Explorer and the USB plugged into the pi? Also, what are the libraries from Digi for and how do you which ones to download? Again, thank you for the responses![/quote]


There is an XBee Explorer that you connect via a USB/micro USB cable to (in this case) your Pi, or an XBee Explorer dongle that plugs directly into one of the four USB connectors on your Pi:

https://www.sparkfun.com/products/11812
or
https://www.sparkfun.com/products/11697
or
https://www.adafruit.com/product/247

Any of these will work fine; I use the sparkfun dongle.

The libraries from Digi are now available from github, along with the documentation. See this:

https://www.digi.com/blog/introducing-t ... n-library/

The documentation is included but in HTML. If you prefer pdf:

https://media.readthedocs.org/pdf/xbpli ... xbplib.pdf

In your Python program you should open your XBee device as /dev/ttyUSB0 (assuming it is the only USB serial device attached, also assuming you are using Python).

If you're not up to speed on wireless sensors and associated programming, and XBee in particular, there is a useful book "Building Wireless Sensor Networks Using Arduino" by Mathijs Kooijman. Or, "Building Wireless Sensor Networks" by Robert Faludi, which is good but dated.

User avatar
adafruit_support_bill
 
Posts: 88041
Joined: Sat Feb 07, 2009 10:11 am

Re: XBee and Raspberry Pi

Post by adafruit_support_bill »

how do i post a support help i need to know how to send a new topic someone please help i need help
Go to the forum index and select the appropriate forum. There will be a "Post A Topic" button on the top left of the page.

Locked
Please be positive and constructive with your questions and comments.

Return to “XBee products (discontinued)”