Waveshare L76X GPS HAT User manual

L76X GPS HAT User Manual
1/ 15
L76X GPS HAT
User Manual
OVERVIEW
This is a Raspberry Pi GNSS HAT which supports Multi-GNSS systems: GPS, BDS, and QZSS, with
advantages such as fast positioning, high accuracy, low power consumption, and so on.
It is an easy way to enable global positioning function for your Raspberry Pi.
FEATURES
⚫Supports Multi-GNSS systems: GPS, BDS, and QZSS
⚫EASY™, self track prediction technology, help quick positioning
⚫AlwaysLocate™, intelligent controller of periodic mode for power saving
⚫Supports DGPS, SBAS (WAAS/EGNOS/MSAS/GAGAN)
⚫UART communication baudrate: 4800~115200bps (9600bps by default)
⚫Onboard battery holder, supports ML1220 rechargeable battery, for preserving ephemeris
information and hot starts
⚫4x LEDs for indicating the module working status
⚫Comes with development resources and manual (examples for Raspberry Pi/Arduino/STM32)
SPCIFICATIONS
GPS SPECIFICIATIONS
⚫Band: GPS L1(1575.42Mhz), BD2 B1 (1561.098MHz)
◼Channels: 33 tracking ch, 99 acquisition ch, 210 PRN ch
◼C/A code
◼SBA: WAAS, EGNOS, MSAS, GAGAN
⚫Horizontal position accuracy:
◼Autonomous: <2.5mCEP
⚫Time-To-First-Fix @-130dBm (EASY™ enabled):
◼Cold starts: <15s
◼Warm starts: <5s
◼Hot starts: <1s
⚫Sensitivity:
◼Acquisition: -148dBm
◼Tracking: -163dBm
◼Re-acquisition: -160dBm

L76X GPS HAT User Manual
2/ 15
⚫Dynamic performance:
◼Altitude (max): 18000m
◼Velocity (max): 515m/s
◼Acceleration (max): 4G
GENERAL SPECIFICATIONS
⚫Communication interface: UART
⚫Baudrate: 4800~115200bps (9600bps by default)
⚫Update rate: 1Hz (default), 10Hz (max)
⚫Protocols: NMEA 0183, PMTK
⚫Power supply voltage: 5V / 3.3V
⚫Operating current: 13mA
⚫Operating temperature: -40℃~ 85℃
⚫Dimensions: 65mm x 30.5mm

L76X GPS HAT User Manual
3/ 15
CONTENT
Overview ..............................................................................................................................................1
Features........................................................................................................................................1
Spcifications..................................................................................................................................1
GPS Specificiations ................................................................................................................1
General Specifications...........................................................................................................2
Hardware..............................................................................................................................................4
Testing in PC .........................................................................................................................................6
Hardware connection....................................................................................................................6
Demo codes..........................................................................................................................................8
Download Demo code...................................................................................................................8
Arduino examples .........................................................................................................................8
Hardware connection............................................................................................................8
Expected result .....................................................................................................................9
Raspberry Pi examples ..................................................................................................................9
Hardware connection............................................................................................................9
Copy examples ....................................................................................................................10
Install libraries.....................................................................................................................10
Enable serial port ................................................................................................................11
Install MINICOM..................................................................................................................11
Running codes.....................................................................................................................12
Expected result ...................................................................................................................12
STM32 example ..........................................................................................................................13
Hardware connection..........................................................................................................13
Expected result ...................................................................................................................14
FAQ ....................................................................................................................................................15

L76X GPS HAT User Manual
4/ 15
HARDWARE
1. L76B module
2. CP2102: USB TO UART converter
3. CAT24C32: EEPROM
4. RT9193-33: power manager
5. Backup mode wakeup button
6. Standby switch
7. Indicators:
a) RXD/TXD: UART RX/TX indicator
b) PPS: GPS status indicator
c) PWR: power indicator
8. Raspberry Pi GPIO connector: for
connecting with Raspberry Pi
9. USB TO UART port
10. GNSS antenna connector
11. Battery holder: supports ML1220
rechargeable battery, for preserving
ephemeris information and hot starts
12. UART selection jumpers
a) A: control the L76B through USB TO
UART
b) B: control the L76B through
Raspberry Pi
c) C: access Raspberry Pi through USB
TO UART
Standby mode: Standby switch is used to switch Standby mode and Working mode. When module is
in Standby mode, the power consumption is ultra-low. It stop satellite searching and navigating, no
NMEA message outputted. Module is accessible for PMTK command or other data.

L76X GPS HAT User Manual
5/ 15
Backup mode: FORCE ON button is used to exit Backup mode. Relate to Standby mode, the
consumption of Backup mode is lower. In this mode, module stop searching satellite. UART1 is
inaccessible, only the backup memory (GPS messages and several user variables used for quick start)
in RTC area works. The working current of Backup mode is about 7uA. The only way to wakeup from
Backup mode is pull high of FORCE_ON pin.
CAT24C32: This chip is used to provide ID EEPROM for Raspberry Pi (Include supplier information,
GPIO mapping and device tree information). This chip is added for better compatibility with other
Raspberry Pi HATs according to the micro-HAT(uHAT) standard (https://github.com/raspberrypi/hats )
of Raspberry Pi.

L76X GPS HAT User Manual
6/ 15
TESTING IN PC
HARDWARE CONNECTION
1. Mounting ML1220 battery (No included) to the battery holder in backside.
2. Connect GPS antenna. Wire A by yellow jumpers. Turn the STANDBY switch to OFF.
3. Connect L76X GPS HAT to PC by USB cable, then the PWR indicator lights on
4. Waiting for about 1s. TXD LED become to flash, which mean that data is transmitting
5. Open serial assistant software in PC. Select the correct COM port (according to the Device
Manager), set baud rate: 9600, data bit: 1, stop bit: 1
【Note】
a) Please set the module or receiver of antenna outdoor for stable GPS signal
b) Generally, first time module should use about 35s to locate (cold starting), the locating time
(first) maybe longer even failed because of environment, please be patient.

L76X GPS HAT User Manual
7/ 15
6. Download U-center software from wiki. Unzip it and install. Open U-center software, click
Receiver menu, choose Port, and select the correct com port (refer to Devices Manager). Set
baud rate: 9600 then click button to connect L76X GPS HAT. U-center display
information after connecting.
7. If you want to check the area better, you can install GoogleEarthPluginSetup.exe tool, which
allow you to choose Google Earth under View menu
【Note】The result you get from Google Earth maybe different with actual area because of
dynamic drift of GPS

L76X GPS HAT User Manual
8/ 15
DEMO CODES
DOWNLOAD DEMO CODE
Find the product in Waveshare website, open the wiki and download demo code from wiki.
Unzip:
Arduino: Arduino examples based on Arduino UNO
Raspberry Pi: Raspberry Pi examples include wiringpi and python codes
STM32: STM32 examples based on STM32F103
ARDUINO EXAMPLES
The development board used here is UNO PLUS
HARDWARE CONNECTION

L76X GPS HAT User Manual
9/ 15
Connect L76X GPS HAT to UNO PLUS by Dupont lines, short B by yellow jumpers
L76X GPS HAT
Arduino
5V
5V
GND
GND
RXD
2
TXD
3
EXPECTED RESULT
It requires about 35s to locate (first time). Open serial monitor and set baud rate to 9600. Data
printed first is original data. Time: L76X GPS HAT output time.
RASPBERRY PI EXAMPLES
HARDWARE CONNECTION

L76X GPS HAT User Manual
10 / 15
Plug L76X GPS HAT to Raspberry Pi, short B by yellow jumpers
COPY EXAMPLES
Insert SD card (which has installed Raspbian image) to PC by card reader
Copy Raspberry Pi examples ( the folder we download and unzip above) to BOOT directory of SD card
Exit and insert the card to Raspberry Pi, then start.
Check it: ls /boot
Copy it to /home/pi
sudo cp -r /boot/RaspberryPi/ ./
sudo chmod 777 -R RaspberryPi/
INSTALL LIBRARIES
Examples should be used with libraries installed
Install wiringPi:
sudo apt-get install git
sudo git clone git://git.drogon.net/wiringPi
cd wiringPi
sudo ./build
Install python:
sudo apt-get install python-pip
sudo pip install RPi.GPIO

L76X GPS HAT User Manual
11 / 15
sudo pip install spidev
sudo apt-get install python-imaging
sudo apt-get install python-smbus
sudo apt-get install python-serial
ENABLE SERIAL PORT
UART interface should be used for communicating, so we need to enable hardware serial of Raspberry
Pi.
sudo raspi-config
Disable login shell function and then enable hardware serial
INSTALL MINICOM
minicom is a serial assistant tool for Linux.

L76X GPS HAT User Manual
12 / 15
Install minicom:
sudo apt-get install minicom
Using minicom:
minicom -D /dev/ttyS0 -b 9600
【Note】If you use Raspberry Pi zero, the serial port should be ttyAMA0, you can confirm the port by
command: ls -l /dev/serial0 The default baud rate of minicom is 115200, here we use parameters -
b 9600 to set it as 9600
If you want to exit, you can press Ctrl + A, press X and choose Yes, then Enter.
RUNNING CODES
Enter RaspberryPi folder (The directory of example) and run it with commands:
wiringPi code:
cd ~/RaspberyPi/wiringpi
sudo ./main
python code:
cd ~/RaspberryPi/python
sudo python main.py
EXPECTED RESULT
It requires about 35s to locate (first time).

L76X GPS HAT User Manual
13 / 15
Data printed first is original data.
Time: L76X GPS HAT output time.
Code will set the module to Backup mode after running for one miniature, you need to type any
character and Enter to wake it up.
【Note】Even the default baud rate of L76X GPS HAT is 9600, it is changed to 115200 in code. If you
find that 9600 cannot work next time, please check if it is changed.
STM32 EXAMPLE
The development board used here is Waveshare XNUCLEO-F103RB, whose chip is STM32F103RBT6.
The code is based on HAL
HARDWARE CONNECTION

L76X GPS HAT User Manual
14 / 15
Wire L76X GPS HAT to STM32 board, short B by yellow jumpers. And connect USB to UART (USART1)
interface of STM32 board to PC
L76X GPS HAT
STM32
5V
5V
GND
GND
RXD
PA10
TXD
PA9
EXPECTED RESULT
Open serial assistant software in PC, set baud rate to 115200
Data printed first is original data.
Time: L76X GPS HAT output time.

L76X GPS HAT User Manual
15 / 15
FAQ
1. TXD didn’t flashing, data aren’t printed to serial after powering on for about 1 minute. PWR
lights normally?
- Please check if STANDBY switch is turn to OFF. Press FORCE_ON button for about 1s and check
again. If there aren’t data outputted still, check if you connect HAT correctly
2. Why the baud rate doesn’t change after send changing command?
- Please check if the current baud rate is correct. If the satellites searched are too much, the
module cannot allows the baud rate to be smaller. In this case, you can use SET_NMEA_OUTPUT
command to reduce the output data per time and try again.
3. Why the locating is not accurate?
- The accuracy is influenced by environment. Weather reason: The humidity is every high when
raining, which weaken the intensity of the GPS signal. It often raining in summer, therefore, the
intensity of phone signals is weak. High building reason: high buildings shelter from satellite,
make GPS intensity became weak. Area problem: Suburbs have less satellite coverage, so GPS
intensity is weak in these areas. Interference problem: Sometime, signals from satellites will be
interrupted by atmosphere ionosphere, buildings, forest, water and son on.
4. Why the locating result is different with smart phone?
- L76X GPS HAT use satellite locating. Smart phone use AGPS, LBS, WIFI and Bluetooth locating as
well except satellite. Smart phone locate much faster. And the multi-satellite system used by
smart phone are different with L76X’s
Table of contents