Fouad
Published

XBee Arduino Interfacing

Recently I’m getting a lot of queries regarding XBee, In this tutorial, I'm going to show you how to interface XBee with Arduino.

IntermediateFull instructions provided12,765
XBee Arduino Interfacing

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Digispark Xbee Pro S1
×1

Software apps and online services

Arduino IDE
Arduino IDE
Digispark X-CTU

Hand tools and fabrication machines

Premium Female/Male Extension Jumper Wires, 40 x 6" (150mm)
Premium Female/Male Extension Jumper Wires, 40 x 6" (150mm)

Story

Read more

Custom parts and enclosures

Components Required

Schematics

Proteus Circuit Diagram

Gnd Xbee - Gnd Arduino
Vcc Xbee - 3.3V Arduino
Tx - Rx pin D0 Arduino
Rx - Tx pin D1 Arduino

Assembling Hardware

Installing X-CTU

https://www.digi.com/resources/documentation/digidocs/90001526/tasks/t_download_and_install_xctu.htm

Add Your Xbee

The configuration of your XBee.

Channel = C
PAN ID = 3332
DH = 0
DL = 0
MY = 0

After Uploading The Code

1/ Open the Arduino's Serial Monitor. Make sure the baud rate is set to 9600.

2/ On your X-CTU click on console mode.

3/ Type something in the console view, it should show up on the Serial Monitor.

4/Now try typing something into the Arduino's Serial Monitor , then press send ,it should show up in the console view.

Code

XbeeArduino.ino

Arduino
#include <SoftwareSerial.h>
SoftwareSerial XBee(2, 3);

void setup()
{
  XBee.begin(9600);
  Serial.begin(9600);
}

void loop()
{
  if (Serial.available())
  { 
    XBee.write(Serial.read());
      }
  if (XBee.available())
  { 
    Serial.write(XBee.read());
      }
}

Credits

Fouad

Fouad

1 project • 9 followers

Comments