It's easy to use the Adafruit Mini GPS PA1010D breakout with Python or CircuitPython and the Adafruit CircuitPython GPS module. This library allows you to write Python code that reads the date, time, location and more from the breakout.
You can use this sensor with any CircuitPython microcontroller board or with a computer that has GPIO and Python thanks to Adafruit_Blinka, our CircuitPython-for-Python compatibility library.
CircuitPython Microcontroller Wiring
The Adafruit Mini GPS PA1010D can be wired up in multiple ways. We recommend I2C as it is the simplest. There are two ways you can connect the GPS to a microcontroller using I2C.
I2C Interface
Here is an example of the module connected to a Feather M0 Express for I2C using the STEMMA connector and a STEMMA cable:
- Feather 3V to STEMMA red wire (VIN)
- Feather GND to STEMMA black wire (GND)
- Feather SDA to STEMMA blue wire (SDA)
- Feather SCL to STEMMA yellow wire (SCL)
Here is an example of the module connected to a Feather M0 Express for I2C using jumper wires:
- Feather 3V to module VIN
- Feather GND to module GND
- Feather SCL to module SCL
- Feather SDA to module SDA
- Feather 3V to module VIN
- Feather GND to module GND
- Feather TX to module RXI
- Feather RX to module TXO
Python Computer Wiring
Since there's dozens of Linux computers/boards you can use we will show wiring for Raspberry Pi. For other platforms, please visit the guide for CircuitPython on Linux to see whether your platform is supported.
I2C Interface
Here's the Raspberry Pi wired with I2C using the STEMMA connector and a STEMMA cable:
- Pi 3V to STEMMA red wire (VIN)
- Pi GND to STEMMA black wire (GND)
- Pi SDA to STEMMA blue wire (SDA)
- Pi SCL to STEMMA yellow wire (SCL)
Here's the Raspberry Pi wired with I2C using jumper wires:
UART Interface
For UART, you have two options: An external USB-to-serial converter or the built-in UART on the Pi's TX/RX pins.
USB-to-Serial Cable Interface
Here's an example of wiring up the USB-to-TTL serial converter, and the FTDI serial TTL-232 USB cable (also available in USB-C):
For USB to TTL serial cable:
- USB 3V (red wire) to module VIN
- USB GND (black wire) to module GND
- USB TX (green wire) to module RXI
- USB RX (white wire) to module TXO
For FTDI serial TTL cable - the FTDI cable pinout matches the pinout on the UART side of the PA1010D Mini GPS Module. Connect the cable so that the wires align as follows:
- FTDI black wire to module GND
- FTDI brown wire to module PPS
- FTDI red wire to module VIN
- FTDI orange wire to module RXI
- FTDI yellow wire to module TXO
- FTDI green wire to module WAKE
Here's an example using the Pi's built-in UART:
If you want to use the built-in UART, you'll need to disable the serial console and enable the serial port hardware in raspi-config. See the UART/Serial section of the CircuitPython on Raspberry Pi guide for detailed instructions on how to do this.
CircuitPython Installation of GPS Library
Next you'll need to install the Adafruit CircuitPython GPS library on your CircuitPython board.
First make sure you are running the latest version of Adafruit CircuitPython for your board.
Next you'll need to install the necessary libraries to use the hardware. Carefully follow the steps to find and install these libraries from Adafruit's CircuitPython library bundle. For example, the Welcome to CircuitPython guide has a great page on how to install the library bundle.
To install the libraries, you'll need to copy the following files from the bundle to the lib folder on your CIRCUITPY drive:
- adafruit_gps.mpy
- adafruit_bus_device
Before continuing make sure your board's lib folder has the adafruit_gps.mpy and adafruit_bus_device files and folders copied over.
Python Installation of GPS Library
You'll need to install the Adafruit_Blinka library that provides the CircuitPython support in Python. This may also require enabling I2C and UART on your platform and verifying you are running Python 3. Since each platform is a little different, and Linux changes often, please visit the CircuitPython on Linux guide to get your computer ready!
Once that's done, from your command line run the following command:
sudo pip3 install adafruit-circuitpython-gps
If your default Python is version 3 you may need to run 'pip' instead. Just make sure you aren't trying to use CircuitPython on Python 2.x, it isn't supported!
Page last edited March 08, 2024
Text editor powered by tinymce.