Using XBee-PRO and Arduino with xbee-arduino library

An easy way to monitor remotely a sensor using XBee and Arduino is setting the API mode:

(in X-CTU configuration)

Serial Interfacing -> AP - API Enable = "2 - API MODE WITH ESCAPES"

Now any enabled digital or analog input will have its state transmitted from board A to board B. Unfortunately some XBees (i.e. XBee-PRO 900HP) doesn’t support (at least currently) Digital I/O Line Passing feature, then you need to write an Arduino program to interpret the API protocol.

Fortunately it is easy to do using the xbee-arduino project. You can find an example here:

A good book about this subject is the “Beginning Sensor Networks with Arduino and Raspberry Pi” by Charles Bell. There you will find some sample application using xbee-arduino library as well.