|8/17/2014: Interfacing with a Garmin GPS 12|
I ran across an interesting web page about interfacing with Garmin receivers. These words drew my attention: "All Garmin gps receivers support a computer interface." Since I had an old Garmin GPS 12 in my desk drawer, I dug it out and looked to see if it did indeed have the 4-pin Garmin interface described on the web-site. On the back, underneath a little rubber stopper,I found it. The article includes instructions for making a Garmin to RS232 9-pin connector, but fortunately I found one for sale on e-bay for eleven dollars. My laptop doesn't have a RS232 connector, but I already had an rs-232 to usb adaptor, so that was no problem.
I received the Garmin to rs-232 adaptor in the mail yesterday, and this morning I hooked it up and was able to get some data out of the unit an onto my Vista laptop. I plugged the Garmin to RS-232 cable into the GPS 12, plugged the rs-232 connection into the rs-232 to USB adaptor and plugged it all into an available USB port on my Vista machine. It took awhile for Windows to install the driver for the adaptor, but it succeeded, an created a serial port for me on COM4, which I was able to determine by looking at the Device Manager in the control panel.
The hardest part was figuring out how to configure the GPS 12 to spit out navigation fixes, but after downloading the user manual for the unit from the vendor web-site and reading through it, I was able to select the proper interface mode under Garmin/Garmin, which was NONE/NMEA. The unit began to push NMEA nav fixes into the interface at 4800 BAUD.
This simple python program allowed me to view the data coming out:
# # Python monitor for COM4 # import serial ser = serial.Serial('COM4',4800,timeout=2) while 1: print ser.readline(),
Here is a sample of the output from the receiver in this mode:
$GPGGA,191922,2930.141,N,09456.503,W,1,05,1.5,1.6,M,-23.3,M,,*7D $GPGSA,A,2,01,,,06,,,,20,24,,28,,1.5,1.5,*14 $GPGSV,3,1,12,01,01,039,41,02,32,218,30,04,46,045,00,06,69,209,37*7 $GPGSV,3,2,12,10,15,163,00,12,01,312,00,17,51,023,00,20,19,064,37*77 $GPGSV,3,3,12,24,24,307,40,26,00,224,00,28,48,104,30,30,10,166,00*79 $PGRME,6.2,M,,M,6.2,M*00 $GPGLL,2930.141,N,09456.503,W,191922,A*3C $PGRMZ,5,f,2*1F $PGRMM,WGS84*06 $GPBOD,,T,,M,,*47 $GPRTE,1,1,c,0*07 $GPRMC,191924,A,2930.141,N,09456.503,W,000.0,360.0,170814,003.8,E*63 $GPRMB,A,,,,,,,,,,,,V*71
These messages all provide potentially useful information, but the most useful message is $GPGGA. The comma
separated fields are:
identifier: $GPGGA gps time of week: 191922 North latitude in degrees and minutes: 2930.141,N West longitude in degrees and minutes: 09456.503,W Valid/Invalid: 1 Number of satellites tracked:05 HDOP: 1.5 Altitude MSL (meters): 1.6,M Height of geoid (meters): -23.3,M Unused: checksum: *7D
Since we are only interested in the one message, the following program will print only the $GPGGA message:
import serial ser = serial.Serial('COM4',4800,timeout=2) while 1: record = ser.readline() if record[0:6] == '$GPGGA': print record,
The resulting printout looks like this:
$GPGGA,202818,2930.144,N,09456.504,W,1,06,2.2,8.6,M,-23.3,M,,*70 $GPGGA,202820,2930.144,N,09456.504,W,1,05,2.4,8.2,M,-23.3,M,,*7A $GPGGA,202822,2930.144,N,09456.504,W,1,05,2.4,8.2,M,-23.3,M,,*78 $GPGGA,202824,2930.144,N,09456.504,W,1,05,2.4,8.6,M,-23.3,M,,*7A $GPGGA,202826,2930.144,N,09456.504,W,1,05,2.4,8.6,M,-23.3,M,,*78 $GPGGA,202828,2930.144,N,09456.504,W,1,05,2.4,8.6,M,-23.3,M,,*76 $GPGGA,202830,2930.144,N,09456.504,W,1,05,2.4,8.6,M,-23.3,M,,*7F $GPGGA,202832,2930.144,N,09456.504,W,1,05,2.4,8.7,M,-23.3,M,,*7C $GPGGA,202834,2930.144,N,09456.504,W,1,05,2.4,8.7,M,-23.3,M,,*7A $GPGGA,202836,2930.144,N,09456.504,W,1,05,2.4,8.7,M,-23.3,M,,*78 $GPGGA,202838,2930.144,N,09456.504,W,1,05,2.4,8.7,M,-23.3,M,,*76 $GPGGA,202840,2930.144,N,09456.504,W,1,05,2.4,8.7,M,-23.3,M,,*79 $GPGGA,202842,2930.144,N,09456.504,W,1,05,2.4,8.9,M,-23.3,M,,*75 $GPGGA,202844,2930.144,N,09456.504,W,1,05,2.5,9.3,M,-23.3,M,,*79 $GPGGA,202846,2930.144,N,09456.504,W,1,05,2.5,9.3,M,-23.3,M,,*7B
This set up gives us a nav fix every two seconds. If you are on foot, this may be sufficient, but at higher speeds, say 60 miles an hour, there are about 180 feet between fixes. This is where an IMU may come in. I have plans to integrate this data with IMU data to provide a high rate, accurate navigated trajectory. When I have some results, I'll post them here.
Thanks for visiting my web-site -- Cary Semar
email@example.com My Email Address for this site.