The Adafruit Ultimate GPS v3 is a high-quality GPS module that offers precise location and time data by communicating with GPS satellites. It is designed to be compatible with Arduino boards and other microcontrollers, making it an ideal choice for a wide range of applications such as navigation, time synchronization, and geolocation projects. The module includes a built-in patch antenna, a low-power chipset, and supports multiple communication protocols for easy integration into various systems.
Pin Number | Name | Description |
---|---|---|
1 | VCC | Power supply (3.0-5.5V) |
2 | RX | Receive pin for serial communication |
3 | TX | Transmit pin for serial communication |
4 | GND | Ground connection |
5 | PPS | Pulse per second output |
6 | EN | Enable pin for the module |
#include <Adafruit_GPS.h>
#include <SoftwareSerial.h>
// Connect the GPS TX (transmit) pin to Arduino pin 3
SoftwareSerial mySerial(3, -1);
Adafruit_GPS GPS(&mySerial);
void setup() {
// Start the serial communication
Serial.begin(115200);
GPS.begin(9600);
// Turn on RMC (recommended minimum) and GGA (fix data) including altitude
GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCGGA);
// Set the update rate
GPS.sendCommand(PMTK_SET_NMEA_UPDATE_1HZ);
// Request updates on antenna status
GPS.sendCommand(PGCMD_ANTENNA);
}
void loop() {
// Read data from the GPS
char c = GPS.read();
// If a sentence is received, check if it's a valid fix
if (GPS.newNMEAreceived()) {
if (!GPS.parse(GPS.lastNMEA())) {
return;
}
}
// If there's a valid fix, print the location and time data
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("Time: ");
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.println((int)GPS.fix);
Serial.print("Quality: "); Serial.println((int)GPS.fixquality);
}
}
Q: How long does it take for the GPS to get a fix? A: It can take anywhere from 30 seconds to several minutes, depending on conditions and whether it's the first time the GPS is acquiring a fix.
Q: Can I use the GPS indoors? A: GPS signals are weak and usually require a clear line of sight to multiple satellites, so indoor use is not recommended.
Q: What is the PPS pin used for? A: The PPS pin outputs a pulse per second, which can be used for precise timing applications.
Q: How can I save power when using the GPS module? A: You can use the EN pin to disable the module when not in use or configure the module to a lower update rate.