GPS parsing via I2C

Updated on 8 October 2021
dev board Arduino UNO
chip PA1010D
sensor GPS
features I2C
This tutorial is more than 1 year old. If the steps below do not work, then please check the latest versions and the documentations of the individual tools used.

Before starting

Dependancies

Ensure the following dependancies are downloaded and available:

Buy the components

Code

Download code gps-pa1010d-arduino-i2c.ino
#include <Adafruit_GPS.h>

Adafruit_GPS GPS(&Wire);

void setup() {
  while (!Serial) {}
  Serial.begin(115200);
  Serial.println("Adafruit GPS library basic I2C test!");
  GPS.begin(0x10);  // The I2C address to use is 0x10
}

void loop() {
  if (Serial.available()) {
    char c = Serial.read();
    GPS.write(c);
  }
  if (GPS.available()) {
    char c = GPS.read();
    Serial.write(c);
  }
}

Makefile

BOARD?=arduino:avr:uno
PORT := $(shell ls /dev/cu.usbmodem*)

.PHONY: default lint all flash clean

default: lint all flash clean

lint:
	cpplint --extensions=ino --filter=-legal/copyright,-readability/casting *.ino

all:
	arduino-cli compile --fqbn $(BOARD) ./

flash:
	arduino-cli upload -p $(PORT) --fqbn $(BOARD) ./

clean:
	rm -f .*.bin
	rm -f .*.elf
	rm -f .*.hex

Prototype

A photo of the actual setup.

GPS parsing via I2C prototype

Schematic

Wire up the hardware accordingly

GPS parsing via I2C schematic

Serial console

Serial output from the firmware.

GPS parsing via I2C serial console

Description

Use Adafruit GPS module PA1010D with Arduino UNO raw NMEA sentences via the I2C protocol.

References

Watch