XBee Arduino Interfacing

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:

Other XBee Projects:

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:
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()
{
Serial.begin(9600);
delay(100);
pinMode(b1,OUTPUT);digitalWrite(b1, LOW);

pinMode(b2,INPUT_PULLUP);
pinMode(mode1,INPUT_PULLUP);
pinMode(mode2,INPUT_PULLUP);

}

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

}
  • 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 :))

Syed Zain Nasir

I am Syed Zain Nasir, the founder of <a href=https://www.TheEngineeringProjects.com/>The Engineering Projects</a> (TEP). I am a programmer since 2009 before that I just search things, make small projects and now I am sharing my knowledge through this platform.I also work as a freelancer and did many projects related to programming and electrical circuitry. <a href=https://plus.google.com/+SyedZainNasir/>My Google Profile+</a>

Share
Published by
Syed Zain Nasir