Interfacing XBee Modules with the Raspberry Pi

You can use two XBee modules to exchange data between them, as they are modular, self-contained, and low-cost components using radio frequency to communicate. Most XBee modules transmit on the ling-range 900 MHz or on 2.4 GHz using their own network protocol.

The primary advantage of using XBee modules is their size—nearly as large as a postage stamp. Therefore, it becomes easy to use them as sensor nodes in small projects. They consume very low power, and incorporate a special sleep mode that reduces their power consumption considerably. This is of advantage when using them on battery or solar power.

XBee modules can read their data pins and transmit the collected data to another XBee module. Therefore, if you have a sensor node and a data-aggregator node, you can easily link them together with XBee modules. As there is no micro-controller on the XBee module, it has only a limited amount of processing power for controlling the module.

This limited processing power makes it suitable for several sensor nodes, but not for all. For instance, although the XBee module can read data from sensors, it cannot do so from sensors requiring algorithms to interpret or extrapolate meaningful data—the additional calculations this requires may need assistance from a microcontroller. Incidentally, configuring an XBee module with the Digi configuration tool, X-CTU, requires a computer running the Windows operating system. For other operating systems, use a virtual machine to run Windows.

The XBee line of wireless modules has a list of different types, and you must select the one most suitable for your project. Some modules support proprietary protocols from Digi, others support UART or SPI to 802.11 b/g/n (Wi-Fi), while others support the ZigBee, and 802.15.4 protocols.

Several popular XBee modules support the ZigBee protocol. Therefore, many projects use the ZigBee modules available in the market. ZigBee modules have several more choices based on application. For instance, there are ZigBee embedded surface mount modules, and others that support the ZigBee feature set, and 802.15.4 protocols. The most popular among these are modules supporting the ZigBee Pro feature set.

The advantage with ZigBee is it is an open standard based on the IEEE802 standard, useful for network communications. ZigBee supports the formation of mesh networks to configure and heal broken links automatically, and allows the use of intermediate probes to transmit data over long ranges.

You can use a ZigBee development module with on-board USB interface or use an FTDI cable to interface it. Usually, in a mesh topology, you will need to assign each node with their individual roles as coordinator, router, or end device. You will need at least one coordinator in the network, while the mesh will require several routers.

You can use the explorer dongle to plug in the ZigBee module, and use the USB connector on the dongle to plug the combination into one of the USB ports on the Raspberry Pi (RBPi). To communicate, you will need another pair of dongle and ZigBee module on the USB port of a computer or laptop. You will need to select the correct com port, and a common baud rate on a HyperTerminal to initiate communication between the modules.