Uniostar
Published © GPL3+

Arduino with Neo6m GPS Module

Hey! Interested in learning how to use a GPS with an Arduino? Check out this quick tutorial to learn more!

BeginnerProtip30 minutes77
Arduino with Neo6m GPS Module

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
×1
Neo-6m GPS Sensor
×1
Female/Female Jumper Wires
Female/Female Jumper Wires
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Schematic

Follow connections with jumper cables.

Code

GPS Basic Example

Arduino
Install TinyGPS++ library to use
#include <TinyGPS++.h>
#include <TinyGPSPlus.h>
#include <SoftwareSerial.h>

TinyGPSPlus gps;
SoftwareSerial GPS(3, 4);

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

  Serial.println("Program started");
}

void loop()
{
  if (GPS.available() > 0)
  {
    gps.encode(GPS.read());

    if (gps.location.isUpdated())
    {
      Serial.print("Latitude = "); 
      Serial.print(gps.location.lat(), 6);
      Serial.print(" Longitude = "); 
      Serial.print(gps.location.lng(), 6);
    }
  }
}

Credits

Uniostar
10 projects • 5 followers
Electrical Engineering Undergrad Student specialized in low-level programming, IoT projects, and microcontroller electronics.

Comments