Wireless data transfer using XBee modules

Description: This project does a data transfer using XBee modules. We read the data from a compass module CMPS03 Digital Compass (sensor). This data is read in using the I2C ports of the MBED and transferred to the serial port to which the XBee transmitting module is connected. The Compass function compass.readBearing() returns an integer value for the angle. This value is passed on to the serial port to which the XBee module is connected. This data is transmitted over the XBee wireless link. At the receiving end, we have another XBee module receiving data and passing it onto the serial port of the MBED. Then it can be displayed using an LCD or a serial port (Tera Term).

Care must be taken regarding the type of function used for writing and reading data from the serial port at the transmitter and receiver respectively. There are two options - either we can use the pair of printf() and scanf() statements or, we can use the pair of putc() and getc(). We used printf() and scanf() in this project since the 'direction' is a floating value and cannot be used as a variable for the getc()/ putc() function.

The scanf() function reads the numeric data till it receives the first non-numeric character. So inserting a null character or a new line is extremely important else the scanf() would keep on adding the value received & would eventually overflow.

The receiving module should read the data only when it is readable. Use the readable API function of the serial port to detect that & give sufficient delay between each transmission/reception.

XBee Connection Diagram:

1 VCC 3.3v

2 DOUT mbed serial rx (e.g. p10)

3 DIN mbed serial tx (e.g. p9)

4 not connected

5 RESET mbed digital out (e.g p11)

6-9 not connected

10 GND 0v/GND

11-20 not connected

Transmitter Code:

http://mbed.org/users/anoop1728/programs/xbeetx/lnbdhv

Receiver Code:

http://mbed.org/users/anoop1728/programs/xberx/lnbqf9

Video: http://www.youtube.com/watch?v=drltjog0mmo

/media/uploads/anoop1728/_scaled_105_0047.jpg


6 comments on Wireless data transfer using XBee modules:

28 Feb 2011

Project Members: Anoop Mahadevan, Vrajesh Sheth

15 Nov 2012

i want to ask that did you configure these xbee modules with XCTU software for setting their id's and baud rate??

31 Aug 2013

That is a good question Sanwal. I am wondering about that as well. Also can I use xbee series 1 with xbee series 2 or do they both have to be the same series? I have an xbee series 1 and series 2 doing the same exact project with 2 arm microcontrollers. I get the led blinking on the first MC but no response from the 2nd on recieving side. I'm trying to have data send over and display on hyperterminal via DB9 but no luck. I'm guessing you can't use series 1 with series 2. Or they need to be configured first somehow. Please help. Thanks

15 Sep 2013

Sanwal. You don't need to configure the xbee modules with XCTU software. Just make sure both modules are compatible with each other. That is both must be series 1 or both series 2. Series 2 will not work with series 1 module. There is a test video I uploaded using two series 1 xbee modules and ARM Microcontroller. http://www.youtube.com/watch?v=-l4bxJGgRZg

15 Sep 2013

Sanwal. You don't need to configure the xbee modules with XCTU software. Just make sure both modules are compatible with each other. That is both must be series 1 or both series 2. Series 2 will not work with series 1 module. There is a test video I uploaded using two series 1 xbee modules and ARM Microcontroller. http://www.youtube.com/watch?v=-l4bxJGgRZg

08 Mar 2014

Hello Anoop, The video in youtube is not available, may you provide an alternative link please. It would be very kind of you if you show us the schematic of the wiring.

Regards.

Please log in to post comments.