GP-20U7
Revision as of 20:02, 19 October 2022 by 93.195.8.106 (talk) (Created page with "= GP-20U7 GPS receiver = The GP-20U7 GPS receiver is a compact solution for getting global position data. It is capable of delivering position, velocity and time data. The low...")
Contents
GP-20U7 GPS receiver
The GP-20U7 GPS receiver is a compact solution for getting global position data. It is capable of delivering position, velocity and time data. The low power consumptions and its small size make the GP-20U7 the ideal choice for small, portable projects like smart watches.
Technical Specifications
- 56-Channel Receiver (22 Channel All-in-View)
- Sensitivity : -162dBm
- 2.5m Positional Accuracy
- Cold Start : 29s (Open Sky)
- 40mA @ 3.3V
- 3-pin JST Terminated Cable
Pins
Pin # | Name | Description |
---|---|---|
1 | RX | UART Serial Data Input |
2 | TX | UART Serial Data Output |
3 | GND | Ground |
4 | VCC | Power Supply (3.3V) |
Connecting the GP-20U7
- Connect VCC to the power supply (3.3V)
- Connect GND to the ground
- Connect TX to a RX pin
- Connect RX to a TX pin (not necessary for read position data only)
In our example, we use a Raspberry Pi 3 with VCC connected to 3V3(OUT) (Pin 1), GND connected to GND (Pin 9) and TX connected to GPIO15 (Pin 10) which is an UART-Pin.
Code Examples
Get data from the GP-20U7
1 # Source: https://forum.sparkfun.com/viewtopic.php?t=45669
2
3 import serial
4
5 # Initialize serial
6 ser = serial.Serial(port='/dev/ttyS0', baudrate=9600, timeout=None,parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE,rtscts=False,xonxoff=False,dsrdtr=False) # 9600bps, 8 bit data, 1 stop bit, no parity
7
8 while True :
9 data=ser.readline().decode("utf-8")
10 print(data)
Make the output more human readable
1 # Source: https://forum.sparkfun.com/viewtopic.php?t=45669
2
3 import serial
4
5 # Initialize serial
6 ser = serial.Serial(port='/dev/ttyS0', baudrate=9600, timeout=None,parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE,rtscts=False,xonxoff=False,dsrdtr=False) # 9600bps, 8 bit data, 1 stop bit, no parity
7
8 while True :
9 w = ser.readline().decode("utf-8")
10 data = w.split(',')
11 if data[0] == '$GPGGA':
12 msgID,UTC,Latitude,NSindicator,Longitude,EWindicator,PosFixInd,NbSatellites,HDOP,Altitude,Units,Gsep,Units,w,checksum = data
13 hh = UTC[0:2]
14 mm = UTC[2:4]
15 ss = UTC[4:6]
16 print('UTC time = %s:%s:%s, Latitude = %s%s, Longitude = %s%s, altitude = %s%s, %s satellites' % (hh,mm,ss,Latitude,NSindicator,Longitude,EWindicator,Altitude,Units,NbSatellites))