Stufin
Home Quick Cart Profile

GPS GNSS Antenna for Raspberry Pi HAT

Buy Now

Frequency Range

1575.42 MHz (GPS L1), 1598.0625 MHz (GLONASS L1), 1199.9875 MHz (Galileo E1), 1207.140 MHz (BeiDou B1), 1227.600 MHz (QZSS L1)

Gain

28 dB

Impedance

50 ohms

VSWR

< 2.0

Polarization

Right-Hand Circular Polarization (RHCP)

Dimensions

35 mm x 35 mm x 10 mm (1.38 in x 1.38 in x 0.39 in)

Weight

15 grams (0.53 oz)

Operating Temperature

-40C to +85C (-40F to +185F)

Conclusion

The GPS GNSS Antenna for Raspberry Pi HAT is a high-performance, compact, and easy-to-use solution for adding GPS and GNSS capabilities to Raspberry Pi-based projects. Its high-gain design, multi-constellation support, and low power consumption make it an ideal choice for a wide range of IoT, navigation, and location-based applications.

Pin Configuration

  • GPS GNSS Antenna for Raspberry Pi HAT Pinout Guide
  • The GPS GNSS Antenna for Raspberry Pi HAT is a compact and high-performance GPS module designed to provide accurate location data to your Raspberry Pi projects. This guide explains the pinout of the GPS GNSS Antenna HAT and how to connect them to your Raspberry Pi.
  • Pinout:
  • The GPS GNSS Antenna HAT has a 40-pin GPIO header, which is compatible with the Raspberry Pi's GPIO interface. The pinout is as follows:
  • Power Pins:
  • Pin 1: 3V3 (3.3V Power) - Provides power to the GPS module.
  • Pin 2: 5V (5V Power) - Not used on this HAT, as the GPS module is powered by the 3.3V line.
  • Ground Pins:
  • Pin 6: GND (Ground) - Provides a ground connection to the GPS module.
  • Pin 9: GND (Ground) - Provides an additional ground connection to the GPS module.
  • Pin 14: GND (Ground) - Provides another ground connection to the GPS module.
  • Pin 17: GND (Ground) - Provides a fourth ground connection to the GPS module.
  • Pin 20: GND (Ground) - Provides a fifth ground connection to the GPS module.
  • Pin 25: GND (Ground) - Provides a sixth ground connection to the GPS module.
  • Pin 30: GND (Ground) - Provides a seventh ground connection to the GPS module.
  • Pin 35: GND (Ground) - Provides an eighth ground connection to the GPS module.
  • Pin 38: GND (Ground) - Provides a ninth ground connection to the GPS module.
  • GPS Signals:
  • Pin 10: RX (Receive) - Receives GPS data from the antenna.
  • Pin 11: TX (Transmit) - Not used on this HAT, as the GPS module is a receiver-only device.
  • Control Pins:
  • Pin 12: PPS (Pulse Per Second) - Outputs a 1Hz pulse signal, synchronized with the GPS time signal.
  • Pin 13: Fix (GPS Fix) - Indicates the availability of a valid GPS fix.
  • Pin 15: Power Enable (PWR_EN) - Enables or disables the power to the GPS module.
  • Unused Pins:
  • Pin 3: SD Card Detect - Not used on this HAT.
  • Pin 4: 5V - Not used on this HAT, as the GPS module is powered by the 3.3V line.
  • Pin 5: 3V3 - Not used on this HAT, as the GPS module is powered by the Pin 1 3.3V line.
  • Pin 7: SPI_CE0_N - Not used on this HAT.
  • Pin 8: SPI_CE1_N - Not used on this HAT.
  • Pin 16: TXD - Not used on this HAT, as the GPS module is a receiver-only device.
  • Pin 18: RXD - Not used on this HAT, as the GPS module is a receiver-only device.
  • Pin 19: RTS - Not used on this HAT.
  • Pin 21: CTS - Not used on this HAT.
  • Pin 22: MOSI - Not used on this HAT.
  • Pin 23: MISO - Not used on this HAT.
  • Pin 24: SCLK - Not used on this HAT.
  • Pin 26: CE0 - Not used on this HAT.
  • Pin 27: CE1 - Not used on this HAT.
  • Pin 28: SDA - Not used on this HAT.
  • Pin 29: SCL - Not used on this HAT.
  • Pin 31: ID_SD - Not used on this HAT.
  • Pin 32: ID_SC - Not used on this HAT.
  • Pin 33: GPIO5 - Not used on this HAT.
  • Pin 34: GPIO6 - Not used on this HAT.
  • Pin 36: GPIO12 - Not used on this HAT.
  • Pin 37: GPIO13 - Not used on this HAT.
  • Pin 39: GPIO19 - Not used on this HAT.
  • Pin 40: GPIO20 - Not used on this HAT.
  • Connection Structure:
  • To connect the GPS GNSS Antenna HAT to your Raspberry Pi, follow these steps:
  • 1. Mount the HAT onto the Raspberry Pi's GPIO header, ensuring that the pins align correctly.
  • 2. Connect the GPS antenna to the SMA connector on the HAT.
  • 3. Power the HAT by connecting the 3.3V power pin (Pin 1) to the Raspberry Pi's 3.3V power rail.
  • 4. Connect the ground pins (Pins 6, 9, 14, 17, 20, 25, 30, 35, and 38) to the Raspberry Pi's ground rail.
  • 5. Connect the RX pin (Pin 10) to the Raspberry Pi's UART RX pin (typically Pin 10 on the Raspberry Pi).
  • 6. Connect the PPS pin (Pin 12) to a digital input pin on the Raspberry Pi, such as Pin 18.
  • 7. Connect the Fix pin (Pin 13) to a digital input pin on the Raspberry Pi, such as Pin 23.
  • 8. Connect the Power Enable pin (Pin 15) to a digital output pin on the Raspberry Pi, such as Pin 24.
  • Note: Before connecting the HAT to your Raspberry Pi, ensure that the power is off to avoid any damage to the components. Additionally, consult the Raspberry Pi's documentation and the GPS GNSS Antenna HAT's datasheet for specific connection requirements and programming guidelines.

Code Examples

GPS GNSS Antenna for Raspberry Pi HAT Documentation
Overview
The GPS GNSS Antenna for Raspberry Pi HAT is a compact and high-performance GPS antenna designed specifically for use with Raspberry Pi single-board computers. This HAT (Hardware Attached on Top) module allows Raspberry Pi users to access location information, velocity, and time data using a variety of satellite navigation systems, including GPS, GLONASS, Galileo, and BeiDou.
Technical Specifications
Frequency Range: 1575.42 MHz (L1), 1227.60 MHz (L2), 1199.98 MHz (L5)
 Gain: 28 dB
 VSWR: < 2
 Impedance: 50 Ohm
 Power Supply: 3.3V - 5V
 Interface: UART (TTL level)
Getting Started
To get started with the GPS GNSS Antenna for Raspberry Pi HAT, follow these steps:
1. Mount the HAT module on top of your Raspberry Pi board, ensuring proper alignment with the GPIO pins.
2. Connect the GPS antenna to the HAT module using the provided SMA connector.
3. Power on your Raspberry Pi board.
Code Examples
### Example 1: Reading GPS Data using Python
In this example, we'll use the `gps` Python library to read GPS data from the antenna.
Hardware Requirements
Raspberry Pi board (any model)
 GPS GNSS Antenna for Raspberry Pi HAT
 GPS antenna
Software Requirements
Raspbian OS (or compatible)
 `gps` Python library (install using `pip install gps`)
Code
```python
import gps
# Create a GPS object
session = gps.GPS()
# Set the GPS device (ttyUSB0 is the default for Raspberry Pi)
session.stream(WATCH_ENABLE|WATCH_NEWSTYLE)
try:
    while True:
        # Read GPS data
        report = session.next()
        if report['class'] == 'TPV':
            print('Latitude: ', report.lat)
            print('Longitude: ', report.lon)
            print('Altitude: ', report.alt)
            print('Speed: ', report.speed)
            print('Time: ', report.time)
            print('------------------------')
except (KeyboardInterrupt, SystemExit):
    session.stream(WATCH_DISABLE)
    print('Exiting.')
```
Example 2: Using the GPS Antenna with PySerial
In this example, we'll use the `pyserial` library to read GPS data directly from the UART interface.
Hardware Requirements
Raspberry Pi board (any model)
 GPS GNSS Antenna for Raspberry Pi HAT
 GPS antenna
Software Requirements
Raspbian OS (or compatible)
 `pyserial` Python library (install using `pip install pyserial`)
Code
```python
import serial
# Open the serial connection
ser = serial.Serial('/dev/ttyUSB0', 9600, timeout=1)
try:
    while True:
        # Read GPS data
        line = ser.readline().decode('utf-8')
        if line.startswith('$GPGGA'):
            print(line)
        elif line.startswith('$GPRMC'):
            print(line)
except (KeyboardInterrupt, SystemExit):
    ser.close()
    print('Exiting.')
```
Note: In this example, we assume the GPS antenna is connected to the UART interface (ttyUSB0) and configured to output NMEA sentences at 9600 bps.
### Example 3: Using the GPS Antenna with C++ (using WiringPi)
In this example, we'll use the WiringPi library to read GPS data directly from the UART interface using C++.
Hardware Requirements
Raspberry Pi board (any model)
 GPS GNSS Antenna for Raspberry Pi HAT
 GPS antenna
Software Requirements
Raspbian OS (or compatible)
 WiringPi library (install using `sudo apt-get install wiringpi`)
Code
```c
#include <wiringPi.h>
#include <iostream>
#include <string>
int main() {
    // Initialize WiringPi
    wiringPiSetup();
// Set up the UART interface
    int uart_fd = wiringPiSetupUART(0, 9600);
if (uart_fd == -1) {
        std::cerr << "Failed to set up UART interface." << std::endl;
        return 1;
    }
try {
        while (true) {
            // Read GPS data
            char buffer[256];
            read(uart_fd, buffer, 256);
// Parse the NMEA sentence
            std::string nmea_sentence(buffer);
            if (nmea_sentence.find("$GPGGA") != std::string::npos) {
                std::cout << nmea_sentence << std::endl;
            } else if (nmea_sentence.find("$GPRMC") != std::string::npos) {
                std::cout << nmea_sentence << std::endl;
            }
        }
} catch (std::exception &e) {
        std::cerr << "Error: " << e.what() << std::endl;
        return 1;
    }
return 0;
}
```
Note: In this example, we assume the GPS antenna is connected to the UART interface (ttyUSB0) and configured to output NMEA sentences at 9600 bps.
Troubleshooting
If you encounter any issues with the GPS GNSS Antenna for Raspberry Pi HAT, refer to the troubleshooting section of this documentation or consult the Raspberry Pi community forums for assistance.