How to Transmit GPS Data from Arduino using Xbee- (Part 31/49)

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:

Fig. 2: Typical Arduino Pro-Mini Board

Fig. 3: Arduino IDE Software Window

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.

Two Xbee S1 series transceivers modules are used in this project and the image of the same module shown in the following figure. 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.

Fig. 5: Xbee S1 Series Transceiver Module

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:

PIN

DESCRIPTION

1

Power Supply

2

UART Data Out

3

UART Data In

4

Digital Output 8 (not supported as of 2/28/09)

5

Module Reset (reset pulse must be at least 200 ns)

6

PWM Output 0 / RX Signal Strength Indicator

7

PWM Output 1

8

Do not connect

9

DTR / Pin Sleep Control Line or Digital Input 8

10

Ground

11

Analog Input 4 or Digital I/O 4

12

Clear-to-Send Flow Control or Digital I/O 7

13

Module Status Indicator

14

Voltage Reference for A/D Inputs

15

Associated Indicator, Analog Input 5 or Digital I/O 5

16

Request-to-Send Flow Control, Analog Input 6 or Digital I/O 6

17

Analog Input 3 or Digital I/O 3

18

Analog Input 2 or Digital I/O 2

19

Analog Input 1 or Digital I/O 1

20

Analog Input 0 or Digital I/O 0

Fig. 6: Pin Out Of Xbee Module

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 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 GPS module used in this project is SR-91 based GPS module which can communicate the data regarding the current location to a PC or microcontroller through the serial port. The image of the GPS module used for this project is shown below:

Fig. 6: SR-91 based GPS Module for serial communication

The GPS send the data in standard NMEA format which consist of the real time data regarding the current position. The format includes so many sentences and among them one particular sentence referred to as “Global Positioning System Fix Data” is extracted to read the North East coordinate using the Arduino.

The screenshot of the “Global Positioning System Fix Data” among the NMEA format data output from the GPS module is shown in the following image:

Each sentence has a sentence identifier, actual data separated by commas and a check sum which has to be extracted to make it in readable format. The details of the sentence “Global Positioning System Fix Data” is given in the following table;

The implementation of the project which can receive the data from the GPS module and transmit the geographical coordinate extracted from the GPS data through Xbee is represented using the following block diagram:

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. 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 geographical coordinates can be then 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.