Abstract:Based on the Arduino open-source hardware and software environment, a GPS + Beidou satellite positioning function module is constructed. This article briefly introduces the hardware modules, system setup, software programming, and experimental results, and a Python program is provided for analyzing the positioning data.
1. Introduction to Arduino Open-Source Hardware Platform
Arduino is an open-source hardware project platform originating from Italy, which can be used to develop various interactive application devices. It is one of the commonly used general platforms for technical learning, product prototype design, and maker activities, and is one of the best platforms for cultivating maker spirit and hands-on ability. The emergence of Arduino has greatly lowered the threshold for interactive design, allowing amateurs to create various creative works with Arduino, such as robots, wearable devices, smart homes, toys, etc.
The Arduino platform consists of a microcontroller (MCU) board with USB interface and simple I/O interfaces, and provides an integrated development platform similar to C language. The core of Arduino is based on the AVR instruction set microcontroller, but it simplifies the workflow of the microcontroller, recompiles and encapsulates the AVR library, and wraps complex low-level codes into simple and practical functions, allowing users not to worry about the cumbersome programming details of the microcontroller (such as registers, address pointers, etc.), thus greatly reducing the difficulty of microcontroller system development, especially suitable for teachers, students, and hobbyists, and can also serve as a working platform for makers.
For more details, see the 2018 article on the WeChat public account “New Horizons in Geosciences” titled “Fun Arduino Open-Source Hardware”.
The microcontroller development board used by the author is the DFRobot BL UNO development board. To facilitate the connection of various sensors or control modules, an I/O expansion board can also be added. This provides digital interfaces and analog interfaces for connecting various sensors or control modules. Details are not described here; please refer to relevant materials. The satellite positioning module used is the ATGM332D-5N from Zhongke Microelectronics, which supports dual-mode positioning and timing functions of GPS and Beidou (BDS) satellites. The satellite positioning module can be connected directly to a PC via a USB-TTL module through the USB port, allowing the corresponding serial port to read the information sent by the module. The module can also connect to the development board via the UART output channel.
The prices of the BLUNO development board and the ATGM332D-5N satellite positioning module on Taobao are 145 yuan and 66 yuan respectively (there are also cheaper products available).
BLUNO Microcontroller Development Board
I/O Expansion Board
Satellite Positioning Module (with Antenna)
The actual connection effect of the system is shown in the figure below, where the satellite positioning module connects to the development board, and the development board connects to the PC via MicroUSB. The connection method is as follows: the GND (ground) and VCC (power) terminals of the satellite positioning module connect to the GND and VCC of the development board, the TXD (transmit) terminal of the satellite positioning module connects to the RXD (receive) terminal of the development board, which is digital port D0, and the RXD and PPS (pulse output) terminals of the satellite positioning module can remain unconnected. At this time, a serial port device appears on the PC, and if the satellite positioning module is connected directly to the PC via USB-TTL module, a serial device will also appear.
Actual Connection Effect of the System
Port Connection Method
Serial Device Display (Development Board Connected to PC via MicroUSB)
Serial Device Display (Positioning Module Connected to PC via USB-TTL Module)
3. Introduction to NMEA-0183 Protocol
When the satellite positioning module is connected directly to the PC via USB-TTL module, we can use GNSS Viewer software or SSCOM serial communication software to receive data and display information.
GNSS Viewer Software Display Interface
SSCOM Software Serial Communication Receiving Data
From the software display above, we can see that the satellite positioning module continuously sends relevant information in text format. The figure below contains several types of data formats (GPTXT, GPGSV, BDGSV, GNZDA, GNGLL, GNVTG, GNRMC, GNGGA). This is actually the data format standard specified by the NMEA-0183 protocol.
Example of GPS Data Format
NMEA-0183 is a standard format established by the National Marine Electronics Association (NMEA) for marine electronic devices, and has now become the unified RTCM (Radio Technical Commission for Maritime services) standard protocol for GPS navigation devices. NMEA-0183 specifies the following command information content:
Main Data Types of NMEA-0183 Protocol
By comparing the standard content in the table above with the data examples we obtained, we can see slight differences. The first two letters of the command in the standard are GP, representing the GPS of the United States, while the BD in the actual data represents Beidou, and GN represents data that integrates multiple navigation positioning systems. The last three letters of the command represent the type name of the command, and a series of data contents are separated by commas after the command. Here we mainly use the GGA and ZDA commands, where GGA is used to obtain positioning information, and ZDA is used to obtain timing information. Below are the data formats for several common commands.
Common Command Data Formats
4. Programming and Source Code
If the satellite positioning module is connected to the microcontroller development board, we can receive satellite positioning and timing data from the module, process and apply the data as needed, and send information to the PC via the serial port. To implement GPS + Beidou positioning function based on Arduino microcontroller, the main task of software development is to obtain GPS positioning and timing information, parse and process the obtained data, and then display it in the required format.
This will not be elaborated here; the program source code is directly provided, and readers can read and understand it themselves. Software development is based on the Arduino development environment and programmed in a C-like language.
Program Output Data
5. Experimental Results and Analysis
Below is an analysis of a long-term positioning record. This observation recorded 2273 positioning records over nearly 63000 seconds (about 17.5 hours), and the analysis showed that the standard deviation of the positioning accuracy (root mean square error) is about 2.5 meters, with a maximum error of about 4-5 meters. As can be seen from the figure, the positioning error is not entirely random and contains low-frequency components, which should be related to the changes in satellite positions.
Output of Positioning Data Analysis Program
Analysis of Satellite Positioning Accuracy (Two Display Methods)
Changes in Satellite Positioning Latitude and Longitude and Altitude Over Time
February 29, 2020, Ning
Please pay attention to “New Horizons in Geosciences”
2020 articles from “New Horizons in Geosciences”:
-
Implementing GPS + Beidou Positioning Function Based on Arduino (with Source Code)
-
AliOS Things IoT Operating System and AliOS Studio Software Development Environment
-
Introduction to Major IoT Operating Systems
-
Trends in Epidemic Prevention and Control Development and Digital Argumentation of Good and Evil
-
Optimized Model Prediction and Analysis of COVID-19 Epidemic
-
Extreme Importance of COVID-19 Prevention and Control Isolation Measures: A Digital Simulation
-
Node Earthquake Monitoring Data Analysis: Python Programming Practice and Source Code
-
Compilation of 2019 Articles from “New Horizons in Geosciences” (PDF File Sharing)