Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino Nano GPS Tracker with NEO-6M Module

View and Edit Project In Cirkit DesignerImage of Arduino Nano GPS Tracker with NEO-6M Module

Circuit Documentation

Summary

This circuit is designed to track GPS data using an Arduino Nano and a NEO-6M GPS module. The GPS module communicates with the Arduino Nano via serial communication, and the GPS data is read and displayed on the Serial Monitor.

Component List

Arduino Nano

NEO-6M (GPS Module)

Wiring Details

Arduino Nano

NEO-6M (GPS Module)

Code

/*
 * GPS Tracking using Arduino Nano
 * This code reads GPS data from a NEO-6M GPS module connected to the Arduino Nano.
 * The GPS module's TX pin is connected to D6 and RX pin to D5 of the Arduino Nano.
 * The GPS data is read and the latitude and longitude are printed to the Serial Monitor.
 */

#include <SoftwareSerial.h>
#include <TinyGPS++.h>

TinyGPSPlus gps;
SoftwareSerial gpsSerial(6, 5); // RX, TX

void setup() {
  Serial.begin(9600);
  gpsSerial.begin(9600);
}

void loop() {
  while (gpsSerial.available() > 0) {
    if (gps.encode(gpsSerial.read())) {
      if (gps.location.isValid()) {
        Serial.print("Latitude: ");
        Serial.println(gps.location.lat(), 6);
        Serial.print("Longitude: ");
        Serial.println(gps.location.lng(), 6);
      }
    }
  }
}

This code initializes the serial communication for both the Arduino Nano and the GPS module. It reads the GPS data and prints the latitude and longitude to the Serial Monitor if the location data is valid.