yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
GPS Module📖
1.GPS module information
  • GPS module information
2.MCU course
Arduino course
  • 1.Test course
  • 2.Parse course
Jetson nano course
  • Parses location information
RaspberryPi course
  • Parses location information
STM32
  • GPS parsing output
3.ROS course
  • 3.0 Instructions for use
  • 3.1 Preparing the GPS module for use
  • 3.2 Draw GPS track
  • 3.3 Fusion of IMU and GPS data
  • 3.4 GPS and Move_Base Navigation
Download
  • Datasheet
  • Code
  • PC software
  • ROS_VM
  • 3D_Model_File
Download ZIP

Welcome to GPS Module repository

Parses location information

GPS module parses location information

1. Learning Objectives

In this course, we mainly learn to use Raspberry Pi and GPS module to read and parse location information.

2. Preparation before class

The GPS module adopts UART communication or USB communication. Here we take USB communication as an example.

Use the type-c cable to connect the Raspberry Pi and the GPS module, run the command ls /dev | grep 'ttyUSB' , you can see that the voice module is recognized as USB0

img

3. Code

For the program of this course, please refer to: GPS.py

Initialize USB:

img

Location information acquisition and parsing function. In the following figure, the location information at the beginning of GNGGA is filtered out in the location information, and then the data is parsed and stored in each global variable.

img

In the same way, the heading information of GNVTG is obtained and parsed.

img

The parsed data is printed in a loop

img

4.Run code

Enter sudo python3 GPS.py in the terminal to run the program.

5. Experimental phenomenon

After the module is powered on, it takes about 32s to start, and then the serial port print status light on the module will continue to flash, and data can be received normally at this time.

After the program runs, it starts to initialize the USB. If the initialization is successful, it will display "GPS Serial Opened! Baudrate=9600", otherwise it will display "GPS Serial Open Failed!". If there is an error, you need to check the wiring or USB port, and then print the position and heading information cyclically.

img

Press Ctrl+C to exit information reading.

img

Note that the module antenna needs to be outdoors, otherwise the GPS signal may not be searched, and "GPS no found" will be printed when no signal is found.

Parses location information
GPS parsing output

COMPANY

  • About us
  • Team Style
  • Blog

LEARNING & EXPLORATION

  • Tutorials
  • Edge AI hardware
  • Educational robots
  • Embedded intelligent hardware

WHERE TO BUY

  • Yahboom Online Store
  • Amazon
  • Alibaba
  • AliExpress
  • Mercado

TECHNOLOGY SUPPORT

  • Email: support@yahboom.com

BE A DISTRIBUTOR

  • Email: sales@yahboom.com
QR Code

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文