Skip to content

Instantly share code, notes, and snippets.

@maxious
Created May 23, 2026 11:01
Show Gist options
  • Select an option

  • Save maxious/9eb351d614a7b056010b0c5bf5161482 to your computer and use it in GitHub Desktop.

Select an option

Save maxious/9eb351d614a7b056010b0c5bf5161482 to your computer and use it in GitHub Desktop.
Lora/GPS HAT From Wiki for Dragino Project

Lora/GPS HAT

From Wiki for Dragino Project https://web.archive.org/web/20220130061354/https://wiki.dragino.com/index.php?title=Lora/GPS_HAT

Contents


Introduction

Dragino LoRa/GPS_HAT

What is the LoRa/GPS HAT

Dragino LoRa/GPS_HAT1

The Dragino LoRa/GPS_HAT is an expansion module for LoRaWAN for use with the Raspberry Pi. This product is intended for those interested in developing LoRaWAN solutions.

The LoRa/GPS HAT is based on the SX1276/SX1278 transceiver. The add-on L80 GPS (based on MTK MT3339) is designed for applications that use a GPS connected via the serial ports to the Raspberry Pi such as timing applications or general applications that require GPS information.

The transceivers of the LoRa/GPS HAT feature the LoRa™ long-range modem that provides ultra-long range spread spectrum communication and high interference immunity whilst minimizing current consumption. The LoRa/GPS HAT can achieve a sensitivity of over -148dBm using a low-cost crystal and bill of materials. The high sensitivity combined with the integrated +20 dBm power amplifier yields industry-leading link budget making it optimal for any application requiring range or robustness. LoRa™ also provides significant advantages in both blocking and selectivity over conventional modulation techniques, solving the traditional design compromise between range, interference immunity, and energy consumption.

This board can calculate and predict orbits automatically using the ephemeris data (up to 3 days) stored in internal flash memory, so the HAT can fix position quickly even at indoor signal levels with low power consumption. With AlwaysLocate™ technology, the Lora/GPS HAT can adaptively adjust the on/off time to achieve a balance between positioning accuracy and power consumption according to the environmental and motion conditions. The GPS also supports an automatic antenna switching function. It can achieve switching between the internal patch antenna and an external active antenna. Moreover, it keeps positioning during the switching process.

Hardware version info

Hardware Source is in: LoRa GPS HAT source

  • LoRa/GPS_HAT v1.0: The first hardware release for the LoRa/GPS_HAT.
  • LoRa/GPS_HAT v1.3: Add a trace from LoRa DIO1 to RPi GPIO4 (wiringPi definition). Add a trace from Lora DIO2 to RPi GPIO5 (wiringPi definition). They are required by the LMIC library in RPi.
  • LoRa/GPS HAT v1.4:
  • Change SMA connector to support active antenna.
  • Add AADET_N LED to show if the external antenna is active.
  • Connect GPS PPS pin to RPi BCM pin 18.
  • Modify Silkscreen for GPS TXD/RXD.

Specifications

Lora Spec

  • 168 dB maximum link budget.
  • +20 dBm - 100 mW constant RF output vs.
  • +14 dBm high-efficiency PA.
  • Programmable bit rate up to 300 kbps.
  • High sensitivity: down to -148 dBm.
  • Bullet-proof front end: IIP3 = -12.5 dBm.
  • Excellent blocking immunity.
  • Low RX current of 10.3 mA, 200 nA register retention.
  • Fully integrated synthesizer with a resolution of 61 Hz.
  • FSK, GFSK, MSK, GMSK, LoRa™ and OOK modulation.
  • Built-in bit synchronizer for clock recovery.
  • Preamble detection.
  • 127 dB Dynamic Range RSSI.
  • Automatic RF Sense and CAD with ultra-fast AFC.
  • Packet engine up to 256 bytes with CRC.
  • Built-in temperature sensor and low battery indicator.

GPS Spec

  • Based on MT3339.
  • Power Acquisition: 25mA, Power Tracking: 20mA.
  • Compliant with GPS, SBAS.
  • Programmable bit rate up to 300 kbps.
  • Serial Interfaces UART: Adjustable 4800~115200 bps, Default: 9600bps.
  • Update rate: 1Hz (Default), up to 10Hz.
  • I/O Voltage: 2.7V ~ 2.9V.
  • Protocols: NMEA 0183, PMTK.
  • Horizontal Position Accuracy: Autonomous <2.5 m CEP.
  • TTFF @ -130dBm with EASY™: Cold Start <15s, Warm Start <5s, Hot start <1s; TTFF @ -130dBm without EASY™: Cold Start <35s, Warm Start <30s, Hot Start <1s.
  • Timing Accuracy: 1PPS out 10ns, Reacquisition Time <1s.
  • Velocity Accuracy: Without aid <0.1m/s, Acceleration Accuracy Without aid 0.1m/s².
  • Sensitivity: Acquisition -148dBm, Tracking -165dBm, Reacquisition -160dBm.
  • Environmental: Operating Temperature -40°C to 85°C, Storage Temperature -45°C to 125°C.
  • Dynamic Performance: Altitude Max. 18000m, Maximum Velocity Max. 515m/s, Maximum Acceleration 4G.
  • L1 Band Receiver (1575.42MHz) Channel 22 (Tracking) / 66 (Acquisition).

Features

  • Frequency Band: 868 MHz / 433 MHz / 915 MHz (Pre-configured in factory)
  • Low power consumption
  • Compatible with Raspberry Pi 2 Model B / Raspberry Pi 3.
  • LoRa™ Modem
  • FSK, GFSK, MSK, GMSK, LoRa™ and OOK modulation
  • Preamble detection
  • Baud rate configurable
  • Built-in temperature sensor and low battery indicator
  • Excellent blocking immunity
  • Automatic RF Sense and CAD with ultra-fast AFC
  • Support DGPS, SBAS (WAAS/EGNOS/MSAS/GAGAN)
  • GPS automatic switching between internal patch antenna and external active antenna
  • PPS VS. NMEA can be used in time service
  • Support SDK command
  • Built-in LNA for better sensitivity
  • EASY™, advanced AGPS technology without external memory
  • AlwaysLocate™, an intelligent controller of periodic mode
  • GPS FLP mode, about 50% power consumption of normal mode
  • GPS support short circuit protection and antenna detection

Wiring

The underlying text and logical layout mapped from the image definitions (RPi_GPIO.jpg, Lora_hat_wiring.png, and Hatpin.png) detail the Pin configuration table below.

Pinout Configuration Table (LoRa/GPS HAT to Raspberry Pi Pin Mapping)

LoRa/GPS HAT Pin Function wiringPi Pin ID Raspberry Pi Physical Pin Raspberry Pi BCM Pin ID Notes / Protocol
3.3V Pin 1, 17 3.3V DC Power Input
5V Pin 2, 4 5V DC Power Input
GND Pin 6, 9, 14, 20, 25, 30, 34, 39 Ground System Ground
DIO0 GPIO 7 Pin 7 GPIO 4 LoRa Interrupt Request (RxDone/TxDone)
DIO1 GPIO 4 Pin 16 GPIO 23 LoRa Extra Interrupt (Added in v1.3 for LMIC)
DIO2 GPIO 5 Pin 18 GPIO 24 LoRa Extra Interrupt (Added in v1.3 for LMIC)
RESET GPIO 0 Pin 11 GPIO 17 LoRa Reset Pin
LoRa_NSS GPIO 6 Pin 22 GPIO 25 SPI Chip Select (CS)
LoRa_MOSI GPIO 12 Pin 19 GPIO 10 SPI Master Out Slave In
LoRa_MISO GPIO 13 Pin 21 GPIO 9 SPI Master In Slave Out
LoRa_SCK GPIO 14 Pin 23 GPIO 11 SPI Serial Clock
GPS_RX GPIO 15 Pin 10 GPIO 15 (RXD0) UART RX (Receives NMEA data from GPS)
GPS_TX GPIO 16 Pin 8 GPIO 14 (TXD0) UART TX (Sends PMTK commands to GPS)
GPS_PPS Pin 12 GPIO 18 (BCM 18) Pulse Per Second (Added in v1.4 for NTP)

LEDs

  • PWR: Power Indicate LED. Turns on once there is power.
  • LoRa-RX: Indicates there is a wireless packet received in the LoRa module.
  • 3D_FIX: The LED blinks every 100ms after the GPS fixes position.
  • EXT_ANT: Indicates there is an external GPS antenna connected.

Applications

  • Automated Meter Reading.
  • Home and Building Automation.
  • Wireless Alarm and Security Systems.
  • Industrial Monitoring and Control.
  • Long range Irrigation Systems.

Dimensions and Weight

  • Size: 60mm * 53mm * 25mm.
  • Net weight: 30g.
  • Package Size: 98mm x 81mm x 32mm

User Manual

User Manual Link

Example 2 -- Getting GPS to work on a Raspberry Pi


Usage Notice

You have to be aware that Radio link quality and performances are highly dependent on the environment.

Better performances can be reached with:

  • Outdoor environment.
  • No obstacles.
  • No high-level radio interferers in the ISM 868MHz band.
  • At least 1 meter above the ground.

Radio performances are degraded with:

  • Obstacles: buildings, trees...
  • Inner buildings environments.
  • High ISM 868MHz band usage by other technologies.

Radio communications are usually killed with bad topographic conditions. It is usually not possible to communicate through a hill, even a very small one.

GPS Antenna

The GPS module has a built-in 15x15x4 patch Antenna. Make sure the GPS antenna points to the sky. If the module must be placed in an indoor environment where GPS reception is poor, the user can use an external GPS antenna. The GPS module will auto-switch between the patch antenna and the external antenna.

The RF part of the GPS module is sensitive to temperature; please keep it away from heat-emitting circuits.


Order Information

LoRa/Packaging accessories

Part Number

  • LoRa/GPS HAT 868: Loaded with SX1276, supports 868M frequency.
  • LoRa/GPS HAT 915: Loaded with SX1276, supports 915M frequency.
  • LoRa/GPS HAT 433: Loaded with SX1278, supports 433M frequency.

Packaging Includes

  • 1 x LoRa /GPS HAT
  • 4 x Brass cylinders (M2.5 x 11 + 6)
  • 4 x Screws (M2.5 x 5)
  • 4 x Nuts (M2.5)
  • 1 x Glue Stick Antenna (868 MHz, 433 MHz, or 915 MHz depends on order)
  • Packaging with environmental protection paper box.

Schematic

LoRa/GPS HAT Schematic


Troubleshooting

GPS doesn't power on

We found some early production versions of the LoRa/GPS Hat have wrong placement of L1 and C3 components. If this happens, the GPS won't work. Please swap them if such an issue occurs.

LoRa/GPS HAT Issue Trace Layout

Debug GPS Serial Data via PC

Once the GPS module is powered on, it will output GPS data via the GPS serial interface. Users can use a computer to get this data for debugging purposes. Below is the hardware connection required to do that.

Get GPS info in PC using USB-to-TTL adapter connection: (Connect Adapter RXD to Pin 8 / TXD to Pin 10 / GND to Ground Pin)

GPS Info in PC Serial Stream (Output showing NMEA sentences: $GPRMC, $GPVTG, $GPGGA, $GPGSA, $GPGSV, $GPGLL)


Reference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment