Communication between XBee modules

by Jun 13, 2020Communication Protocols

The wireless networking device, XBee is a user friendly, popular and is a technology worth knowing about. It can transmit and receive data wirelessly, and thus can be used for many IoT applications. As the popularity of the XBee module has grown massively, there are now several modules types available in the market. The XBee Series 1, is the most popular by far. However, XBee Series 1 (S1) cannot communicate with ZigBee devices available in the market. But for communication between Xbee modules, which is the discussion of this article, it is very simple to understand and use

Communication between XBEE devices

XBee devices communicate with each other by sending and receiving wireless messages. These devices can only transfer wireless messages, after which they have no control over the sent data. XBee devices use the serial interface to communicate with various smart devices. The data from serial input is transmitted wirelessly and the received wireless data can be read through the serial output. This form of communication can be used for a multitude of purposes, from configuring a device to communicating complex messages. Various smart devices, and microcontrollers can be used with XBee devices to send and receive messages wirelessly.

There are two types of data transmission involved in XBee communication:

 Wireless communication:

Wireless communication takes place between 2 or more XBee modules. In order to wirelessly communicate they must be part of the same network and use the same radio frequency. Modules that meet these requirements, communicate through wireless communication.

Serial communication:

Serial communication takes place between a smart device and the XBee module connected to it. Data exchange between the two devices is passed through the serial interface.

Characteristics of XBee modules:

Channel: The channel calibrates the operating frequency within a 2.4GHz band. This is important since, as we know XBees must share the same operating frequency to communicate with each other.

PAN ID (Personal Area Network ID): For two XBees to communicate, they must share the same PAN ID. The PAN ID is often a number between between 0 and 0xFFFF, and you can change it on both devices to match.

Addressing: Each XBee module has a source address (called ‘My address’) and a destination address. An XBee’s destination address specifies the source address of the module it can send data to. It can be specified by a universal unique address of 64-bits. This address printed can be found on the back of the module. Alternatively, it may be specified with a 16-bit address that is unique within a network, or with text.

In communication, each XBee in a network has a specific role. The three roles are Coordinator, End Device, and Router. Each network has only one Coordinator, which serves as the root of the network tree. A network can have multiple Routers; these can forward information to end devices and also run application functions. Lastly, End Devices cannot relay data, but only talk to a parent node (either a Coordinator or Router). A network can have multiple End Devices.

If you have to XBees in hand and are ready to dive right in, here’s a short tutorial. This will show you how to get them to start communicating with each other. Otherwise, this will give you an insight on how XBee configuration is done to start communication.

Configuring XBee modules:

In order for two modules to wirelessly communicate with each other, we need to first tweak some settings. As we discussed just before this, the channel, PAN ID, and Address values need to be set to match with each other.

Step 1:

Download and install XCTU software.This is available for both Windows and Mac on the website.

Step 2:

Plug your first XBee into an Explorer module, which is a an extra board that provides access to the pins on the XBee. Connect this via USB to your computer’s USB port.

Step 3:

Open the XCTU software and click “Discover devices.”

Step 4:

We next have to select and configure the port. First select the port the module is connected to. On the next page, you will see the page displayed in the following picture:

Select the settings as such, as click on ‘Finish’.

Step 5:

From the “Devices discovered” list, where you should now be able to see your device, click “Add selected devices”.

Step 6:

Open up the settings for your device and make the following changes:

Channel (between 0x0 and 0xFFFF). Remember the number you choose here as it will have to be used for the other XBee as well.

PAN ID. Same as the channel, PAN ID can be anything you want (between,0 and 0xFFFF) but remember it in order to use for the other XBee.

Addressing configuration can be made very simple, since we are using only two XBees. Let the Destination High be 0. For the Destination Low and MY address, choose two different numbers and use them in exchange for each other in the other module. For instance,

XBee Module #1:
  • DH: 0
  • DL: 3
  • MY: 2
XBee Module #2:
  • DH: 0
  • DL: 2
  • MY: 3
For first XBee module

Step 7:

In the CE (Coordinator Enable) option, select Coordinator from the dropdown list. Then, click ‘Write.’

Step 8:

Now you can remove the XBee. Plug in the other XBee and repeat the above steps from 2 to 6. The only difference is on the second XBee, you can leave the CE(Coordinator Enable)  i.e., step 7 as 0, or select EndUser. Make sure to keep note of which module is the Coordinator and which is the end user.

Run a Communication Test between XBee modules:

Step 9:

Connect the XBees to their respective Explorer modules and plug them into different USB ports. Open the XCTU software to scan for devices, and select and add both the devices from the resulting list.

Step 10:

Click on one of the two modules displayed in the left-hand column. To start sending messages, we have to open the Console. To do this, click on the console icon to view the console, to start typing click Open.

Step 11:

Repeat the same for the other module to open both consoles. Then, type into one console and switch to the other to see your message reflected in the other console.

Now that you have successfully learnt and understood how to transmit messages between the two XBee modules, you can go ahead and start thinking about the applications you can use this in! Keep in mind the versatility that these small chips come with, you can connect them to larger devices like your computer. Alternatively, you could implement applications with SoCs like Arduino with the XBee modules.

Creating a multiplication Skill in Alexa using python

Written By Jyotsna Rajaraman

Hi! I'm Jyotsna, an electronics and communication undergrad who likes reading, writing, talking and learning. So when it comes to teaching, all my favorite things come together! I hope my articles have helped and taught you something. 🙂

RELATED POSTS

How to use a GSM/GPRS Module as an IoT device?

How to use a GSM/GPRS Module as an IoT device?

The convergence of physical objects and the digital world is known as IoT. IoT stands for the Internet of Things. It has been a trending field in the world of technology. In addition, the IoT describes the network of physical objects known as “things” that are...

Longwave Wireless Communication

Longwave Wireless Communication

Longwave wireless communication acts as a foundation for a Low power Wide Area Network. Mostly low energy is consumed in these types of networks. The reason is that most sensors are used for extracting data. These data are used for transmitting in long-range...

Architecture of a Bluetooth IoT Application

Architecture of a Bluetooth IoT Application

What is Bluetooth? To understand the architecture of Bluetooth first lets understand what actually Bluetooth is. Bluetooth is a radio-wave technology that is mainly designed to enable wireless communications over short distances. The frequency of these waves ranges...

Most Commonly Used Web Frameworks

Most Commonly Used Web Frameworks

Web Frameworks are software frameworks that are designed to help create Web apps, Web APIs and other resources. Web Frameworks help us solve two of the major hurdles of developing web apps - templates and routing. Now that we know what web frameworks are, lets get...

Role of WiFi in IoT

Role of WiFi in IoT

Internet of Things(IoT) applications has diverse connectivity requirements in terms of range, data throughput, energy efficiency, and device cost. WiFi is often an obvious choice in-building WiFi coverage is almost ubiquitous. It is not always an appropriate...

VIDEOS – FOLLOW US ON YOUTUBE

EXPLORE OUR IOT PROJECTS

IoT Smart Gardening System – ESP8266, MQTT, Adafruit IO

Gardening is always a very calming pastime. However, our gardens' plants may not always receive the care they require due to our active lifestyles. What if we could remotely keep an eye on their health and provide them with the attention they require? In this article,...

How to Simulate IoT projects using Cisco Packet Tracer

In this tutorial, let's learn how to simulate the IoT project using the Cisco packet tracer. As an example, we shall build a simple Home Automation project to control and monitor devices. Introduction Firstly, let's quickly look at the overview of the software. Packet...

All you need to know about integrating NodeMCU with Ubidots over MQTT

In this tutorial, let's discuss Integrating NodeMCU and Ubidots IoT platform. As an illustration, we shall interface the DHT11 sensor to monitor temperature and Humidity. Additionally, an led bulb is controlled using the dashboard. Besides, the implementation will be...

All you need to know about integrating NodeMCU with Ubidots over Https

In this tutorial, let's discuss Integrating NodeMCU and Ubidots IoT platform. As an illustration, we shall interface the DHT11 sensor to monitor temperature and Humidity. Additionally, an led bulb is controlled using the dashboard. Besides, the implementation will be...

How to design a Wireless Blind Stick using nRF24L01 Module?

Introduction Let's learn to design a low-cost wireless blind stick using the nRF24L01 transceiver module. So the complete project is divided into the transmitter part and receiver part. Thus, the Transmitter part consists of an Arduino Nano microcontroller, ultrasonic...

Sending Temperature data to ThingSpeak Cloud and Visualize

In this article, we are going to learn “How to send temperature data to ThingSpeak Cloud?”. We can then visualize the temperature data uploaded to ThingSpeak Cloud anywhere in the world. But "What is ThingSpeak?” ThingSpeak is an open-source IoT platform that allows...

Amaze your friend with latest tricks of Raspberry Pi and Firebase

Introduction to our Raspberry Pi and Firebase trick Let me introduce you to the latest trick of Raspberry Pi and Firebase we'll be using to fool them. It begins with a small circuit to connect a temperature sensor and an Infrared sensor with Raspberry Pi. The circuit...

How to implement Machine Learning on IoT based Data?

Introduction The industrial scope for the convergence of the Internet of Things(IoT) and Machine learning(ML) is wide and informative. IoT renders an enormous amount of data from various sensors. On the other hand, ML opens up insight hidden in the acquired data....

Smart Display Board based on IoT and Google Firebase

Introduction In this tutorial, we are going to build a Smart Display Board based on IoT and Google Firebase by using NodeMCU8266 (or you can even use NodeMCU32) and LCD. Generally, in shops, hotels, offices, railway stations, notice/ display boards are used. They are...

Smart Gardening System – GO GREEN Project

Automation of farm activities can transform agricultural domain from being manual into a dynamic field to yield higher production with less human intervention. The project Green is developed to manage farms using modern information and communication technologies....