The Arduino board is built around an AVR microcontroller and it has all the required circuitary to get the built-in AVR microcontroller running. The Arduino can communicate with the other devices using its digital I/O, serial port, I2C port, SPI port etc. Any AVR microcontroller based board which follows the standard Arduino schematic and is flashed with the Arduino bootloader can be called an Arduino board. The Arduino IDE is so simple to use that anyone who has basic knowledge of c programming can quickly get started with it. The project on Getting started with Arduino explains the steps required to get start with an Arduino board.
The Arduino board used in this project is the Arduino pro-mini board and the IDE version of the Arduino is 1.0.3 for windows. The image of the Arduino pro-mini board and the Arduino IDE are shown below;
Since the arduino pro-mini board has no circuitary for interfacing it with the serial port or the USB port of the PC, an external USB to TTL converter board is required to connect it with the PC. This hardware helps in programming the Arduino board and also helps in the serial communication with the USB port of the PC.
The image of the Xbee S1 series module used in this project is shown in the following image. Since the pitch of the pins of the modules are not breadboard compatible one can use the Xbee based design boards which comes with breadboard compatible pins.
Since the Xbee modules communicate using serial communication protocol with the interfacing devices they can be connected to a microcontroller using a minimum of four pins, Power supply, and Ground, UART Data Out, and UART Data In pins. The Xbee modules have several digital and analog I/O pins apart from these pins and the pin out of an Xbee module is shown in the following table;
UART Data Out
UART Data In
Digital Output 8 (not supported as of 2/28/09)
Module Reset (reset pulse must be at least 200 ns)
PWM Output 0 / RX Signal Strength Indicator
PWM Output 1
Do not connect
DTR / Pin Sleep Control Line or Digital Input 8
Analog Input 4 or Digital I/O 4
Clear-to-Send Flow Control or Digital I/O 7
Module Status Indicator
Voltage Reference for A/D Inputs
Associated Indicator, Analog Input 5 or Digital I/O 5
Request-to-Send Flow Control, Analog Input 6 or Digital I/O 6
Analog Input 3 or Digital I/O 3
Analog Input 2 or Digital I/O 2
Analog Input 1 or Digital I/O 1
Analog Input 0 or Digital I/O 0
The pin number 2, UART Data Out is connected to the RX1 pin of the Arduino pro mini board and pin number 3 UART Data In is connected to the TX0 pin. The code written for this project communicates with the Xbee using the serial communication functions provided by the Arduino library. The functions like Serial.begin() which helps to initialize the serial port with a given baud rate, Serial.write() to send a data to the serial port, Serial.available() and Serial.read() functions to read data from the serial port are used in this project and they are already discussed in previous projects on how to do serial communication with the Arduino, how to send and receive serial data using arduino and how to do serial debugging with the Arduino.
When the coding is finished one can verify and upload the code to the Arduino board as explained in the project how to get started with the Arduino. As soon as the board is powered up the Xbee in the Arduino board automatically establishes communication with another Xbee which is connected to the serial port of a PC. Once the power is on the Arduino board continuously sends a string to the Xbee module with a small delay and the same string appears in the serial monitor window of the PC where the other Xbee module is connected. The second Xbee board can be connected to the PC using the same USB to TTL converter board which has been used to program the Arduino board. The string can be read using any serial monitoring software or using the Arduino IDE’s serial monitoring software itself as explained in the project how to do serial debugging with the Arduino.