Beruflich Dokumente
Kultur Dokumente
The Challenge:
Creating a system to power a global positioning system (GPS) module, acquire and process data, and display the latitude and
longitude in Google Earth.
The Solution:
Using NI LabVIEW software to create a GPS module data acquisition interface and link the decoded longitude and latitude
information to Google Earth to locate actual positions.
Author(s):
Pong Ke Xin - UCSI University Malaysia
Low Chang Weng - UCSI University Malaysia
Introduction
GPS is a satellite-based navigation system made up of 24 networked satellites placed into orbit by the U.S. Department of
Defense. GPS was originally intended for military applications, but in the 1980s, the government made the system available for
civilian use. GPS works in all weather conditions, anywhere in the world, 24 hours a day. There are no subscription fees or
setup charges to use GPS. GPS is used to indicate the current position of the user through a GPS module.
System Overview
Figure 1 shows the complete system overview block diagram of our LabVIEW GPS data acquisition system. The system
consists of a GPS module, a serial RS232 interface, and a computer preinstalled with LabVIEW. The GPS module sends a
series of standard NMEA format messages that give position, satellite information, time, and more. The GPS module connects
to the computer through NI-VISA available in LabVIEW and uses RS232 to transmit the GPS module information. After that, the
decoded longitude and latitude information are linked to Google Earth and the system locates the actual position.
For the GPS data acquisition system, we power up the GPS module with a 5 V power supply. After powering up, the GPS
module starts communicating with GPS satellites to obtain the current coordinates of the GPS module. The GPS module then
uses TTL to send data to the computer through a serial port, using the RS232 protocol, where it is processed by LabVIEW.
LabVIEW is programmed to extract the coordinates of the current position. The program we created in LabVIEW recognizes the
series through format recognition to determine which part of the data series is the coordinates. The coordinates are then shown
on the front panel, and input to the Google Maps URL. The front panel then displays a Google Map with the current position of
the user.
1/7
www.ni.com
2/7
www.ni.com
Figure 4 shows the subVI front panel reading of the GPS Module. The data inside the read string is the reading received by the
GPS module after it communicates with the GPS satellites. The three commands continuously repeat at 1-second intervals. The
detail of each part of the message is indicated by the datasheet provided. To obtain the current coordinates of the GPS module,
the $GPRMC command extracts the longitude and latitude.
The data in the blue box is the string that begins with the $GPRMC and the rest of the string. The string begins with the
$GPRMC command because LabVIEW programming is designed to match the $GPRMC only. The longitude and latitude are
required to input the URL of the Google Map so the $GPRMC message is extracted from the blue box.
The data in the substring (purple box) has been divided into single parts and put into the array. The LabVIEW program extracts
the longitude and latitude only, which are the coordinates of the current position. Therefore, the fourth, fifth, sixth, and seventh
indexes of the array are extracted. The longitude, latitude, and the direction are then input to the Google Maps URL, which then
maps the current position of the user.
3/7
www.ni.com
Conclusion
Using LabVIEW, we successfully developed a GPS data acquisition system to use as a learning platform to understand the data
structure of a GPS module. LabVIEW successfully obtains data from the GPS module through serial port communication.
LabVIEW also successfully extracts the latitude and longitude from the series of format messages from the GPS module.
Finally, the decoded longitude and latitude are input to the Google Maps URL to display on the Google Map and locate the
actual position using Google Earth.
Author Information:
Pong Ke Xin
UCSI University Malaysia
Lot 12734, Tamn Taynton View
Cheras 56000
Malaysia
Tel: 012 3771238
inierce@hotmail.com
4/7
www.ni.com
5/7
www.ni.com
Figure 5 Graphic User Interface of GPS Data Acquisition Using NI LabVIEW 2009
6/7
www.ni.com
Figure 6 Experiment Setup of GPS Data Acquisition System Using NI LabVIEW 2009
Next Steps
Learn More About LabVIEW
Download LabVIEW
Legal
This case study (this "case study") was developed by a National Instruments ("NI") customer. THIS CASE STUDY IS PROVIDED "AS IS"
WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN
NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).
7/7
www.ni.com