Introduction

Arduino & Adafruit Ultimate GPS Breakout v3

GPS is a powerful tool for developers and tinkerers alike. In this article, we’re going to show you how interface one of these modules with your favorite microprocessor – Arduino!
In order make sure that everything goes smoothly before getting started it’s important I have some background information about both devices… What kind/model does he come equipped With? How accurate has been reported as being able provide positions at any given moment

Hardware Introduction

Arduino UNO R3

Arduino Uno is a microcontroller board based on the ATmega328P (datasheet). It has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz ceramic resonator (CSTCE16M0V53-R0), a USB connection, a power jack, an ICSP header and a reset button. It contains everything needed to support the microcontroller; simply connect it to a computer with a USB cable or power it with a AC-to-DC adapter or battery to get started. You can tinker with your Uno without worrying too much about doing something wrong, worst case scenario you can replace the chip for a few dollars and start over again.

“Uno” means one in Italian and was chosen to mark the release of Arduino Software (IDE) 1.0. The Uno board and version 1.0 of Arduino Software (IDE) were the reference versions of Arduino, now evolved to newer releases. The Uno board is the first in a series of USB Arduino boards, and the reference model for the Arduino platform; for an extensive list of current, past or outdated boards see the Arduino index of boards.

Picture 1. Arduino UNO R3 pin out

Features

Processor

  • ATMega328P Processor

Memory

  • AVR CPU at up to 16 MHz
  • 32KB Flash
  • 2KB SRAM
  • 1KB EEPROM

Security

  • Power On Reset (POR)
  • Brown Out Detection (BOD)

Power

  • 2.7-5.5V

Peripherals

  • + 2x 8-bit Timer/Counter with a dedicated period register and compare channels
  • + 1x 16-bit Timer/Counter with a dedicated period register, input capture and compare channels
  • + 1x USART with fractional baud rate generator and start-of-frame detection
  • + 1x controller/peripheral Serial Peripheral Interface (SPI)
  • + 1x Dual mode controller/peripheral I2C
  • + 1x Analog Comparator (AC) with a scalable reference input
  • + Watchdog Timer with separate on-chip oscillator
  • + Six PWM channels
  • + Interrupt and wake-up on pin change

Arduino Analog Pin Description

Arduino Digital Pin Description

Sensor 

GPS-Adafruit-ultimate-v3
GPS-Adafruit-ultimate-v3

Adafruit Ultimate GPS Breakout v3 (Sensor Description) 

The breakout is built around the MTK3339 chipset, a no-nonsense, high-quality GPS module that can track up to 22 satellites on 66 channels, has an excellent high-sensitivity receiver (-165 dB tracking!), and a built-in antenna. It can do up to 10 location updates a second for high speed, high sensitivity logging or tracking. Power usage is incredibly low, only 20 mA during navigation.

Breakout board comes with: a ultra-low dropout 3.3V regulator so you can power it with 3.3-5VDC in, 5V level safe inputs, ENABLE pin so you can turn off the module using any microcontroller pin or switch, a footprint for optional CR1220 coin cell to keep the RTC running and allow warm starts and a tiny bright red LED. The LED blinks at about 1Hz while it’s searching for satellites and blinks once every 15 seconds when a fix is found to conserve power. If you want to have an LED on all the time, we also provide the FIX signal out on a pin so you can put an external LED on.

Adafruit Ultimate GPS Breakout v3 specification:

  • Satellites: 22 tracking, 66 searching
  • Patch Antenna Size: 15mm x 15mm x 4mm
  • Update rate: 1 to 10 Hz
  • Position Accuracy: 1.8 meters
  • Velocity Accuracy: 0.1 meters/s
  • Warm/cold start: 34 seconds
  • Acquisition sensitivity: -145 dBm
  • Tracking sensitivity: -165 dBm
  • Maximum Velocity: 515m/s
  • Vin range: 3.0-5.5VDC
  • MTK3339 Operating current: 25mA tracking, 20 mA current draw during navigation
  • Output: NMEA 0183, 9600 baud default
  • DGPS/WAAS/EGNOS supported
  • FCC E911 compliance and AGPS support (Offline mode : EPO valid up to 14 days )
  • Up to 210 PRN channels
  • Jammer detection and reduction
  • Multi-path detection and compensation

Adafruit Ultimate GPS Breakout Pinouts:

Operating specifications:

VIN – power input, connect to 3-5VDC. It’s important to connect to a clean and quiet power supply.

GND – power and signal ground. Connect to your power supply and microcontroller ground.

VBAT is an input pin – it is connected to the GPS real time clock battery backup. We suggest using the battery spot on the back but if you have a project with a coin cell or other kind of battery that you want to use (and its under 3.3V) you can connect it to the VBAT pin.

EN is the Enable pin; it is pulled high with a 10K resistor. When this pin is pulled to ground, it will turn off the GPS module.

3.3V is the output from the onboard 3.3V regulator.

TX – The pin that transmits data from the GPS module to your microcontroller or computer. It is 3.3V logic level. Data comes out at 9600 baud by default.

RX – The pin that you can use to send data to the GPS. You can use 3.3V or 5V logic, there is a logic level shifter.

FIX is an output pin – it is the same pin as the one that drives the red LED. When there is no fix, the FIX pin is going to pulse up and down once every second. When there is a fix, the pin is low (0V) for most of the time, once every 15 seconds it will pulse high for 200 milliseconds.

PPS is a new pin output on V3 modules. It’s a “pulse per second” output. Most of the time it is at logic low (ground) and then it pulses high (3.3V) once a second, for 50-100ms, so it should be easy for a microcontroller to sync up to it.

Schematic Diagram

Schematic Diagram

Pin Connection Table

Github Link:

https://github.com/iottrends/iottrends/tree/main/Adafruit_GPS

Source Code

#include <Adafruit_GPS.h>
SoftwareSerial mySerial(3, 2);
Adafruit_GPS GPS(&mySerial);
void setup() {
Serial.begin(115200); 
GPS.begin(9600); 
GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCGGA); 
GPS.sendCommand(PMTK_SET_NMEA_UPDATE_1HZ);
GPS.sendCommand(PGCMD_ANTENNA); 
}

void loop() {
GPS.parse(GPS.lastNMEA()); 
GPS.newNMEAreceived();
    Serial.print("\nTime: ");
    Serial.print(GPS.hour, DEC); Serial.print(':');
    Serial.print(GPS.minute, DEC); Serial.print(':');
    Serial.print(GPS.seconds, DEC); Serial.print('.');
    Serial.println(GPS.milliseconds);
    Serial.print("Date: ");
    Serial.print(GPS.day, DEC); Serial.print('/');
    Serial.print(GPS.month, DEC); Serial.print("/20");
    Serial.println(GPS.year, DEC);
    Serial.print("Fix: "); Serial.print((int)GPS.fix);
    Serial.print(" quality: "); Serial.println((int)GPS.fixquality);
    if (GPS.fix) {
      Serial.print("Location: ");
      Serial.print(GPS.latitude, 4); Serial.print(GPS.lat);
      Serial.print(", ");
      Serial.print(GPS.longitude, 4); Serial.println(GPS.lon);
      Serial.print("Location in degrees, works with Google Maps): ");
      Serial.print(GPS.latitudeDegrees, 4);
      Serial.print(", ");
      Serial.println(GPS.longitudeDegrees, 4);
      Serial.print("Speed (knots): "); Serial.println(GPS.speed);
      Serial.print("Angle: "); Serial.println(GPS.angle);
      Serial.print("Altitude: "); Serial.println(GPS.altitude);
      Serial.print("Satellites: "); Serial.println((int)GPS.satellites);
    }
}

Code Explanation

Init Section

#include <Adafruit_GPS.h>
SoftwareSerial mySerial(3, 2);
Adafruit_GPS GPS(&mySerial);

In order to achieve the same we need to download or Import the library. To achieve the same follow the steps mentioned below.

Adafruit GPS library – Open up your Arduino IDE and head to your Sketch > Include Library > Manage Libraries window. Search for GPS and select the option, “Adafruit GPS Library”.

Convert the pins 2 and 3 to serial pins by using SoftwareSerial Command.

Void setup section

Serial.begin(115200); 
GPS.begin(9600); 
GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCGGA); 
GPS.sendCommand(PMTK_SET_NMEA_UPDATE_1HZ);
GPS.sendCommand(PGCMD_ANTENNA); 

Setting the Baud rate to 115200 baud rate will help a lot in printing all of the data that comes from the GPS Module to the serial monitor. Set output to only RMC and GGA sentences. Set the output to 1/second. If you want you can go higher/lower. Check whether the antenna is connected or not.

Void Loop section

GPS.newNMEAreceived();
    Serial.print("\nTime: ");
    Serial.print(GPS.hour, DEC); Serial.print(':');
    Serial.print(GPS.minute, DEC); Serial.print(':');
    Serial.print(GPS.seconds, DEC); Serial.print('.');
    Serial.println(GPS.milliseconds);
    Serial.print("Date: ");
    Serial.print(GPS.day, DEC); Serial.print('/');
    Serial.print(GPS.month, DEC); Serial.print("/20");
    Serial.println(GPS.year, DEC);
    Serial.print("Fix: "); Serial.print((int)GPS.fix);
    Serial.print(" quality: "); Serial.println((int)GPS.fixquality);

Parse the last NMEA(National Marine Electronics Association) sentence the Arduino has received, breaking it down into its constituent parts.

GPS.newNMEAreceived(); This will return a boolean TRUE/FALSE depending on the case.

GPS Lock section

if (GPS.fix) {
      Serial.print("Location: ");
      Serial.print(GPS.latitude, 4); Serial.print(GPS.lat);
      Serial.print(", ");
      Serial.print(GPS.longitude, 4); Serial.println(GPS.lon);
      Serial.print("Location in degrees, works with Google Maps): ");
      Serial.print(GPS.latitudeDegrees, 4);
      Serial.print(", ");
      Serial.println(GPS.longitudeDegrees, 4);
      Serial.print("Speed (knots): "); Serial.println(GPS.speed);
      Serial.print("Angle: "); Serial.println(GPS.angle);
      Serial.print("Altitude: "); Serial.println(GPS.altitude);
      Serial.print("Satellites: "); Serial.println((int)GPS.satellites);

Print the current date/time/etc.

Check whether GPS has a fix. If the GPS module has a fix, line by line prints the GPS information. GPS information includes latitude,  longitude, Location in degrees, Speed in knots, Angle, Altitudes and Satellites. 

Wrapping it up

This completes the complete solution of interfacing Adafruit GPS with Arduino and the complete program. Adafruit GPS is a simple and reliable component to track assests using GPS Technology. You can explore the code at github

0 0 votes
Article Rating
Previous articleHow to Interface ESP8266 with Adafruit GPS | GPS-Adafruit
Next articleHow to Interface Arduino with AdaFruit LoRa RFM69HCW
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments