Raspberry Pi LoRa HAT


Dragino LoRa/GPS_HAT


What is the LoRa/GPS HAT

Dragino LoRa/GPS_HAT1

The Dragino LoRa/GPS_HAT is an expension module for LoRaWan for using 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 (base 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 minimising current consumption.The LoRa/GPD 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 balance between positioning accuracy and power consumption according to the environmental and motion conditions.The GPS also supports automatic antenna switching function. It can achieve the switching between internal patch antenna and 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 LMIC library in RPi.
  • LoRa/GPS HAT v1.4:
    • Change SMA connector to support active antenna
    • Add AADET_N LED to show if external antenna is active.
    • Connect GPS PPP pin to RPi BCM pin 18
    • Modify Silkscreen for GPS TXD/RXD



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, LoRaTM 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 to10Hz.
  • 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).



  • Frequency Band: 868 MHZ/433 MHZ/915 MHZ(Pre-configure 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
  • 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



You can see the RaspberyyPi2 B GPIO definition as below:


The wiring between LoRa/GPS HAT and RaspberryPi 2B:

LoRa HAT Wiring

You can see it more careful at below:

LoRa HAT pin definition



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



  • 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



Example1 — Use with LMIC library for LoRaWAN compatible

Video Example from Users

Video May be out of date, The latest instruction is here: Connect to TTN Network


Example2 — Getting GPS to work on a Raspberry Pi

Getting GPS to work on a Raspberry Pi 2 Model B

Getting GPS to work on a Raspberry Pi 3 Model B


Example3 — Two RPI use LoRa to transmit

  • Login the RPI.

  • 1

  • Copy this url.

  • Input command download.png

  • Unzip file.png

  • Use this command to complete.

  • Send data.png

  • Receive data.png


Example4 — How to get temperature sensor data from a remote Raspberry Pi via Wireless LoRa

Use DS18B20

  1. You can refer this example process. But now received please use dragino_lora_app_w1.About how to use RPI to receive please referTwo RPI use LoRa to transmit .
Sensor receive.png

  1. This example is made by Ramin Sangesari. It shows how to build a local Lora Client and Server use LoRa /GPS HAT and RPi. the Link is point to point communication example in RPi.


Use DHT11

This example used LoRa Shield.


Example4 — Set up as a LoRa Gateway using the LowCostLoRaGw library

The LowCostLoraGw source code provides good examples to shows how to use RPi to set data to the IoT provider and Dropbox. The LoRa Shield and LoRa/GPS Hat can work with these examples, by doing some modifications as below:

When use LoRa Shield with Arduino, what need to modify is:

In the sketch: 
// uncomment if your radio is an HopeRF RFM92W or RFM95W
#define RADIO_RFM92_95 
In the code: SX1272.h
change #define SX1272_RST  3 to #define SX1272_RST  9
change #define SX1272_SS 2 to #define SX1272_SS 10

When use LoRa/GPS HAT with RPi 2/3, what need to modify is:

Solder the pin22 and pin24. for CS pin use in this library. 
otherwise you will see below error: 
pi@raspberrypi:~/lora_gateway$ sudo ./lora_gateway
Unrecognized transceiver.

Use LoRa /GPS HAT with LowCostLoraGw source code


Example5 — Set up as a LoRaWAN gateway and connect to TTN with RPI and Windows 10 IOT core

This project from Mattias Larsson describe how to Build your own LoRaWAN “The Things Network” packet-forwarding Gateway on Windows 10 IoT Core in native .NET code.


Usage Notice

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

Better performances can be reached with:

  • Outdoor environment.
  • No obstacles.
  • No high level radio interferer 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 communication are usually killed with bad topographic conditions. It is usually not possible to communicate through a hill, even very small.

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 indoor enviroment where GPS antenna is poor. User can use external GPS antenna. The GPS module will auto switch between the patch antenna and external antenna.

The RF part of GPS module is sensitive to temperature, please keep them away from heat-emitting circuit.


Order Information

LoRa/Packaging accessories

Part Number

  • LoRa/GPS HAT 868: Load with SX1276, support 868M frenquency
  • LoRa/GPS HAT 915: Load with SX1276, support 915M frenquency
  • LoRa/GPS HAT 433: Load with SX1278, support 433M frenquency


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



LoRa/GPS HAT Schematic



GPS doesn’t power on

We found some early production version of LoRa/GPS Hat has wrong place of L1 and C3 components. If this happen, the GPS wont work,

Please swap them if such issue happen.

LoRa/GPS HAT Issue


Debug GPS Serial Data via PC

Once the GPS module is power on, it will output GPS data via the GPS serial interface. User can use the computer to get this data for debug purpose.

Below is the hardware connection require to do that.

Get GPS info in PC

GPS Info in PC Serial