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)
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)
28 dB
50 ohms
< 2.0
Right-Hand Circular Polarization (RHCP)
35 mm x 35 mm x 10 mm (1.38 in x 1.38 in x 0.39 in)
15 grams (0.53 oz)
-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.
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.