Hello guys,
In fact i am building a ZigBee gas fire detection system where i have a transmitter and receiver communicating via xbee modules. I need to connect each configured x bee modules to an Arduino UNO. I used a Spark Fun XBee Explorer USB (https://www.sparkfun.com/products/11812) to configure the xbee modules. I was trying to use the
Spark Fun XBee Explorer Regulated (https://www.sparkfun.com/products/11373) to connect the xbee to the arduino UNO.
Can someone tell me how to connect the xbee to the arduino UNO ?
Also can someone give some codes that i can use for both xbees to communicate between each other?
Also anyone knows about a special serial passthrough sketch that can be loaded onto the Arduino and use Software Serial to talk to the XBee.
Sorry for the late reply, give this a try:
/*****************************************************************
Serial Passthrough sketch.
Set up a software serial port to pass data between another serial
device and the serial monitor.
Hardware Hookup:
Connect your serial devices TX pin to Arduino pin D2 (Software RX)
Connect your serial devices RX pin to Arduino pin D3 (Software TX)
Connect ground on your serial device to ground on the Arduino
*****************************************************************/
// We'll use SoftwareSerial to communicate with the serial device.
#include <SoftwareSerial.h>
// Devices DOUT (TX) is connected to pin 2 (Arduino's Software RX)
// Devices DIN (RX) is connected to pin 3 (Arduino's Software TX)
SoftwareSerial Device(2,3); // RX, TX
void setup()
{
// Set up both ports at 9600 baud. This value is most important
// for the XBee. Make sure the baud rate matches the config
// setting of your XBee.
Device.begin(9600); //Create a new 'software' UART on the Arduino and name it 'Device'
Serial.begin(9600); //Connect the Arduino to the serial monitor over USB.
}
void loop()
{
if (Serial.available())
{ // If data comes in from serial monitor, send it out to XBee
Device.write(Serial.read());
}
if (Device.available())
{ // If data comes in from XBee, send it out to serial monitor
Serial.write(Device.read());
}
}