GPS logging with PA1010D and M0

Updated on 8 October 2021
dev board RobotDyn M0 Mini
chip PA1010D
sensor GPS
features UART
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:

Pre-requisites

Try these simpler or similar examples:

Buy the components

Code

Download code gps-pa1010d-m0-logging.ino
#include <Adafruit_GPS.h>

#define GPSSerial Serial1

Adafruit_GPS GPS(&GPSSerial);

#define GPSECHO  true

void setup() {
  SerialUSB.begin(115200);
  while (!SerialUSB) { }

  delay(1000);
  SerialUSB.println("Adafruit GPS logging start test!");
  GPS.begin(9600);

  GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCGGA);
  GPS.sendCommand(PMTK_SET_NMEA_UPDATE_1HZ);
  GPS.sendCommand(PGCMD_ANTENNA);
  GPS.sendCommand(PMTK_Q_RELEASE);

  SerialUSB.print("\nSTARTING LOGGING....");
  if (GPS.LOCUS_StartLogger())
    SerialUSB.println(" STARTED!");
  else
    SerialUSB.println(" no response :(");
}

void loop() {
  if (GPSSerial.available()) {
    char c = GPSSerial.read();
    SerialUSB.write(c);
  }
}

Makefile

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

.PHONY: default lint all flash clean

default: lint all flash clean

lint:
	cpplint --extensions=ino --filter=-legal/copyright,-whitespace/line_length,-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 logging with PA1010D and M0 prototype

Serial console

Serial output from the firmware.

GPS logging with PA1010D and M0 serial console

Description

Use GPS module PA1010D with Arduino M0 to turn on the LOCUS built-in datalogger.

References

Watch