Arduino board interfacing with X-bee module.

      Project: Arduino interfacing with X-Bee S-2 module.

 1.    X-Bee module:

X-Bee module is wireless communication device which range may be up to 500 meter or above it and it have two version Pro and normal. This module may be used for high speed and much secure communication for data and information transmitting.


1.1 Specifications:

  • 3.3V @ 40mA
  • 250kbps Max data rate
  • 2 mW to 6 mW output (+3 dBm)
  • 100 to 500 meter range(for normal X-bee not Pro.)
  • Built-in antenna
  • Fully FCC certified
  • 6 10-bit ADC input pins
  • 8 digital IO pins
  • 128-bit encryption
  • Local or over-air configuration
  • AT or API command set
Data sheet of X-bee is Here:  Download X-Bee data sheet

NOTE: - Before using X-Bee first we need to configure some features in X-Bee like baud rate, Pan               ID, destination address channel etc. To understand the configurations please go to links below.

2.    X-bee operating mode: - X-bee module has two operating mode which can be used for         different purpose.

    2.1   AT mode: - In this data is transmitted bit by bit wise not in whole frame.

   What

     ·    AT mode is synonymous with "Transparent" mode.
     ·    In AT mode, any data sent to the X-Bee module is immediately sent to the remote module            identified by the Destination Address in memory.
     ·     If the X-Bee that the data is sent to is the Coordinator it will broadcast on the Pan ID.
     ·    No packet formation is necessary, but rather simple send Serial data to the tx of one X-bee          and it will be received by the Rx of the destination X-Bee
     ·    Because no packets are created the destination address and type (only-data) are both fixed.

   Why

     ·      If you are new to X-Bees this is the fastest way to start transmitting
     ·      If you only communication between two X-Bees
     ·      If you can implement an external protocol (Every X-Bee will have an associated mbed)

  How : - To configure X-Bees follow this tutorial: X-Bee Basic Setup for 6.1 XCTU version                            and  X-Bee set up for older version 5.2 for older version.


2.2   API mode: - In this mode data is transmitted in data frame and that frame contains     information of delimiter, transmitter x-bee module address and data and check sum.

    for better understanding of the API frame and API mode of X-Bee module go to below link.
    click here: -API frame structure

    What

     ·         API mode is "Application Programming Interface"
     ·         Data must be formatted in frames with Destination information and payload
     ·         The API is an alternative to the default transparent mode.

   Why

    ·         For larger networks that involve nodes talking to multiple targets
    ·         If X-Bees are gathering data without a embedded attached and thus can not format their own         data before sending
    ·         If power is a big concern and you would like End Devices to 'sleep' until data is requested.
    ·         Need to change parameters without entering command mode (X-Bee only)
    ·         Want to view RSSI and source address on a packet by packet basis
    ·         Would like to receive packet delivery confirmation on every transmitted packet

   How
             If you are using XCTU version 6.1 or   latest than go to:

3. Component needed in project: - With the help of X-bee module we can make many interesting project and establish communication between two different module of project or any arduino modules.


·         Arduino software:  https://www.arduino.cc/en/Main/Software
·         Two Arduino modules.
·         Two X-Bee modules.
·         1 Bred board.
·         Couple of jumper wires.
·         X-Bee explorer shield for Configuration of X-Bee module.


  4. Arduino interfacing with X-Bee modules: - In this project we would learn to            communicate two Arduino with AT and API mode and transfer serial data between them.

   
S. no
X-Bee pin
Arduino pin
1
VCC Pin 1(3.3 v)
3.3 v pin
2
GND pin 10
Any GND pin
3
TX pin 2
RX pin 0
4
RX pin 3
TX pin 1










Note: - Rx and Tx pin can be change on Arduino board if we use Software Serial function and forget to connect X-Bee with 3.3 v pin of Arduino. 

Note: - Be careful while configuration of x-bee other-wise your x-bee module will be break and                      then it won’t communicate with other one. And connect your x-bee with 3.3 v other-wise it                   may get damage permanently.

. 
If you X-Bee module get break accidentally than don’t worry it may get recover easily with few steps shown in video below.


5. Arduino board codes for this project

 5.1 Arduino code for X-bee API frame transmission or router side.  

      Upload this code in you router side or transmitter side Arduino board.

       5.2  Arduino code for X-bee API frame receiver or co-ordinator side .

             Upload this code in your Coordinator side Arduino board.         

        Download the X-Bee.h library from here:  Xbee.h library for Arduino.

Note: If you want to make some cool x-bee project than see my other project for remote sensor sensing with x-bee. Arduino board Remote sensor Sensing with X-bee module.

Please share and follow my project with your friends, if you like it.
  

Comments