Hello friends , I hope you all are fine and having fun with your lives. Today, I am going to share a new project which is XBee Arduino Interfacing. In my previous tutorials in the XBee series, we have had first Introduction to XBee Module and after that we have also discussed How to Interface XBee Module with Computer. Now we are all well aware of XBee Module and can easily do the XBee Arduino Interfacing. We have seen in the previous tutorial that XBee Module works on Serial protocol so we have to use the Serial Pins of Arduino UNO board.

If you want to use any other microcontroller then you can its not a big issue, just see the way how the programming goes and convert it to the language of your microcontroller i.e. PIC Microcontrollers or 8051 Microcontrollers. If you guys have any question, you may contact me or can ask in the comments. so, let’s get started with XBee Arduino Interfacing:

XBee Arduino Interfacing

  • First of all you need to do is XBee Arduino Interfacing.
  • So, in order to do that you have to connect the Pin # 2 and Pin # 3 of Xbee with the Tx and Rx of Arduino and Pin # 1 to 3.3V of Arduino and Pin # 10 to ground of Arduino as shown in the below figure:

interfacing-of-xbee-module-with-arduino, xbee module with arduino, xbee arduino, xbee with arduino, arduino xbee

Note :

  • Don’t solder the XBee pins directly into the Arduino as it may damage the XBee.
  • You can buy the XBee Shield for Arduino.
  • After that attach your XBees with the two Arduino Boards and use the below code:
int b1 = 2;
int b2 = A3;int mode1 = A4;
int mode2 = A5;void setup()
pinMode(b1,OUTPUT);digitalWrite(b1, LOW);



void loop()
if (Serial.available() > 0)
Serial.print("+++"); delay(1000);
Serial.print("rnATDL1"); delay(100);
Serial.print("rnATCN"); delay(100);

  • Now add this code in one of your Arduino Board and a simple serial receiving code on the second arduino.
  • Now whenever you press the button you will get A on the second arduino board.
  • You can change it with anything you like and on the second side you can do anything by adding a condition.

That’s all for today. I hope you have enjoyed this tutorial XBee Arduino Interfacing. I will share more projects on XBee Arduino Interfacing soon. If you are getting any problem you can ask in comments. Thanks. ALLAH HAFIZ :))


    • Hi bro,

      don’t get confused …. if you are using Arduino UNO then simply connect pin # 2 of UNO Board with pin # 2 of XBee …. and pin # 3 of UNO Board with pin # 3 of XBee and you are on go …

  1. aoa.
    ZAIN bhai…..i want to puchase xbee S1 module…if it is availbel on your garage kindly inform us asap.
    we need it urgently..send me your cntact nbr.(0302-7437038).

  2. I wish to interface xbee and pic18f4520 so that heart beat readings from a heart sensor can be gotten on a pc wirelessly.how do i program the pic to send values to xbee

    • Hi,

      XBee works at TX / RX so use the same way as described above but as you are using PIC instead of Arduino so in order to send the reading you have to use serial pins of PIC microcontroller , If you want we can also provide you the complete coding, send us a message on Skype or help@theengineeringprojects.com.


  3. i am working on arduino mega-2560 to interface the vibration and distance sensor.i used a router AT and coordinator AT for Tx and Rx respectively. i have picked the sensor values but i am failed to transmit this data via xbee to another remote xbee( i am using a series 2 xbee). i tried many a times but can’t recieve the data on Rx side. i need your help. can you provide me the Rx and Tx code for this.

  4. i want to make a temperature monitoring sysytem using zigbee and pic 16f877a can u please tell me the interfacing for the same .

    • The logic will be exactly the same, zigbee works on Serial protocol so you simply need to connect the TX/RX pins of XBee to RX/TX pins of PIC respectively and you will be able to send or receive the data.

  5. Salam sir,

    We are planning to use Xbee for our final year project which is to design an automated guided vehicle based on wireless communication to accurately pick and place objects on respective loading and unloading stations.The issue is I just read your tutorial and Now I am confused , because we wanted one Xbee (transmitter) to be conncetd with PC/laptop and by using that Xbee we could communicate with Xbee (receiver) interfaced with arduino ,The information that we wanted to communicate is the location of object placed at shelves at loading station.But according to what you wrote we might be needing two ARDUINO UNO boards .Kindly let me know is it possible to interface one xbee(tranmitter) with pc/laptop and xbee(receiver) with arduino and they will communicate??

    • Wsalam,

      Yeah you can communicate between two xbees without using arduino, as in your case one xbee is connected with arduino and the other one directly to computer , it will work fine. Moreover you need to use usb explorer on pc side.


  6. Thank-you very much sir for your kind reply , Would you please enlighten me a little bit on what is Xbee explorer and and what is Xbee regulated?? Moreover we want to buy XBee module.Your guidance is required as to what components are necessary .

    • You can xbee from us and xbee explorer is a usb module in which you plug xbee and then connect it to your computer via usb. For components details you can call me and will let you know the details. Check the contact us page.


  7. Hi, i’m using xbee series 2 and arduino uno board for both transmitter and receiver.
    I configured both of the xbees to AT mode. I’ve connected pin 2 to transmitter and pin 3 to receiver for both.
    However, i still could not received data from one to another.

  8. Hello Sir

    can you provide for us a rf module library. and i would like to know if i can create a remote control using the xbee interface with arduino nano how should i connect them. i want one xbee connect to the arduino and the other without the arduino is it possible? please help Sir urgent

    • Kindly add me on Skype and we will discuss it out. My Skype id is theenggprojects. Moreover, XBee Library for Proteus is given on the blog. Make a search.


  9. . Sir i have done my Fyp by using Aurdino with Xbee . Now I want to use 8051 instead of Aurdino. But i am confused by reading your artcules. Sir it is right that Vcc pin of Xbee should be connect with 3.3v supply But plz sir tell me that why i can not connect Rx or Tx pin of 8051 directly to XBee .As i have checked the Tx pin of Aurdino Uno by multimeter it was 5v and i have directly connected to the Rx pin of Xbee and works properly.

  10. Hello sir!
    Do we really need Xbee shield to interface with any micro-controller ?
    Is Xbee S1 and S2 model are serial compatible with for all microcontrollers having 5V operating vltg.??
    Please tell me If you knw what I mean!! Thank you!
    Shriniwas K.

  11. Hello sir,
    Can u please provide me with the c code for interfacing Xbee with atmel16 microcontroller
    xbee interfacing with Atmega16 c code

  12. if I have several Xbees connected to sensors or appliances.
    and I need to control them through a control unit that comprises an arduino and Xbee as a coordinator ….I just have no clue how to write the code???…I used to specify the pin number in case I was connecting, for instance, a LED to the arduino….I don’t know what I have to do now

  13. I am working on the Xbee Arduino communication in Proteus.
    i need some help in that, as im not able to connect xbee to arduino.
    i connect Tx od xbee with tx of arduino but whenever i run simulation xbee node get disappear.

Leave a Reply

Your email address will not be published. Required fields are marked *

Post comment