• sales

    +86-0755-88291180

L76K GPS HAT User Guide

Introduction

This item is a GNSS (Global Navigation Satellite System) module that supports multiple satellite systems including GPS, BeiDou (BDS), GLONASS, and QZSS, offering both multi-system joint positioning and single-system independent positioning. It supports A-GNSS functionality, features an internal low-noise amplifier and surface acoustic wave filter, and provides users with a fast, accurate, and high-performance positioning experience as a Raspberry Pi GNSS expansion board.

Specifications

GNSS module specifications
Specification ItemSpecification
GNSS SystemSupported systemsGPS / GLONASS / BDS / QZSS
Chip platformAT6558R
L1 receiverChannels32 tracking / 72 capturing
SBASNot supported
A-GNSSSupported
SensitivityAuto-aquisition-148dBm
Re-acquisition-160dBm
Tracking-162dBm
TTFF
(Time to First Fix)
Cold start30s (Autonomous)
5.5s (With A-GNSS)
Warm start2s
Accuracy metricsPosition accuracy2.0m CEP
Velocity accuracy0.1m/s
Acceleration accuracy0.1m/s²
Timing accuracy30ns
Other itemsCommunication interfaceUART
Serial baud rate4800bps~115200bps
(Default 9600bps)
Data update frequency1Hz (default)
5Hz (max)
Supply voltage5V
Total current<55mA @5V
(Continue mode)
Communication protocolNMEA 0183
CASIC proprietary protocol
Operating temperature-40℃ ~ 85℃
Product dimensions65.00mm×30.50mm

Onboard Resources


ItemDescription
① L76K moduleMain chip, supports GPS, Beidou (BDS), GLONASS, and QZSS multiple satellite systems
② CP2102USB to UART chip
③ CAT24C32EEPROM storage chip
Provides ID EEPROM for Raspberry Pi (including vendor information, GPIO mapping, and valid device tree information). This was added because of the micro-HAT (uHAT) specification introduced by the Raspberry Pi (see for details). This is to ensure consistency and compatibility with future Raspberry Pi add-on boards and provide a better user experience.
Note: We did not use this, so you can ignore it.
④ RT9193-33Power chip
⑤ Galaxy configuration buttonDefaults to GPS + GLONASS combination;
Press Force ON button and restart the module with a GPS + BDS combination
⑥ Standby mode switchStandby mode: Setting the STANDBY switch to ON allows the module to enter Standby mode, which is a low-power mode. In this mode, the module stops satellite search and navigation, and no positioning information (NMEA messages) is output, but it can still be accessed via commands or any other data.
⑦ Status indicatorRXD/TXD: Serial port receive/transmit indicator; PPS: GPS status indicator; PWR: Power indicator
⑧ Raspberry Pi GPIO interfaceConvenient for connecting to Raspberry Pi
⑨ USB TO UART interfaceConvenient for connecting to PC and other hosts
⑩ GNSS antenna interfaceConnect GNSS antenna to be placed under visible sky
⑪ ML1220 battery holderCan connect to ML1220 rechargeable battery for power failure data preservation and warm start
⑫ UART selection jumper capA: USB to serial port control L76K
B: Raspberry Pi control L76K
C: USB to serial port access Raspberry Pi

Windows Serial Port Debugging

  • Install the CP2102 driver; set the serial port of the module to A (yellow jumper), and communicate with the L76K via the USB port.
  • Connect the antenna, plug in the USB cable, and then connect to the computer. As shown in the figure, after the connection, the power indicator (PWR) stays on.
  • Place the other end of the antenna where you can see the sky.


  • Wait for about 1 second, the TXD indicator starts flashing, indicating data transmission
  • Open the computer serial port debugging assistant, set the corresponding COM port (here it is COM5), baud rate 9600, 8 data bits, 1 stop bit, no parity bits, no flow control.
  • Download the Serial Port Debugging Assistant


Note: 1. Due to unstable GPS signal acquisition indoors, please place the module or antenna on the balcony or next to the window, or conduct the experiment directly outdoors.
2. For the first module positioning (cold start), under normal conditions (outdoors, good weather, no large building obstruction), it takes 35 seconds to successfully locate. Please be patient. If the weather conditions are poor, it may require a longer positioning time, or even fail to position.
Note: Due to GPS static drift, the results seen in Google Earth may differ from actual conditions. The Baidu coordinate error calculated using the demo is particularly small.

Working with Raspberry Pi

Raspberry Pi provides control through C and Python demos

Enable UART Interface

Open the Raspberry Pi terminal and enter the following command to enter the configuration interface

sudo raspi-config
Select Interfacing Options -> Serial, disable shell access, and enable the hardware serial port

Install Relevant Function Libraries

Not all libraries need to be installed; install only what is actually required. If you only use Python demo, you can also install only the Python library.

Python Library

pip3 install pyserial
pip3 install pynmea2
pip3 install pynmeagps

BCM2835

#Open the Raspberry Pi terminal and run the following commands:
wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.71.tar.gz
tar zxvf bcm2835-1.71.tar.gz 
cd bcm2835-1.71/
sudo ./configure && sudo make && sudo make check && sudo make install
# For more information, please refer to the official website: http://www.airspayce.com/mikem/bcm2835/

wiringPi

#Open the Raspberry Pi terminal and run the following commands:
cd
sudo apt-get install wiringpi
#For Raspberry Pi systems after May 2019 (those earlier may not require execution), an upgrade may be necessary:
wget https://files.waveshare.com/wiki/common/wiringpi-latest.deb
sudo dpkg -i wiringpi-latest.deb
gpio -v
# Run gpio -v and version 2.52 will appear. If it does not appear, there is an installation error

#Bullseye branch system uses the following command:
sudo git clone https://github.com/WiringPi/WiringPi
cd WiringPi
sudo ./build
gpio -v
# Run gpio -v and version 2.70 will appear. If it does not appear, there is an installation error

lgpio

sudo su
wget https://github.com/joan2937/lg/archive/master.zip
unzip master.zip
cd lg-master
sudo make install 
# For more information, please refer to the official website: https://github.com/gpiozero/lg

Hardware Connection

  • Insert the module directly onto the Raspberry Pi, connect the yellow jumper to position B, place it under the visible sky to allow the module to receive satellite signals:


minicom Debugging

  • Install minicom debugging assistant
sudo apt-get install minicom
# For Raspberry Pi 5\ZERO\2B
sudo minicom -D /dev/ttyAMA0 -b 9600
# For Raspberry Pi 4B\3B+\3B
sudo minicom -D /dev/ttyS0 -b 9600

The default baud rate is 115200. To set the baud rate to 9600, add the parameter -b 9600. -D represents the port, /dev/ttyS0 is similar to COM1 in Windows. The following image is a test using the serial port ttyS0 on Raspberry Pi 4B:

Exit: Ctrl+A then press X, YES, Enter

cutecom Testing

  • Install cutecom debugging assistant
sudo apt-get install cutecom
  • Run cutecom, a graphical serial port assistant interface appears, similar to sscom for Windows:
cutecom
  • The following figure was tested using Raspberry Pi 5 with a baud rate of 9600 and a serial port ttyAMA0


Demo

  • Download the demo:
wget https://files.waveshare.com/wiki/L76K-GPS-HAT/Demo/L76K_GPS_HAT_Code.zip
unzip L76K_GPS_HAT_Code.zip 
sudo chmod 777 -R L76K_GPS_HAT_Code
cd L76K_GPS_HAT_Code/RaspberryPi
  • C demo
cd wiringPi
make clean
make
sudo ./main
  • Python demo
cd python
python3 main.py
  • Expected effect

The initial positioning of the module requires a waiting time of 35 seconds.
The first part is the raw data output by the module.
Time is the time output by L76X.
Latitude and longitude are the output latitude and longitude directions.
The converted map coordinates can be entered into Bing Map to search for the location, for example:

114.08331567625963,22.53857879961489


  • Obtain the original NMEA data demo
python3 nmea.py



Working with RDK

Hardware Connection

  • Insert the jumper cap into area B
  • Insert the L76x GPS HAT directly into the 40PIN on the X3 PI

Install Libraries

Use the terminal and run the following commands to install the libraries:

pip3 install pyserial
pip3 install pynmea2
pip3 install pynmeagps

Test with minicom

  • Install minicom debugging assistant
sudo apt-get install minicom
sudo minicom -D /dev/ttyS3 -b 9600

Exit: Ctrl+A then press X, YES, Enter

Working with Jetson Orin Nano

Install Libraries

Use the terminal and run the following commands to install the libraries:

pip3 install pyserial
pip3 install pynmea2
pip3 install pynmeagps

minicom Test

  • Install minicom debugging assistant
sudo apt-get install minicom

Connect via UART Serial Port


  • Insert the jump cap in area B, and connect the L76K GPS HAT to the Jetson Orin Nano via the 40PIN header
  • Use minicom to control the UART serial port
sudo minicom -D /dev/ttyTHS1 -b 9600


Connect via USB Cable


  • Insert the jumper cap into area B
  • Place the L76K GPS HAT jumper cap in A and connect it to the USB port on the Jetson Nano via a USB cable
 sudo minicom -D /dev/ttyUSB0 -b 9600


Exit: Ctrl+A then press X, YES, Enter

Demo

  • Download the demo:
wget https://files.waveshare.com/wiki/L76K-GPS-HAT/Demo/L76K_GPS_HAT_Code.zip
unzip L76K_GPS_HAT_Code.zip 
sudo chmod 777 -R L76K_GPS_HAT_Code
cd L76K_GPS_HAT_Code/Jetson
  • Obtain the original NMEA data demo
sudo python3 nmea.py


FAQ

 Answer:

Place the antenna in an open outdoor area with the text side down. Effective positioning data will be received 45 seconds after turning it on


 Answer:
  • Send the following command to change the baud rate to 115200
$PMTK251,115200*1F<CR><LF>
  • Send the following command to restore the baud rate to the default 9600:
$PMTK251,9600*17<CR><LF>


 Answer:


As shown in the figure below, make sure to choose No in the first step to avoid outputting the login shell information of the Raspberry Pi to the serial port, which could cause a serial port conflict. Then choose Yes in the second step.




 Answer:


If the above phenomenon occurs when in use, please check the Raspberry Pi config.txt configuration by running `sudo nano /boot/config.txt`. Please comment out the following statement, as it is the temperature sensor occupying the serial communication line; 



 Answer:

It is standby mode, please put it to OFF, otherwise it will be standby when it is turned on, and there is no GPS output


 Answer:

In the main.py of the Python program, the update rate is modified on line 12, which defaults to 400ms. You can find the corresponding macro definition in L76X.py and replace it as needed



Question: About a minute after powering on, the power indicator light (PWR) turns on, TXD does not blink, and there is no data output from the serial port. What is the reason?

 Answer:

Check if the STANDBY switch is in the OFF position, then press the FORCE_ON button for about 1 second and observe if there is any data output on the serial port. If there is still no data output, check if the TXD and RXD pins are connected correctly


Question: Why is the location not accurate?

 Answer:
The positioning accuracy is related to the environment, the first factor is the weather, there is a lot of moisture in the air on rainy days, which affects the transmission of signals. This is also why mobile phone signals are slightly weaker in summer. Summer has more rain and higher humidity, coupled with the high temperature evaporation, there is more moisture in the air, which affects the transmission of satellite signals. The second factor is the high-rise building effect. If located near some high-rise buildings, it can easily cause issues with poor satellite signal or signal deviation. In lower floors of buildings or underground structures such as underground parking lots, underground malls, subways, tunnels, etc., due to the obstruction by walls, the indoor signal attenuation is very significant, forming signal coverage weaknesses. This results in inaccurate positioning and large errors. Similarly, in areas obstructed by high mountains, it can also lead to inaccurate positioning. The third factor is the number of satellites. Fewer satellites are placed above rural and remote areas, leading to larger position deviations. In shopping malls, underground metro stations, tunnels, and other areas, signals are heavily attenuated by walls, creating signal coverage weaknesses. This results in imprecise positioning and large errors. Similarly, positioning can also become imprecise under mountainous obstacles. The fourth factor is that satellite signals can be affected by atmospheric ionosphere, ground buildings, forests, water surfaces, and other factors, leading to calculation errors


Question: Why can't I receive data when I'm outdoors?

 Answer:
Please check if the antenna is connected properly, and make sure the side with text is facing down, as the antenna reception is on the side without text


Question: Why is it inconsistent with the positioning of the mobile phone?

 Answer:
This module positioning only relies on satellite positioning, while mobile phone positioning not only relies on satellite positioning but also depends on AGPS (Assisted Global Positioning System), LBS base station positioning, Wi-Fi positioning, Bluetooth positioning, and various other positioning systems combined. Therefore, mobile phone positioning has faster positioning speeds. In terms of accuracy, it varies in different environments. Additionally, the GPS signals supported by mobile phones and the multiple satellite systems supported by modules are inconsistent. Therefore, there is a certain difference between the data of the module and the mobile phone.


Question: Why does the baud rate of the module still not change when I send the command to modify the baud rate?

 Answer:
First, ensure that the baud rate for sending commands matches the baud rate for serial output. When the module detects a large number of satellites, setting the baud rate from high to low may not work because the baud rate is too low for the module to send all the data at once. Consider using the SET_NMEA_OUTPUT command to reduce the number of output data fields, and then modify the baud rate.


Question: What is the role of the three jumper caps A, B, and C on board?

 Answer:

The function of the jumper cap is to switch the serial port device. When the jumper cap is connected to A, L76B will connect to the USB interface; when connected to B, L76B connects to the Raspberry Pi; when connected to C, the Raspberry Pi connects to the USB (at this time, the module can can be used as a USB to TTL module)


Question: Why is there no corresponding demo for CAT24C32, and what is its function?

 Answer:
The CAT24C32 is used to provide an ID EEPROM for the Raspberry Pi, which includes vendor information, GPIO mapping, and valid device tree information, which is the Micro HAT (uHAT) specification introduced by Raspberry Pi. This is to ensure consistency and compatibility with future Raspberry Pi add-on boards and provide a better user experience.


Question: Does button battery support charging?

 Answer:
If a rechargeable button battery is used, the module supports charging the button battery on the back under normal power supply. Rechargeable battery ML1220 is recommended


Question: Why are the GPS coordinates not accurate when placed on Baidu Maps or Google Maps?

 Answer:
The raw GPS data obtained is unprocessed geographic coordinates, generally referred to as lunar coordinates, and needs to be processed with certain algorithms to achieve accurate positioning. Different maps use different algorithms, so the same coordinate is processed differently on Google and Baidu. The demo provides a Baidu Map algorithm by default for reference.


Question: Why does the Raspberry Pi print a location of 0,0, or why does the demo freeze and fail to locate?

 Answer:
Place it in an open outdoor area with the antenna text side down, ensuring that there will be location data after it powers on within 45 seconds.


Question: What is the positioning error of the L76X GPS HAT?

 Answer:

Testing in an open and clear weather environment, the error is within 2.5 meters.


Question: How to parse the obtained location information?

 Answer:

The following takes GNRMC as an example to parse the obtained positioning information, as follows:


Support

Monday-Friday (9:30-6:30) Saturday (9:30-5:30)

Email: services01@spotpear.com



[Tutorial Navigation]