

XBee is a series of microcontroller-based radios designed to enable wireless communication in a wide range of applications. These modules utilize the Zigbee protocol, which is ideal for creating low-power, low-data-rate wireless networks. XBee modules are widely used in IoT (Internet of Things) devices, home automation, industrial control systems, and wireless sensor networks. Their ease of use, reliability, and flexibility make them a popular choice for both hobbyists and professionals.








The XBee module typically has a 20-pin configuration. Below is a table describing the pin functions:
| Pin | Name | Description |
|---|---|---|
| 1 | VCC | Power supply input (2.8V to 3.3V). |
| 2 | DOUT | UART Data Out (TX). Transmits serial data to the host microcontroller. |
| 3 | DIN | UART Data In (RX). Receives serial data from the host microcontroller. |
| 4 | DIO12 | Digital I/O or ADC input (configurable). |
| 5 | RESET | Reset input. Active low. |
| 6 | RSSI | Signal strength indicator (PWM output). |
| 7 | DIO10 | Digital I/O or PWM output (configurable). |
| 8 | DIO11 | Digital I/O or ADC input (configurable). |
| 9 | DIO4 | Digital I/O or ADC input (configurable). |
| 10 | GND | Ground. |
| 11 | DIO3 | Digital I/O or ADC input (configurable). |
| 12 | DIO2 | Digital I/O or ADC input (configurable). |
| 13 | DIO1 | Digital I/O or ADC input (configurable). |
| 14 | DIO0 | Digital I/O or ADC input (configurable). |
| 15 | ASSOC | Association indicator (blinks to indicate network status). |
| 16 | ON/SLEEP | Indicates module sleep status (high = awake, low = asleep). |
| 17 | CTS | Clear to Send (UART flow control). |
| 18 | RTS | Request to Send (UART flow control). |
| 19 | AD0/DIO0 | Analog input or digital I/O (configurable). |
| 20 | NC | Not connected. Reserved for future use. |
Below is an example of how to send data wirelessly between two XBee modules using an Arduino UNO:
#include <SoftwareSerial.h>
// Define RX and TX pins for SoftwareSerial
SoftwareSerial XBee(2, 3); // RX = pin 2, TX = pin 3
void setup() {
Serial.begin(9600); // Initialize Serial Monitor
XBee.begin(9600); // Initialize XBee communication at 9600 baud
Serial.println("XBee Communication Initialized");
}
void loop() {
// Send data to XBee
XBee.println("Hello, XBee!");
// Check if data is received from XBee
if (XBee.available()) {
String receivedData = XBee.readString();
Serial.print("Received: ");
Serial.println(receivedData);
}
delay(1000); // Wait 1 second before sending the next message
}
2 and 3 in SoftwareSerial with the pins you are using for RX and TX.No Communication Between XBee Modules:
Data Corruption or Loss:
XBee Module Not Responding:
Q: Can I use XBee with a 5V microcontroller?
Q: How do I update the firmware on my XBee module?
Q: What is the maximum range of XBee?
Q: Can XBee modules communicate with non-XBee Zigbee devices?
By following this documentation, you can effectively integrate XBee modules into your wireless communication projects.