Arduino GPS tracker project with NEO-6M GPS module and MicroSD logger
Arduino Build Lab

Arduino GPS Tracker with NEO-6M and MicroSD Logging

Learn how to build a portable Arduino GPS tracker that reads satellite data, logs latitude and longitude to a MicroSD card, and runs from battery power. You will wire the GPS module, read serial NMEA data, save a CSV log, and test the tracker outdoors where GPS actually works best.

🟢 Beginner–Intermediate⏱ About 60–90 minutes📡 NEO-6M + MicroSD🔋 Portable build
◈ GPS BUILD CONSOLE
● PROJECT READY
DifficultyBeginner–Intermediate
Build Time60–90 minutes
GPSNEO-6M
StorageMicroSD
ControllerNano / Uno

What You Will Build

You are building a compact GPS data logger. When the tracker is powered on, the GPS module listens for satellite signals. The Arduino reads the GPS serial stream, extracts useful location data, and saves it as a CSV file on the MicroSD card.

After a walk, bike ride, field test, or vehicle trip, you can remove the card and open the log on your computer. The result is a simple but very real location tracking system.

Arduino Nano GPS tracker full build with GPS module, MicroSD logger, and portable battery

Arduino GPS Tracker Parts List

Component Description Example shopping link
Arduino Nano Main controller board for the GPS tracker View on Amazon
NEO-6M GPS Module Receives live satellite GPS coordinates View on Amazon
MicroSD Module Stores GPS route data to memory card View on Amazon
MicroSD Card Stores CSV tracking logs View on Amazon
USB Power Bank Portable battery power for field testing View on Amazon
Jumper Wires Breadboard and module connections View on Amazon
Important: GPS modules need a clear view of the sky for a reliable position fix. Test outdoors. The MicroSD and GPS links are examples for finding parts; check voltage compatibility and current availability before buying.

How GPS Serial Data Works

The GPS module sends a constant stream of text sentences called NMEA data. Those sentences contain time, satellite status, latitude, longitude, speed, altitude, and other values. Reading raw GPS sentences by hand is ugly, so the Arduino sketch uses TinyGPSPlus to parse the data into clean values you can use.

The basic flow is simple:

  1. The GPS module sends serial data through its TX pin.
  2. The Arduino receives that data on a software serial pin.
  3. TinyGPSPlus checks the stream and extracts valid location updates.
  4. The SD module writes each valid point to gpslog.csv.
Computer monitor showing live Arduino GPS serial data with latitude and longitude

Wiring the GPS Tracker

Wire the project carefully. The NEO-6M uses UART serial communication and the MicroSD card uses SPI. These pin assignments are for a classic 5V Arduino Nano or Uno. Check the voltage and logic-level requirements printed on your exact breakout modules before connecting power or signals.

Arduino GPS tracker wiring diagram with NEO-6M GPS and MicroSD card module
GPS ModuleArduino Pin
VCCUse the supply voltage specified for your exact GPS breakout (some include a regulator; others require 3.3V)
GNDGND
TXD4
RXD3 (optional; use level shifting if the GPS input is not 5V-tolerant)
MicroSD ModuleArduino Nano/Uno Pin
VCC5V only if the MicroSD breakout has an onboard regulator and appropriate level shifting; otherwise use a compatible 3.3V supply and logic-level shifting
GNDGND
CSD10
MOSID11
MISOD12
SCKD13
Close-up of NEO-6M GPS module connected to Arduino NanoMicroSD card logger module connected to Arduino GPS tracker

Install the Arduino Libraries

  1. Open the Arduino IDE.
  2. Go to Sketch - Include Library - Manage Libraries.
  3. Search for TinyGPSPlus and install it.
  4. The SD, SPI, and SoftwareSerial libraries are normally already included with the Arduino IDE.

Full Arduino GPS Logger Code

This version reads GPS coordinates, prints them to the Serial Monitor, and saves valid points to a CSV file on the MicroSD card.

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

TinyGPSPlus gps;
SoftwareSerial gpsSerial(4, 3); // GPS TX to D4, GPS RX to D3

const int chipSelect = 10;
File gpsFile;

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

  Serial.println("Arduino GPS Tracker Starting...");

  if (!SD.begin(chipSelect)) {
    Serial.println("SD card failed. Check wiring and card format.");
    while (true) { delay(1000); } // Stop; do not try to log without SD
  }

  Serial.println("SD card ready.");

  // Write the CSV header only for a new or empty file.
  bool writeHeader = !SD.exists("gpslog.csv");
  if (!writeHeader) {
    gpsFile = SD.open("gpslog.csv", FILE_READ);
    if (gpsFile) { writeHeader = (gpsFile.size() == 0); gpsFile.close(); }
  }
  gpsFile = SD.open("gpslog.csv", FILE_WRITE);
  if (gpsFile) {
    if (writeHeader) gpsFile.println("Date,Time,Latitude,Longitude,Altitude_m,Speed_kmph,Satellites");
    gpsFile.close();
  } else {
    Serial.println("Cannot create or open gpslog.csv");
    while (true) { delay(1000); }
  }
}

void loop() {
  while (gpsSerial.available() > 0) {
    gps.encode(gpsSerial.read());

    if (gps.location.isUpdated() && gps.location.isValid()) {
      logGPSData();
    }
  }
}

void logGPSData() {
  double latitude = gps.location.lat();
  double longitude = gps.location.lng();
  double altitude = gps.altitude.meters();
  double speed = gps.speed.kmph();
  int satellites = gps.satellites.value();

  Serial.print("Latitude: ");
  Serial.println(latitude, 6);
  Serial.print("Longitude: ");
  Serial.println(longitude, 6);
  Serial.print("Satellites: ");
  Serial.println(satellites);
  Serial.println("----------------------");

  gpsFile = SD.open("gpslog.csv", FILE_WRITE);

  if (gpsFile) {
    if (gps.date.isValid()) {
      gpsFile.print(gps.date.month()); gpsFile.print("/");
      gpsFile.print(gps.date.day()); gpsFile.print("/");
      gpsFile.print(gps.date.year());
    } else {
      gpsFile.print("NO_DATE");
    }

    gpsFile.print(",");

    if (gps.time.isValid()) {
      gpsFile.print(gps.time.hour()); gpsFile.print(":");
      gpsFile.print(gps.time.minute()); gpsFile.print(":");
      gpsFile.print(gps.time.second());
    } else {
      gpsFile.print("NO_TIME");
    }

    gpsFile.print(",");
    gpsFile.print(latitude, 6);
    gpsFile.print(",");
    gpsFile.print(longitude, 6);
    gpsFile.print(",");
    gpsFile.print(altitude);
    gpsFile.print(",");
    gpsFile.print(speed);
    gpsFile.print(",");
    gpsFile.println(satellites);

    gpsFile.close();
  } else {
    Serial.println("Could not open gpslog.csv");
  }
}

Portable Power Setup

For the first build, use a USB power bank. It is safer, easy to recharge, and gives you stable 5V power. Once the project works, you can move to a smaller Li-ion battery module and a project enclosure.

Portable Arduino GPS tracker battery power setup in transparent enclosure
Do not skip this: If you use a lithium battery, use a proper charging and protection board. Do not connect raw Li-ion cells directly to an Arduino project unless you know exactly what you are doing.

Outdoor Field Test

Take the tracker outside, power it on, and give the GPS module time to lock. A cold start can take several minutes. Once it has lock, move around slowly and watch the Serial Monitor. If the latitude and longitude values update, your tracker is working.

Arduino GPS tracker being tested outdoors on a hiking trail
  1. Power the tracker from the USB battery pack.
  2. Wait for GPS lock outdoors.
  3. Let it log for at least 5 to 10 minutes.
  4. Remove the MicroSD card.
  5. Open gpslog.csv on your computer.

Reading the CSV Log

Your CSV file will contain rows of location data. You can open it in a spreadsheet, clean it up, and use the latitude and longitude points with mapping tools.

Spreadsheet showing Arduino GPS CSV location logging data
ColumnMeaning
DateGPS date if available.
TimeGPS time in UTC.
LatitudeNorth/south coordinate.
LongitudeEast/west coordinate.
Altitude_mEstimated altitude in meters.
Speed_kmphEstimated movement speed.
SatellitesNumber of satellites used by the GPS module.

GPS Tracker FAQ

Can an Arduino Nano work with a NEO-6M GPS module?

Yes. This tutorial uses a classic Arduino Nano or Uno, with the GPS module connected over serial and a MicroSD breakout connected over SPI. Confirm that each breakout supports your board’s power and signal voltages.

Does this tracker transmit its location to a phone?

No. This build is an offline GPS data logger: it records coordinates to a MicroSD card. Live phone tracking would require additional connectivity, software and a suitable service.

Why does my GPS tracker show no coordinates indoors?

Satellite reception can be weak indoors. Take the module outside with a clear sky view and allow time for its first position fix.

Troubleshooting

ProblemFix
No GPS coordinatesGo outdoors, wait longer, and check that GPS TX goes to Arduino D4.
SD card failedFormat the card as FAT32, check CS pin D10, and verify SPI wiring.
Random characters in Serial MonitorSet the Serial Monitor to 9600 baud.
Only zeros or invalid dataThe GPS has not locked yet. Wait outside with a clear sky view.
Tracker resets on batteryUse a better USB power bank or check your battery module current output.

Arduino GPS Video Guides

These lightbox videos support the build: NEO-6M GPS setup, Arduino GPS data logging to MicroSD, and a complete Arduino GPS tracker walkthrough.

Arduino GPS tracker tutorial video thumbnailNEO-6M GPS wiring tutorial thumbnailPortable Arduino GPS logger video thumbnail

Download the Full GPS Tracker PDF Guide

Save the complete Arduino GPS Tracker tutorial offline with wiring, code, GPS logging setup, portable power notes, and troubleshooting steps.

📄 Download PDF Guide

Build Something Else Next ⚡

Continue learning with another hands-on electronics project from WolfieWeb.