NI gps

7
1/7 www.ni.com Bookmark and Share Explore the NI Developer Community Discover and collaborate on the latest example code and tutorials with a worldwide community of engineers and scientists. Check out the NI Community Who is National Instruments? National Instruments provides a graphical system design platform for test, control, and embedded design applications that is transforming the way engineers and scientists design, prototype, and deploy systems. Learn more about NI Using LabVIEW to Acquire GPS Data "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." - Pong Ke Xin, UCSI University Malaysia 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 GPS data acquisition system. The system LabVIEW 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. 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.

description

se muetra el ensamble y programacion de un gps en labview

Transcript of NI gps

Page 1: NI gps

1/7 www.ni.com

Bookmark and Share

Explore the NI DeveloperCommunity

Discover and collaborate on the latestexample code and tutorials with aworldwide community of engineers andscientists.

‌Check‌ out‌ the‌ NI‌ Community

Who is National Instruments?National Instruments provides agraphical system design platform fortest, control, and embedded designapplications that is transforming theway engineers and scientists design,prototype, and deploy systems.

‌Learn‌ more‌ about‌ NI

Using LabVIEW to Acquire GPS Data

"Using LabVIEW, we successfully developed a GPS data acquisitionsystem to use as a learning platform to understand the data structure of aGPS module."- Pong Ke Xin, UCSI University Malaysia

Author(s):Pong Ke Xin - UCSI University Malaysia Low Chang Weng - UCSI University Malaysia

IntroductionGPS is a satellite-based navigation system made up of 24 networked satellites placed into orbit by the U.S. Department ofDefense. GPS was originally intended for military applications, but in the 1980s, the government made the system available forcivilian use. GPS works in all weather conditions, anywhere in the world, 24 hours a day. There are no subscription fees orsetup charges to use GPS. GPS is used to indicate the current position of the user through a GPS module.

System OverviewFigure 1 shows the complete system overview block diagram of our GPS data acquisition system. The systemLabVIEWconsists of a GPS module, a serial RS232 interface, and a computer preinstalled with LabVIEW. The GPS module sends aseries of standard NMEA format messages that give position, satellite information, time, and more. The GPS module connectsto the computer through NI-VISA available in LabVIEW and uses RS232 to transmit the GPS module information. After that, thedecoded 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 GPSmodule starts communicating with GPS satellites to obtain the current coordinates of the GPS module. The GPS module thenuses 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 theseries through format recognition to determine which part of the data series is the coordinates. The coordinates are then shownon the front panel, and input to the Google Maps URL. The front panel then displays a Google Map with the current position ofthe user.

The Challenge:Creating a system to power a global positioning system (GPS) module, acquire and process data, and display the latitude andlongitude in Google Earth.

The Solution:Using NI LabVIEW software to create a GPS module data acquisition interface and link the decoded longitude and latitudeinformation to Google Earth to locate actual positions.

Page 2: NI gps

2/7 www.ni.com

Figure 1: System Overview Block Diagram

Figure 2: LabVIEW GPS Data Acquisition subVI

Figure 2 shows the subVI of the LabVIEW GPS data acquisition system. The block diagram in blue indicates the serialcommunication function. The green box represents the block diagram to read and match the $GPRMC message. The red blockdiagram splits the message of $GPRMC into single parts. Finally, the purple box shows the successfully extracted longitude andlatitude.

Figure 3: GPS Data Acquisition System VI

Figure 3 shows the LabVIEW GPS data acquisition system VI. After the longitude and latitude are extracted (the coordinates ofthe actual position), the coordinates are input to the URL of the Google Map. The front panel shows the current position of theuser on Google Earth by using the balloon.

Results and DiscussionThe following figures show the standard NMEA 0183 protocol and details of each GPS module command reading. The formatseries of each datasheet is separated in parts by number. Each number is determined by the details listed in the format series.

Figure 4 shows the subVI front panel reading of the GPS Module. The data inside the read string is the reading received by the

Page 3: NI gps

3/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 theGPS module after it communicates with the GPS satellites. The three commands continuously repeat at 1-second intervals. Thedetail 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 arerequired 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 extractsthe longitude and latitude only, which are the coordinates of the current position. Therefore, the fourth, fifth, sixth, and seventhindexes of the array are extracted. The longitude, latitude, and the direction are then input to the Google Maps URL, which thenmaps the current position of the user.

Figure 4: Front Panel Reading GPS Module subVI

Figure 5: LabVIEW GPS Data Acquisition GUI

The GPS data acquisition system UI shows Google Earth, COM port, Baud rate, latitude, longitude, balloon color, balloonalphabet, URL, and Google Maps API key. The COM port is used to set the USB port where the serial RS232 is connected tothe computer. Baud rate is used to set the default data rate of the GPS module to transmit data to NI-VISA. The delay timegives some response time to the GPS module. Latitude and longitude are extracted from a series of data from the GPS module.Balloon color and balloon alphabet indicate the coordinates of the current position. With the balloon coordinates, the userdiscovers their current position. URL is an abbreviation of Uniform Resource Locator, which lists the global address ofdocuments and other resources on the World Wide Web. The Google Maps API key is used to embed Google Maps in webpages and it has only 86 characters.

The GPS data acquisition system responds best with the COM port set to COM5, Baud rate set to 4,800 (the default Baud rateof the GPS module), and the delay time set to 2,000 ms. In our experiment, when the GPS module acquires data, the latitudeshows a reading of 3.08333 and the longitude shows a reading of 101.74. This means that the GPS module acquires thecoordinates as 3.08333 North, and 101.74 East – thus the actual location of the user is mapped in Google Earth by the blueballoon (see Figure 6).

Once the red LED on the GPS module is blinking, the GPS module is performing two-way communication with the GPS satelliteand the data acquired is processed by LabVIEW. If the red LED on the GPS module remains on, there is no signal acquired.After that, LabVIEW extracts the longitude and latitude using the recognized format series of each message – and, hence mapsthe coordinates on Google Earth.

Page 4: NI gps

4/7 www.ni.com

Figure 6: Experiment Setup of GPS Data Acquisition System Using LabVIEW

ConclusionUsing LabVIEW, we successfully developed a GPS data acquisition system to use as a learning platform to understand the datastructure 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 theactual position using Google Earth.

Author Information:Pong Ke XinUCSI University Malaysia Lot 12734, Tamn Taynton ViewCheras 56000MalaysiaTel: 012 [email protected]

Figure 1 Block Diagram of System Overview

Page 5: NI gps

5/7 www.ni.com

Figure 2 Sub VI of GPS Data Acquisition Using LabVIEW

Figure 3 VI of GPS Data Acquisition System

Page 6: NI gps

6/7 www.ni.com

Figure 4 Sub VI Front panel of GPS module’s reading

Figure 5 Graphic User Interface of GPS Data Acquisition Using NI LabVIEW 2009

Page 7: NI gps

7/7 www.ni.com

Figure 6 Experiment Setup of GPS Data Acquisition System Using NI LabVIEW 2009

Next StepsLearn More About LabVIEW

Download LabVIEW

LegalThis 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 INNI.COM'S TERMS OF USE ( ).http://ni.com/legal/termsofuse/unitedstates/us/