Hardware Reference
In-Depth Information
Reading the GPS Serial Protocol
The good news is that if you're using GPS,
you never have to do trilateration or trian-
gulation calculations—GPS receivers do
the work for you. They then give you the
position in terms of latitude and longitude.
There are several data protocols for GPS
receivers, but the most common is the
NMEA 0183 protocol established by the
National Marine Electronics Association in
the United States. Just about all receivers
on the market output NMEA 0183, and
usually one or two other protocols as well.
MATERIALS
» 1 solderless breadboard
» 1 EM-406A GPS receiver
» 1 interface cable for GPS receiver
» 12 male header pins
» 1 bluetooth Mate
» 1 5V voltage regulator
8 This sets the radio to
9600 bps.
Next, type:
SU,48\r
R,1\r
8 This reboots the radio.
NMEA 0183 is a serial protocol that operates at 4800 bits
per second, 8 data bits, no parity, and 1 stop bit (4800-8-
N-1). Most receivers send this data using either RS-232 or
TTL serial levels. The receiver used for this example, a US
GlobalSat EM-406a receiver, sends NMEA data at 5V TTL
levels.
Your radio will save the new setting at 4800bps and
reboot. Now you can connect it to the GPS module.
Figure 8-10 shows the module connected to a Bluetooth
Mate radio. The GPS data will be sent over Bluetooth to a
personal computer running Processing. If it's not already
paired, you can pair the Bluetooth Mate to your personal
computer using the instructions from Project 3 in Chapter
2. That will give you a Bluetooth serial port in your list of
ports, as in that project. Open a connection to that port in
a serial terminal application, and you should see data in
the NMEA protocol, like what you see below.
You're going to connect the GPS receiver to a Bluetooth
Mate for this project. Before you do, however, you need to
match their data rates by resetting the Bluetooth Mate to
4800bps. To do this, connect your Mate to a USB-to-Serial
adapter and open a connection to it in a serial terminal
application (like CoolTerm or PuTTY) at 115200 bits per
second (see Project 4 in Chapter 2 for more details). First,
type: $$$ . This command takes the radio out of data mode
and puts it in command mode. The radio will respond: CMD
$GPGGA,180226.000,4040.6559,N,07358.1789,W,1,04,6.6,75.4,M,-34.3,M,,0000*5B
$GPGSA,A,3,12,25,09,18,,,,,,,,,6.7,6.6,1.0*36
$GPGSV,3,1,10,22,72,171,,14,67,338,,25,39,126,39,18,39,146,35*70
$GPGSV,3,2,10,31,35,228,20,12,35,073,37,09,15,047,29,11,09,302,20*7D
$GPGSV,3,3,10,32,04,314,17,27,02,049,15*73
$GPRMC,180226.000,A,4040.6559,N,07358.1789,W,0.29,290.90,220411,,*12
$GPGGA,180227.000,4040.6559,N,07358.1789,W,1,04,6.6,75.4,M,-34.3,M,,0000*5A
$GPGSA,A,3,12,25,09,18,,,,,,,,,6.7,6.6,1.0*36
$GPRMC,180227.000,A,4040.6559,N,07358.1789,W,0.30,289.06,220411,,*1C
Search WWH ::




Custom Search