Issue
151 February 2003
GPS-GSM
Mobile Navigator
GSM
TRANSMITS DATA
A
committee of telecom vendors and manufacturers in Europe—the
European Telecommunications Standards Institute (ETSI)—designed
GSM as a digital wireless communications system. Commercial
service began in mid1991, and by 1993 there were 36
GSM networks in 22 countries, with 25 additional countries
looking to participate. Furthermore, the standard spread
quickly beyond Europe to South Africa, Australia, and
many Middle and Far Eastern countries. By the beginning
of 1994, there were 1.3 million subscribers worldwide.
Today, GSM is also the most widely used communications
standard in China, and covers almost all of the country.
So, we didn’t need to set up a communications base station
for our system; this, of course, significantly reduced
the total cost of the project.
The
most basic teleservice supported by GSM is telephony.
Group 3 fax, an analog method described in ITUT recommendation
T.30, is also supported by the use of an appropriate
fax adapter. SMS is one of the unique features of GSM
compared to older analog systems. For pointtopoint
SMS, a message can be sent to another subscriber to
the service, and an acknowledgment of receipt is sent
to the sender. SMS also can be used in Cell Broadcast
mode to send messages such as traffic or news updates.
Messages can be stored on the SIM card for later retrieval.
SMS
is effective because it can transmit short messages
within 3 to 5 s via the GSM network and doesn’t occupy
a telephony channel. Moreover, the cost savings makes
it a worthwhile choice (i.e., in China, each message
sent costs $ 0.01 and receiving messages is free). With
SMS transmitting, gathering position data is easy and
convenient.
As
with GPS modules, stand-alone GSM OEM modules are available.
We used the FALCOM A2D from Wave-com for this project.
The FALCOM A2D is a dual-band embedded GSM module (GSM900/DCS1800).
It features the following services: telephony, SMS,
data, and fax.
The
GSM module has one TTL-level serial data interface.
We use AT commands to control and program the FALCOM
A2D. The data and control commands are exchanged between
the microcontroller and GSM module through the serial
interface.
There
are many groups of AT commands, including: Call Control,
Data Card Control, Phone Control, Computer Data Card
Control, Reporting Operation, Network Communication
Parameter, Miscellaneous, and Short Message Service.
We use some of the SMS commands to communicate with
the control center. The main AT commands for using SMS
are listed in Table 3. You
can download the GSM 07.07 and GSM 07.05 protocols for
more details about the AT commands that are used in
GSM communications. [1, 2]
Let’s
review an example of how to make a GSM module send and
read a sample SMS in Text mode. First, initialize the
GSM module with AT commands AT+CSCA and AT+CMGF. Using
the former sets the SMS center number to be used with
outgoing SMS messages. Remember, the number will be
saved on the SIM card just like in normal mobile phones.
There are two different modes—Text mode and Protocol
Data Unit (PDU) mode—for handling short messages. The
system default is PDU mode; however, Text mode is easier
to understand. So, use the AT+CMGF=1 command to set
the module to the GSM 07.05 standard SMS Text mode.
The
AT+CMGS command is used to send a short message. The
format of this command is:
AT+CMGS=<da><CR>Message
Texts<CTRL-Z>
Here,
<da> is a subscriber’s mobile phone number that
you want to send the short message to. The GSM module
can receive incoming short messages and save them on
the SIM card automatically. You can use the AT+CMGR
command to read an incoming short message from the SIM
card storage, and then use the AT+CMGD command to delete
it when you’re finished.
If
you want to read an SMS message, then send a AT+CMGR=x
command to tell the GSM module which short message you
want to read. Next, check the serial port to receive
the message from the GSM module. Rs232_r is a subroutine
used to receive data from the UART. Listing
1 demonstrates sending and reading a short message
in a BASCOM-AVR program. In this code segment, chr(34)
converts the ASCII value 34 to the right quote character
("). It also converts chr(13) to <CR> and
chr(26) to <CTRL-Z>. As you can see, "My
SMS Message" is the message you want to send.
CIRCUIT
DESCRIPTION
The
difficult part of designing this project was learning
both the NMEA GPS message and GSM AT command protocols.
The easy part was designing the hardware circuit (see
Figure 2). You may download a table of the pin assignments
from the Circuit Cellar ftp site. As you can see from
the schematic, there are three jack ports. JP1 (20 pins)
is used for the GPS module, JP2 (40 pins) is for the
GSM module, and JP3 is used for communication with the
PC.
|

(Click
here to enlarge)
|
Figure
2—Jack port JP1 is the 20-pin GPS socket header.
Jack port JP2 is the 40-pin GSM socket header. U2
is the dual four-channel multiplexer controlled
by PA2 through PA3. All of the data traffic runs
at 9600 bps. |
The
AT90S8515 (U1) is the core of the circuit. This low-power
CMOS 8-bit microcontroller is based on the AVR-enhanced
RISC architecture. By executing powerful instructions
in a single clock cycle, the AT90S8515 achieves throughputs
approaching 1 MIPS per megahertz, allowing you to optimize
power consumption versus processing speed. The AT90S8515
features 8 KB of in-system programmable flash memory,
512 bytes of EEPROM, 512 bytes of SRAM, and 32 general-purpose
I/O lines. Flexible timer/counters with compare modes,
internal and external interrupts, a programmable serial
UART, an SPI serial port, and two software-selectable
power-saving modes are also available.
The
high speed of the AT90S8515 makes it possible to complete
multiple tasks between the GPS and GSM modules, although
it has only one UART serial port. With the programmable
flash memory, you have high reliability and can update
your system. The EEPROM makes it possible to store system
parameters such as the SMS center number, control center
number, and predetermined time intervals.
Other
components on the board are the four-channel multiplexer,
a large capacity data memory, and the user interface.
The latter consists of a 2 × 16 LCD, a buzzer, and three
push buttons.