0% found this document useful (0 votes)
231 views

Guide To NEO-6M GPS Module Arduino - Random Nerd Tutorials

Uploaded by

SILARI
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
231 views

Guide To NEO-6M GPS Module Arduino - Random Nerd Tutorials

Uploaded by

SILARI
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 98

28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 

Guide to NEO-6M GPS Module with Arduino

This guide shows how to use the NEO-6M GPS module with the Arduino to get
GPS data. GPS stands for Global Positioning System and can be used to
determine position, time, and speed if you’re travelling.

You’ll learn how to:

Wire the NEO-6M GPS module to the Arduino UNO


Get raw GPS data
Parse raw data to obtain selected and readable GPS information
Get location

Introducing the NEO-6M GPS Module


The NEO-6M GPS module is shown in the figure below. It comes with an external
antenna, and does’t come with header pins. So, you’ll need to get and solder
some.

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 1/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 

This module has an external antenna and built-in EEPROM.


Interface: RS232 TTL
Power supply: 3V to 5V
Default baudrate: 9600 bps
Works with standard NMEA sentences

The NEO-6M GPS module is also compatible with other microcontroller boards. To
learn how to use the NEO-6M GPS module with the Raspberry Pi, you can
read: Email Alert System on Location Change with Raspberry Pi and GPS
Module.

Where to buy?
You can get the NEO-6M GPS module for a price between $5 to $20. We
recommend checking the NEO-6M GPS module page on Maker Advisor to
compare the price in different stores and find the best one.

Pin Wiring

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 2/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials

The NEO-6M GPS module has four pins: VCC , RX , TX , and GND . The

Menu 
module communicates with the Arduino via serial communication using the TX
and RX pins, so the wiring couldn’t be simpler:

NEO-6M GPS Module Wiring to Arduino UNO

VCC 5V

RX TX pin defined in the software serial

TX RX pin defined in the software serial

GND GND

Getting GPS Raw Data


To get raw GPS data you just need to start a serial communication with the GPS
module using Software Serial. Continue reading to see how to do that.

Parts Required
For testing this example you’ll need the following parts:

Arduino – read Best Arduino Starter Kits


NEO-6M GPS module
Jumper wires

You can use the preceding links or go directly to MakerAdvisor.com/tools to find all
the parts for your projects at the best price!

Schematics
Wire the NEO-6M GPS module to your Arduino by following the schematic below.

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 3/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 

The module GND pin is connected to Arduino GND pin


The module RX pin is connected to Arduino pin 3
The module TX pin is connected to Arduino pin 4
The module VCC pin is connected to Arduino 5V pin

Code
Copy the following code to your Arduino IDE and upload it to your Arduino board.

/*

* Rui Santos

* Complete Project Details https://randomnerdtutorials.com

*/

#include <SoftwareSerial.h>

// The serial connection to the GPS module

SoftwareSerial ss(4, 3);

void setup(){

Serial.begin(9600);

ss.begin(9600);

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 4/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials

void loop(){


Menu 
while (ss.available() > 0){

// get the byte data from the GPS

byte gpsData = ss.read();

Serial.write(gpsData);

View raw code

This sketch assumes you are using pin 4 and pin 3 as RX and TX serial pins to
establish serial communication with the GPS module. If you’re using other pins
you should edit that on the following line:

SoftwareSerial ss(4, 3);

Also, if your module uses a different default baud rate than 9600 bps, you should
modify the code on the following line:

ss.begin(9600);

This sketch listen to the GPS serial port, and when data is received from the
module, it is sent to the serial monitor.

while (ss.available() > 0){

// get the byte data from the GPS

byte gpsData = ss.read();

Serial.write(gpsData);

Open the Serial Monitor at a baud rate of 9600.

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 5/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 

You should get a bunch of information in the GPS standard language, NMEA.
Each line you get int the serial monitor is an NMEA sentence.

NMEA stands for National Marine Electronics Association, and in the world of
GPS, it is a standard data format supported by GPS manufacturers.

Understanding NMEA Sentences


NMEA sentences start with the $ character, and each data field is separated by a
comma.

$GPGGA,110617.00,41XX.XXXXX,N,00831.54761,W,1,05,2.68,129.0,M,
50.1,M,,*42

$GPGSA,A,3,06,09,30,07,23,,,,,,,,4.43,2.68,3.53*02

$GPGSV,3,1,11,02,48,298,24,03,05,101,24,05,17,292,20,06,71,227
,30*7C

$GPGSV,3,2,11,07,47,138,33,09,64,044,28,17,01,199,,19,13,214,*
7C

$GPGSV,3,3,11,23,29,054,29,29,01,335,,30,29,167,33*4E

$GPGLL,41XX.XXXXX,N,00831.54761,W,110617.00,A,A*70

$GPRMC,110618.00,A,41XX.XXXXX,N,00831.54753,W,0.078,,030118,,,
A*6A

$GPVTG,,T,,M,0.043,N,0.080,K,A*2C

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 6/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials

There are different types of NMEA sentences. The type of message is indicated by

Menu 
the characters before the first comma.

The GP after the $ indicates it is a GPS position.  The $GPGGA is the basic GPS
NMEA message, that provides 3D location and accuracy data. In the following
sentence:

$GPGGA,110617.00,41XX.XXXXX,N,00831.54761,W,1,05,2.68,129.0,M,
50.1,M,,*42

110617 – represents the time at which the fix location was taken, 11:06:17
UTC
41XX.XXXXX,N – latitude 41 deg XX.XXXXX’ N
00831.54761,W – Longitude 008 deg 31.54761′ W
1 – fix quality (0 = invalid; 1= GPS fix; 2 = DGPS fix; 3 = PPS fix; 4 = Real
Time Kinematic; 5 = Float RTK; 6 = estimated (dead reckoning); 7 = Manual
input mode; 8 = Simulation mode)
05 – number of satellites being tracked
2.68 – Horizontal dilution of position
129.0, M – Altitude, in meters above the sea level
50.1, M – Height of geoid (mean sea level) above WGS84 ellipsoid
empty field – time in seconds since last DGPS update
empty field – DGPS station ID number
*42 – the checksum data, always begins with *

The other NMEA sentences provide additional information:

$GPGSA – GPS DOP and active satellites


$GPGSV – Detailed GPS satellite information
$GPGLL – Geographic Latitude and Longitude
$GPRMC – Essential GPS pvt (position, velocity, time) data
$GPVTG – Velocity made good

To know what each data field means in each of these sentences, you can consult
NMEA data here.

Parsing NMEA Sentences with TinyGPS++ Library


https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 7/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials

You can work with the raw data from the GPS, or you can convert those NMEA

Menu 
messages into a readable and useful format, by saving the characters sequences
into variables. To do that, we’re going to use the TinyGPS++ library.

This library makes it simple to get information on location in a format that is useful
and easy to understand. You can click here for more information about the
TinyGPS++ Library.

Installing the TinyGPS++ Library


Follow the next steps to install the TinyGPS++ library in your Arduino IDE:

1. Click here to download the TinyGPSPlus library. You should have a .zip
folder in your Downloads folder
2. Unzip the .zip folder and you should get TinyGPSPlus-master folder
3. Rename your folder from TinyGPSPlus-master to TinyGPSPlus
4. Move the TinyGPSPlus folder to your Arduino IDE installation libraries
folder
5. Finally, re-open your Arduino IDE

The library provides several examples on how to use it. In your Arduino IDE, you
just need to go to File > Examples > TinyGPS++, and choose from the examples
provided.

Note: the examples provided in the library assume a baud rate of 4800 for the
GPS module. You need to change that to 9600 if you’re using the NEO-6M GPS
module.

Getting Location Using the NEO-6M GPS Module and


the TinyGPS++ Library
You can get the location in a format that is convenient and useful by using the
TinyGPS++ library. Below, we provide a code to get the location from the GPS.
This is a simplified version of one of the library examples.

/*

* Rui Santos

* Complete Project Details https://randomnerdtutorials.com

*/

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 8/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 
#include <TinyGPS++.h>

#include <SoftwareSerial.h>

static const int RXPin = 4, TXPin = 3;

static const uint32_t GPSBaud = 9600;

// The TinyGPS++ object

TinyGPSPlus gps;

// The serial connection to the GPS device

SoftwareSerial ss(RXPin, TXPin);

void setup(){

Serial.begin(9600);

ss.begin(GPSBaud);

void loop(){

// This sketch displays information every time a new sentence


while (ss.available() > 0){

gps.encode(ss.read());

if (gps.location.isUpdated()){

View raw code

You start by importing the needed libraries: TinyGPSPlus and SoftwareSerial

#include <TinyGPS++.h>

#include <SoftwareSerial.h>

Then, you define the software serial RX and TX pins, as well as the GPS baud
rate. If you are using other pins for software serial you need to change that here.
Also, if your GPS module uses a different default baud rate, you should also
modify that.

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 9/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials

static const int RXPin = 4, TXPin = 3;



Menu 
static const uint32_t GPSBaud = 9600;

Then, you create a TinyGPS++ object:

TinyGPSPlus gps;

And start a serial connection on the pins you’ve defined earlier

SoftwareSerial ss(RXPin, TXPin);

In the setup() , you initialize serial communication, both to see the readings on
the serial monitor and to communicate with the GPS module.

void setup() {

Serial.begin(9600);

ss.begin(GPSBaud);

In the loop is where you request the information. To get TinyGPS++ to work, you
have to repeatedly funnel the characters to it from the GPS module using the
encode() method.

while (ss.available() > 0){

gps.encode(ss.read());

Then, you can query the gps object to see if any data fields have been updated:

if (gps.location.isUpdated()){

Serial.print("Latitude="); Serial.print(gps.location.lat(), 6);


Serial.print("Longitude="); Serial.println(gps.location.lng(),
}
https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 10/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 

Getting the latitude and longitude is has simple has using gps.location.lat() ,
and gps.location.lng() , respectively.

Upload the code to your Arduino, and you should see the location displayed on
the serial monitor. After uploading the code, wait a few minutes while the module
adjusts the position to get a more accurate data.

Getting More GPS Information Using the TinyGPS++


Library
The TinyGPS++ library allows you to get way more information than just the
location, and in a simple way. Besides the location, you can get:

date
time
speed
course
altitude
satellites
hdop

The code below exemplifies how you can get all that information in a simple way.

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 11/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials

/*

Menu 
* Rui Santos

* Complete Project Details https://randomnerdtutorials.com

* Based on the example TinyGPS++ from arduiniana.org

*/

#include <TinyGPS++.h>

#include <SoftwareSerial.h>

static const int RXPin = 4, TXPin = 3;

static const uint32_t GPSBaud = 9600;

// The TinyGPS++ object

TinyGPSPlus gps;

// The serial connection to the GPS device

SoftwareSerial ss(RXPin, TXPin);

void setup(){

Serial.begin(9600);

ss.begin(GPSBaud);

void loop(){

View raw code

The TinyGPS++ library is well commented on how to use all its functionalities.

Wrapping Up
We hope you’ve found this guide useful. We intend to make a GPS data logger
with the NEO-6M GPS module and the SD card module, so stay tuned.

If you liked this project you may also like:


https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 12/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials

Guide to SIM900 GSM GPRS Shield with Arduino



Menu 
Email Alert System on Location Change with Raspberry Pi and GPS
Module
Arduino Step-by-Step Projects

Thanks for reading.

[eBook] Build Web Servers with ESP32 and


ESP8266 (2nd Edition)

Build Web Server projects with the ESP32 and ESP8266 boards to control outputs
and monitor sensors remotely. Learn HTML, CSS, JavaScript and client-server
communication protocols DOWNLOAD »

Recommended Resources

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 13/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials

Build a Home Automation System from Scratch » With Raspberry



Pi,
Menu 
ESP8266, Arduino, and Node-RED.

Home Automation using ESP8266 eBook and video course » Build IoT and
home automation projects.

Arduino Step-by-Step Projects » Build 25 Arduino projects with our course,


even with no prior experience!

What to Read Next…

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 14/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 

How to Set an ESP32 Access Point (AP) for Web Server

MicroPython: OLED Display with ESP32 and ESP8266

Flash/Upload MicroPython Firmware to ESP32 and ESP8266

Enjoyed this project? Stay updated by subscribing our


newsletter!
https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 15/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials

Your Email Address 


Menu 

SUBSCRIBE

149 thoughts on “Guide to NEO-6M GPS Module with


Arduino”

John Anderson
January 4, 2018 at 5:51 pm

I haven’t researched it yet, but it would be convenient to get m/ft relative to


an initial point.

Reply

Sara Santos
January 5, 2018 at 10:32 am

Hi John.

Yes, getting the distance to an initial point can be convenient.

You can do that with the library.

Check the example called “Distance and Course” at the library


documentation here: http://arduiniana.org/libraries/tinygpsplus/

They give an example on how to do that.

I hope this helps.

Thanks

Reply

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 16/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 
Bertil
January 4, 2018 at 9:19 pm

1:
why this void setup() {

Serial.begin(115200);

ss.begin(GPSBaud);

}
erlier you said 9600

2:
Serial.print(gps.location.lat(), 6);

what makes the number 6 ?

3:
Howe can I write to get the readings in “Degrees minutes seconds formats
(DDD MM SS)”

Regards

Bertil

Reply

Sara Santos
January 5, 2018 at 10:30 am

Hi Bertil.

1. It is 9600. I’ve already corrected that. Thanks for noticing.

2. The 6 specifies the number of decimal places.

3. You can get the location in that format in the $GPGLL NMEA
sentence, when you get the raw data. To do that with the library, check
https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 17/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials

the “Custom NMEA Sentence Extraction” in the library documentation



Menu 
here http://arduiniana.org/libraries/tinygpsplus/

Thanks.

Sara

Reply

Hasan Tariq
November 20, 2020 at 4:42 pm

NEO-6M can do upto 14 decimal places for Lat & Lon

= > (gps.location.lat(), 14)

=> (gps.location.lng(), 14)

and 7 decimal places for Altitude

=> (gps.altitude.meters(), 7);

Thanks for wonderful tutorials Rui Santos

Reply

Tenho
December 18, 2020 at 8:30 am

Those extra decimals in output are just noise. One degree in earth
surface means about 110km. So 6th decimal (in latitude) means 10cm
which is for standard GPS just enough. For high precision GPS (which
this is not) you can achieve cm level accuracy. And of course for
altitude you don’t get real micrometer accuracy

Reply
https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 18/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 

LanceArn
January 27, 2018 at 3:06 pm

Thank you very much for this Guide. I have had this module for several
weeks now and followed many guides but I could not get it to receive GPS
DATA, yet alone to display it in the Serial Monitor. The I found your Guide
to the NEO-6M GPS Module.

When I first ran the “Getting GPS Raw Data” code, I was excited that it
worked first time.

I then tried the “Getting Location ” code. After 5 seconds it started to


display the Lat & Long location. Two successes.

Thirdly, I had a go at the “Getting More GPS Information” code. After


several tries I was disappointed that I was seeing no GPS DATA on the
monitor. I spent the next 5 minutes looking over the code, trying to find out
where I had gone wrong. Then suddenly, the monitor came to life and
there was the GPS DATA being displayed and updating. I was impressed.
You had done what many other codes could not do, you enabled me to
receive the GPS DATA.

Next project – Add a 0.96” OLED display and make the PGS portable.

Kudos for this guide..

Reply

Sara Santos
January 29, 2018 at 11:39 am

Hi Lance!

We always do our best to make our guides easy to follow, so that anyone
is able to follow along.

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 19/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials

We’re happy to hear that you’ve found this guide useful, and that your

Menu 
GPS module is working perfectly.

We also intend to make a new GPS project – a GPS datalogger – in a


near future, so stay tuned.

Regards,

Sara

Reply

Aivars
February 4, 2018 at 9:28 pm

Hello!

Thank you for the tutorial!

Can I get a signal to synchronize time with my DS3231? Are new


sentences sent in 00 seconds?

Reply

Sara Santos
February 5, 2018 at 9:59 am

Hi.

What do you mean with synchronize with DS3231?

The GPS module allows you to get information about the time too.

Reply

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 20/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 
Aivars
February 5, 2018 at 6:09 pm

Hello! I need a clock that contains the RTC block DS3231 to be precisely
tuned to the other, which is several kilometers away. In my opinion, the
only way through the GPS. How do i do this?

Reply

Sara Santos
February 6, 2018 at 12:49 pm

Hi again.

We don’t have any tutorial on that subject.

Maybe you need to read the time through the GPS module, and then,
parse that time to the DS3231,

In this post you can see how to get GPS data. An on the following link,
you can see how to set the time for the DS3231 real time clock:
https://randomnerdtutorials.com/guide-for-real-time-clock-rtc-module-
with-arduino-ds1307-and-ds3231/

I hope this helps.

Reply

Mark
February 11, 2018 at 12:30 pm

Hi how can i stop that infinite loop? I just need to scan data once. Any
adice? thanks!!

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 21/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials

Reply

Menu 

Rui Santos
February 12, 2018 at 5:26 pm

You can create a separate function that is called once in the setup
function, for example

Reply

David
May 22, 2018 at 7:27 pm

Hi, I have a NEO6M GPS board from Wish, following this guide does not
give me the NMEA sentences, all I get on the serial monitor is

UBX-G60xx 00040007 FF47FFFFp)Z⸮b*ROM CORE 7.03 (45969) Mar 1

repeating over and over again. My baud rate is set at 57600. My board is
connected to the arduino 3.3V out and I have a voltage divider between
Arduino TX and the module RX. The red light on the board is always on,
and it does feel hot to the touch.

Any ideas?

Reply

Rui Santos
June 11, 2018 at 4:57 pm

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 22/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 
Hello David,

I’ve never encountered that error before, so I don’t know how to fix it.
Sorry about that.

Regards,

Rui

Reply

dcp_david
October 13, 2018 at 4:53 am

it is restarting because it is powered with 5V.

Reply

Stewart Lindenberger
May 27, 2018 at 1:59 am

Yet another well presented tutorial – Thank You.

Questions:

Why is some data reported as zero: altitude = 0.00, number of satellites =


0?

Is there an equivalent SoftwareSerial library for the ESP32?

Why do several of the items have “double” in the comments in the code?
Is the data presented half of the real value or twice the real value?

Reply

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 23/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 
Rui Santos
June 11, 2018 at 4:49 pm

Hi Stew! Thanks for your kind words. The variable declared as double
simply means “Double variable = Double precision floating point number.
On the Uno and other ATMEGA based boards, this occupies 4 bytes.
That is, the double implementation is exactly the same as the float, with
no gain in precision.” More information here:
arduino.cc/reference/en/language/variables/data-types/double/

I guess that happens (altitude = 0) when the requests fails to retrieve the
data properly…

Reply

Faruq Sahir
June 2, 2018 at 1:54 pm

how gps module cab fetch location without internet???

Reply

Rui Santos
June 11, 2018 at 4:28 pm

Hi Faruq, the GPS module makes a request to satellites that provide the
current location. No need for an Internet connection.

Reply

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 24/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 

Asad Ali
June 17, 2018 at 4:40 pm

Hey! Thanks for such a useful tutorial. I was wondering if there is any way
to reduce the time taken by the GPS module before it starts displaying
data?

Reply

Rui Santos
June 23, 2018 at 8:47 am

I think, you would need to optimize the library for a faster GPS
readings… Or use a more powerful board with the module.

Reply

yarick spruijt
June 26, 2018 at 10:39 am

do you by any chance have a code that also saves it to a SD card? I am


trying to figure that out but it not going well.

Reply

Sara Santos
June 27, 2018 at 4:44 pm

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 25/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 
Hi.

We have some examples on how to save data to microSD card. You can
modify those examples to save GPS data.

Take a look at these guides:

Guide to SD Card Module with Arduino

Arduino Temperature Data Logger with SD Card Module

I hope this helps.

Reply

Mario Ellis
July 5, 2018 at 2:23 am

Great tutorial you got here..I would like to take this project a step further
and turn on and off a relay once a certain speed is output. How can this be
achieved? do you already have any tutorial to demonstrate this? Thanks in
advance!

Reply

Sara Santos
July 7, 2018 at 9:03 am

Hi Mario.
We don’t have any tutorial on that subject. But we do have a tutorial
about the relay and the Arduino that may be useful:
https://randomnerdtutorials.com/guide-for-relay-module-with-arduino/

Regards,

Sara

Reply

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 26/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 

Nimra
August 28, 2018 at 3:46 pm

my ss.read() function not working properly its not return GPGGA values
please help me?

Reply

nimra
August 28, 2018 at 4:39 pm

ss.read() function not work properly can you please help me?

Reply

Sara Santos
August 29, 2018 at 9:01 am

Hi.

What do you mean by not working properly? Can you provide more
details?

Reply

Nimra
August 29, 2018 at 3:13 pm

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 27/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 
ss.read() function is reading character but they are not valid so the
location is not show can you provide your email so that i can contact
you.

Reply

Sara Santos
August 29, 2018 at 3:25 pm

We receive lots of questions everyday. Unfortunately, we’re not able to


provide email support to all our readers.

Have you tried both codes on our tutorial?

The one with the TinyGPS++ Library??

Are you wiring your GPS module correctly? Our sketch assumes you
are using pins 4 and 3 as RX and TX serial pins to establish serial
communication with the GPS module.

Try swapping the RX with the TX wires and see if you’re able to get
the right information.

I hope this helps.

Regards,

Sara

Reply

Nimra
August 29, 2018 at 4:27 pm

The code that provide location from the GPS noting print any thing in
serial monitor

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 28/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 
Nimra
August 29, 2018 at 5:50 pm

/*
* Rui Santos

* Complete Project Details https://randomnerdtutorials.com

*/

#include

#include

static const int RXPin = 4, TXPin = 3;

static const uint32_t GPSBaud = 9600;

// The TinyGPS++ object

TinyGPSPlus gps;

// The serial connection to the GPS device

SoftwareSerial ss(RXPin, TXPin);

void setup(){

Serial.begin(9600);

ss.begin(GPSBaud);

void loop(){

// This sketch displays information every time a new sentence is


correctly encoded.

while (ss.available() > 0){

gps.encode(ss.read());

if (gps.location.isUpdated()){

Serial.print(“Latitude= “);

Serial.print(gps.location.lat(), 6);

Serial.print(” Longitude= “);

Serial.println(gps.location.lng(), 6);

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 29/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials

else{


Menu 
Serial.print(“L”);

}
}
}

this code always return else statement not return if?

Sara Santos
August 30, 2018 at 9:06 am

That means that your Arduino is not receiving any information from
the GPS module.

Please double check the wiring and try to change the RX with the TX
pins and the other way around and see if you can get something.

If not, maybe your GPS module is broken or something

Denis
September 4, 2018 at 12:16 pm

Which board are you using?

Reply

Denis
September 4, 2018 at 12:08 pm

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 30/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 
Wow, great tutorial, really helped a lot but the problem I am facing is that,
when I tried to use this code with the GSM module, trying to send the
coordinates in a message to a specified number, the line

ss.begin (GPSBaud)

does not allow my message to be sent. Message will send if I comment


that line out. Anyone who can help?

Reply

Rui Santos
September 12, 2018 at 10:42 am

Did you enter the country code in the number? What’s the error that is
happening?

Reply

Joe Marker
September 12, 2018 at 7:37 am

Hi,

I’ve a problem with my GPS module. After connecting it to Uno, a red LED
on the GPS module blinks once, and then nothing. There is no further
blinking, and no data is received on the serial monitor.

I tried it outside in open sky, waited for around an hour, still no fix.

I connected VCC of the module directly to the 5V pin of the Uno, no pull-
up resistors were used.

Is it a wiring/connection problem? I’ve soldered header pins to the Neo 6M


GPS module, and there is no shorting.
https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 31/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials

Please reply asap.



Menu 

Thanks and regards,

Joe

Reply

Rui Santos
September 12, 2018 at 10:33 am

Hello Joe,

I’m not sure, to be honest I’ve never had that problem before, so I don’t
know why that’s happening.

Regards,

Rui

Reply

John Kneen
September 18, 2018 at 9:50 am

Two comments

1. Re the accuracy/stability of the NEO-6M itself.

In the example the longitude is given as 8.525774 with variations in the


last digit – my experience with the device over several hours the variation
could be in the last 3 figures. Reading two devices at the same time they
did not give the same result and they did not track.

2.Re the TinyGPS++ in general I obtained the same results as the


example except every 10 seconds or so the display had a glitch. By
lowering the baud rate of the output to 9600 – the same as the GPS – the
issue went away. Going to higher baud rates the issue became worse. I
wonder if the output was “catching” up to the input – I think one would

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 32/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials

really need to know the nuts and bolts of the TinyGPS++ and Serial

Menu 
Libraries to really figure it out.

Reply

Marx
October 1, 2018 at 3:11 pm

Tried the same code ..the softwareserial code but didn’t get any
output,tried several times but the code is not working

Reply

Sara Santos
October 3, 2018 at 8:41 am

Hi.

Can you check you have the TX and RX cables correctly wired?

Also check you are setting the right baud rate on the Serial monitor.

If you don’t get any response from the sensor, it may be something
wrong with the sensor itself.

Regards,

Sara.

Reply

John Kneen
October 12, 2018 at 11:15 am

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 33/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials

If precise readings are required I think there is an issue with the GPS

Menu 
examples due to the limited precision of the Arduino UNO. In the Uno
using double only gives the same precision as float – ie 4 bytes which
from the Arduino reference is approximately 6-7 decimal digits. Since in
Rui/Sara’s example the longitude is only 8 degrees their example has only
7 digits so does not appear to run into problems.

However I’m at 145.073736 which is 9 digits. Using TinyGPS++ always


gives a “0” in that 6th decimal place – I suspect the 5th place is also
subject to some error. I’ve looked at the TinyGPS++ code and the only
issue is they convert their readings into double. The problem then is that
for the Arduino Uno double precision is the same as float and is only 4
bytes – not sufficient for the GPS. Refer to Arduino Reference for “double”
– they warn about being aware when importing code into the Arduino.
Note for the Due double is 8 bytes so will be OK.

Having said all that – using the GPS can give some fun projects but don’t
expect to drive a robot down the centre line of the highway!

Reply

Aj Bulaclac
October 27, 2018 at 2:12 pm

How to support the Neo-6M GPS and Arduino into a Google app?

Reply

Sara Santos
October 29, 2018 at 10:05 am

Hi.

I don’t have any project about that subject.

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 34/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials

Regards,


Menu 
Sara

Reply

Anthony Saliba
October 30, 2018 at 6:31 pm

Hello,

Great tutorial guys and a great code. I have a problem with the altitude it is
showing always as zero. Does it need some calibration first or there is
some other fix? All other data are showing nicely (altitude, longitude, date,
time, number of satellites, speed…)

Thanks a lot

Reply

Sara Santos
November 1, 2018 at 11:30 am

Hi Anthony.

It doesn’t need any calibration. At least, in our example, we’ve just


uploaded the sample code, and everything worked nicely.

Did you experiment the simple example sketch that returns NMEA
sentences? And using TinyGPS library? Do you get the same results
using both methods?

Regards,

Sara

Reply

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 35/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 

Min
November 4, 2018 at 12:47 pm

Hi, I have try for the second code that display longitude and latitude, but
nothing come out from serial monitor….Can help me ? Thank you

Reply

Sara Santos
November 7, 2018 at 10:05 am

Hi Min.
What about the first code? Did it worked well?

It’s weird that the code with the library is not working :/

Regards,

Sara

Reply

Hector
November 5, 2018 at 12:30 am

Hey guys! Great tutorial!

I tried out the code and everything was working perfectly fine at first.
Unfortunately, the only values that seem to be updating are those for
Latitude and Longitude, all other values display 0. Is there any way to
solve this?

Reply

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 36/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 

Sara Santos
November 8, 2018 at 9:48 am

Hi Hector.

Other readers reported the same problem.

Unfortunately I have no idea why that is happening.

If you find a solution please let as know.

Regards,

Sara

Reply

Rafael Gomez
November 5, 2018 at 7:21 am

In the final code you have RXPin = 4, TXPin = 3; but above the first code
with serial it says RXPin is pin 3 and TXPin is pin 4 ? Please explain! The
first code works, but not the final code

Reply

Sara Santos
November 8, 2018 at 9:47 am

Hi Rafael.

I don’t understand your question. The RX pin is 4, and the TX pin is 3 in


both codes.

Reply

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 37/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 

Ubaid
November 12, 2018 at 2:30 pm

Hi,

I want to connect neo 6 with Esp and plot the coordinates in realtime over
wifi, can you please help? pleaseeeeeeeeeeeeeeee

Reply

Sara Santos
November 14, 2018 at 10:44 am

Hi Ubaid.

At the moment, we don’t have a specific tutorial about that subject.

Regards,

Sara

Reply

DIMOS KATIRTZIS
November 13, 2018 at 6:57 pm

Hi.

The altitude is 0.00m

Sometimes the number of sattelites is also 0 . all the other are right.

Reply

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 38/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 

DIMOS KATIRTZIS
November 14, 2018 at 10:07 am

The altitude is 0.00 and the number of satellites is allways less than 4

Reply

Sara Santos
November 14, 2018 at 11:19 am

Hi Dimos.
Other readers have reported the same issue.

Do you get that issue with the first or second example sketch?

Reply

Rodrick Custom
November 15, 2018 at 6:36 am

am using ublox-neo 6m and arduino uno am getting imformation but time


is behinde by 2hrs… How can I correct my code to get the right time am in
Malawi (Africa) below is my code am using

#include

#include

/*
This sample code demonstrates the normal use of a TinyGPS++
(TinyGPSPlus) object.

It requires the use of SoftwareSerial, and assumes that you have a

4800-baud serial GPS device hooked up on pins 4(rx) and 3(tx).

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 39/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials

*/

Menu 
static const int RXPin = 11, TXPin = 10;

static const uint32_t GPSBaud = 9600;

// The TinyGPS++ object

TinyGPSPlus gps;

// The serial connection to the GPS device

SoftwareSerial ss(RXPin, TXPin);

void setup()

{
Serial.begin(115200);

ss.begin(GPSBaud);

Serial.println(F(“FullExample.ino”));

Serial.println(F(“An extensive example of many interesting TinyGPS++


features”));

Serial.print(F(“Testing TinyGPS++ library v. “));


Serial.println(TinyGPSPlus::libraryVersion());

Serial.println(F(“by Rodrick Custom Dzonzi”));

Serial.println();

Serial.println(F(“Sats HDOP Latitude Longitude Fix Date Time Date Alt


Course Speed Card Distance Course Card Chars Sentences
Checksum”));
Serial.println(F(” (deg) (deg) Age Age (m) — from GPS —- —- to London
—- RX RX Fail”));

Serial.println(F(“—————————————————————————
————————————————————-“));

void loop()

{
static const double LONDON_LAT = 0.00, LONDON_LON = 0.00;

printInt(gps.satellites.value(), gps.satellites.isValid(), 5);

printFloat(gps.hdop.hdop(), gps.hdop.isValid(), 6, 1);

printFloat(gps.location.lat(), gps.location.isValid(), 11, 6);

printFloat(gps.location.lng(), gps.location.isValid(), 12, 6);

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 40/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials

printInt(gps.location.age(), gps.location.isValid(), 5);


Menu 
printDateTime(gps.date, gps.time);

printFloat(gps.altitude.meters(), gps.altitude.isValid(), 7, 2);

printFloat(gps.course.deg(), gps.course.isValid(), 7, 2);

printFloat(gps.speed.kmph(), gps.speed.isValid(), 6, 2);

printStr(gps.course.isValid() ? TinyGPSPlus::cardinal(gps.course.deg()) :
“*** “, 6);

unsigned long distanceKmToLondon =

(unsigned long)TinyGPSPlus::distanceBetween(

gps.location.lat(),

gps.location.lng(),

LONDON_LAT,

LONDON_LON) / 1000;

printInt(distanceKmToLondon, gps.location.isValid(), 9);

double courseToLondon =

TinyGPSPlus::courseTo(

gps.location.lat(),

gps.location.lng(),

LONDON_LAT,

LONDON_LON);

printFloat(courseToLondon, gps.location.isValid(), 7, 2);

const char *cardinalToLondon = TinyGPSPlus::cardinal(courseToLondon);

printStr(gps.location.isValid() ? cardinalToLondon : “*** “, 6);

printInt(gps.charsProcessed(), true, 6);

printInt(gps.sentencesWithFix(), true, 10);

printInt(gps.failedChecksum(), true, 9);

Serial.println();

smartDelay(10000);

if (millis() > 5000 && gps.charsProcessed() < 10)

Serial.println(F("No GPS data received: check wiring"));

}
https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 41/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials

// This custom version of delay() ensures that the gps object


Menu 
// is being "fed".

static void smartDelay(unsigned long ms)

{
unsigned long start = millis();

do

{
while (ss.available())

gps.encode(ss.read());

} while (millis() – start 1)

Serial.print(‘*’);

Serial.print(‘ ‘);

}
else

{
Serial.print(val, prec);

int vi = abs((int)val);

int flen = prec + (val = 1000 ? 4 : vi >= 100 ? 3 : vi >= 10 ? 2 : 1;

for (int i=flen; i<len; ++i)

Serial.print(' ');

}
smartDelay(0);

static void printInt(unsigned long val, bool valid, int len)

{
char sz[32] = "*****************";

if (valid)
sprintf(sz, "%ld", val);

sz[len] = 0;

for (int i=strlen(sz); i 0)

sz[len-1] = ‘ ‘;

Serial.print(sz);

smartDelay(0);

static void printDateTime(TinyGPSDate &d, TinyGPSTime &t)

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 42/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials

if (!d.isValid())


Menu 
{
Serial.print(F(“********** “));

}
else

{
char sz[32];

sprintf(sz, “%02d/%02d/%02d “, d.month(), d.day(), d.year());

Serial.print(sz);

if (!t.isValid())

{
Serial.print(F(“++3600000 “));

}
else

{
char sz[32];

sprintf(sz, “%02d:%02d:%02d “, t.hour(), t.minute(), t.second());

Serial.print(sz);

printInt(d.age(), d.isValid(), 5);

smartDelay(0);

static void printStr(const char *str, int len)

{
int slen = strlen(str);

for (int i=0; i<len; ++i)

Serial.print(i<slen ? str[i] : ' ');

smartDelay(0);

please help me how I can edit my code to have correct time

my email: [email protected]

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 43/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials

Reply

Menu 

Sara Santos
November 16, 2018 at 10:31 am

Hi.

Take a look at the following example.

It might help. instructables.com/id/Adjusting-GPS-Date-and-Time-to-your-


Time-Zone/

Regards,

Sara

Reply

Johnot
December 12, 2018 at 2:10 pm

Hi Rui.

I cannot get your sketch to display gps data frommy neo-6m.

I know the gps unit has a fix and generating NMEA sentences with full
location data by using the u-blox u-center software. When I disconnect U-
center from the gps unit and try to read the messages with your sketch it
displays zeros, not valid data.

I have baud rates correct. I have the pin connection correct.

Can you advise me what I can do to learn why the sketch is not seeing the
gps data,please?

Thanks.

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 44/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials

Reply

Menu 

Rui Santos
December 17, 2018 at 4:06 pm

I’m not sure, I’ve tried this code with multiple NEO-6M modules and it
worked for me. Do you have another module that you can use to see if it
works?

Reply

Jonathan Pettitt
December 30, 2018 at 10:08 am

Thank you so much – a perfect set of examples and clearly written


instructions to follow.

Reply

Sara Santos
December 31, 2018 at 2:07 pm

Thanks

Reply

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 45/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 
Alan Sanderson
January 15, 2019 at 3:05 pm

Hi I’m still having difficulty downloading TinyGPSPlus from github. I’ve


tried downloading by ZIP and recently by cloning and it downloads all but
the .CPP and .H files. So far Github has been unable to help. Is there any
other source besides Github for this library? Thanks

Reply

Sara Santos
January 17, 2019 at 3:41 pm

Hi Alan.

I’ve tried to download the library by .zip from the github page, and it is
working fine.

https://github.com/mikalhart/TinyGPSPlus

Click the “Clone or Download” button and then select “Download ZiP”.

See this image: https://randomnerdtutorials.com/wp-


content/uploads/2019/01/download-tiny-gs.png

Then, you just need to follow the instructions on the “Installing the
TinyGPS++ Library” section of this tutorial .

I hope this helps.

Regards,

Sara

Reply

Arsalan
January 16, 2019 at 10:27 pm

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 46/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 
How can i get the longitude, latitude and altitude gata of gps on my mobile
phone sms using sim 900

Reply

Sara Santos
January 17, 2019 at 5:48 pm

Hi.

We don’t have information about that specific tutorial.

However, you can take a look at some of our tutorials that may help you:

– https://randomnerdtutorials.com/sim900-gsm-gprs-shield-arduino/

– https://randomnerdtutorials.com/request-sensor-data-sms-arduino-
sim900-gsm-shield/

Regards,

Sara

Reply

Arsalan
January 16, 2019 at 10:43 pm

Can i use GPSBaud=19200?

Reply

Sara Santos
January 17, 2019 at 5:45 pm

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 47/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 
Hi.

It depends on your GPS module default baud rate.

Reply

Nurnaby Siddiqui
March 4, 2019 at 6:00 am

Probably this is the best tutorial available on internet on this specific topic
!!!
thank you!!

Reply

Sara Santos
March 4, 2019 at 12:16 pm

Thank you for your interest in our projects.

Regards,

Sara

Reply

John
March 7, 2019 at 5:50 am

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 48/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 
How do I connect my GPS to a 16*2 lcd with potentiometer? And what
changes do I need to make to the code in order display all GPS data on
my lcd?

Reply

Sara Santos
March 9, 2019 at 12:18 pm

Hi John.

You need to learn how to use an LCD display to do that.

It is not difficult at all. You can use the following tutorial as a reference:
https://randomnerdtutorials.com/arduino-display-the-led-brightness-on-a-
lcd-16×2/

I hope this helps.

Regards,

Sara

Reply

mounika JS
March 11, 2019 at 4:45 pm

How this GPS module request the satellite?

Reply

Sara Santos
March 12, 2019 at 4:06 pm

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 49/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 
Hi.

What do you mean?

Reply

Joel
March 11, 2019 at 6:34 pm

At first, the two TinyGPS++ sketches didn’t show any data. But after five
minutes, the module’s LED began blinking and all the data began to
appear in the serial monitor.

Great project, Rui and Sara!

Reply

Sara Santos
March 12, 2019 at 4:06 pm

Hi Joel.

I’m happy that it worked.

Maybe the GPS module just needed some time to connect and find
satellites.

Regards,

Sara

Reply

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 50/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 
esa
March 30, 2019 at 1:23 am

As for moving TinyGPSPlus into the Arduino installations, do you mean


the libraries folder in the Arduino directory?

Reply

Sara Santos
March 30, 2019 at 10:21 am

Yes.

Reply

Paulof
May 17, 2019 at 9:20 am

Hi guys, thanks for this tutorial well explained, as always

I have a question, I tried to execute the first program and I got those
results :

$GPRMC,,V,,,,,,,,,,N*53

$GPVTG,,,,,,,,,N*30

$GPGGA,,,,,,0,00,99.99,,,,,,*48

$GPGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*30

$GPGSV,1,1,00*79

$GPGLL,,,,,,V,N*64

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 51/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials

After looking on others forums it seems that satellites don’t see my GPS,

Menu 
do you have any idea of how could I get normal sentences ?

Thanks !

Reply

Sara Santos
May 19, 2019 at 9:41 am

Hi.

What do you mean by “satellites don’t see my GPS”?

Have you tried this library: arduiniana.org/libraries/tinygpsplus/

Did you get weird results with this library too?

Regards,

Sara

Reply

Paulof
May 20, 2019 at 8:57 am

Hi tanks for reply !

Well I meant : It seems that my gps isn’t able to get informations from
satellites, because the NMEA sentences returned are “empty”.

When I used the tinygpsplus library, I firstly got nothing, then I deleted
the iteration “if (gps.location.isUpdated())”, and I got everything at 0 :

Latitude= 0.000000 Longitude= 0.000000

Raw date DDMMYY = 0

Speed in m/s = 0.00

Speed in km/h = 0.00

Altitude in meters = 0.00

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 52/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials

Number os satellites in use = 0


Menu 
So not weird results (because my NMEA sentences are empty), but not
good to…

Reply

Paulof
May 20, 2019 at 9:00 am

Heeyyyy it finally worked !!

It was definitively a connection problem. I went outside, waited some


minutes, and it worked!

Thanks for that tutorial

Reply

Sara Santos
May 22, 2019 at 11:51 am

Great!

I’m glad it is working now.

Regards,

Sara

Anatolii
January 26, 2020 at 8:32 pm

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 53/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 
You should wait about 10-20 minutes before your GPS module will find
appropriate satellites

Reply

kiran
May 22, 2019 at 3:20 pm

Hello, I want to read exact location of mobile ( longitude and latitude ) by


using bluetooth HC-05 Module.

is it possible? or please tell me if there is any other way…

Reply

Sara Santos
May 23, 2019 at 8:40 am

Hi.

I’m sorry, but we don’t have any resources about that subject.

Regards,

Sara

Reply

Dave
June 11, 2019 at 10:16 am

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 54/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 
Excellent article and code examples, you really helped me to get this
working! Thank you!

Reply

Sara Santos
June 11, 2019 at 10:53 am

Thanks

Reply

ArdGuy300
June 16, 2019 at 11:14 pm

Hi, thank you for the article.

When I open my serial monitor, all I get is a bunch of weird gibberish


characters. Do you know how to fix the problem?

Thank you

Reply

Sara Santos
June 18, 2019 at 6:58 pm

Hi.

Make sure that your serial monitor is set to the right baudrate.

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 55/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials

Reply

Menu 

Roman
June 20, 2019 at 7:52 pm

Hi

I wanted to make a GPS logger. I have been trying to follow tutorials on


the internet but I have had no luck yet. Could anyone please help? my
hardware is and arduino uno which it temporary replacing a nano, neo m6
ublox GPS module and an SD card module.

Thank You

Reply

Sara Santos
June 23, 2019 at 5:45 pm

Hi Roman.

Maybe our SD card tutorial can help:


https://randomnerdtutorials.com/guide-to-sd-card-module-with-arduino/

Regards,

Sara

Reply

Mudassar
August 7, 2019 at 4:50 pm

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 56/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials

I have Got Longitude and latitude successfully now i want to save these

Menu 
longitude and latitude in database. i am using esp8266 esp01 with arduino
uno and neo6m gps. can you please guide me how i can send it to
database using esp8266.

Reply

Rui Santos
August 8, 2019 at 2:02 pm

Unfortunately I don’t have any tutorials on that exact subject, but I


recommend searching for HTTP POST ESP or you can follow this
tutorial: Visualize Your Sensor Readings from Anywhere in the World
(ESP32/ESP8266 + MySQL + PHP)

In that project I’m posting sensor readings, but you could send GPS
coordinates the same way.

Reply

Randall
August 16, 2019 at 2:32 am

A number of people are having a problem with the number of satellites and
the altitude reporting 0. I changed the serial baud rate at Serial.begin to
115200 in the code and also in the serial monitor to 115200 and it is now
giving me the number of satellites and altitude.

Everything is working great now. Thanks so much for this tutorial.

Reply

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 57/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 
Sara Santos
August 24, 2019 at 10:42 am

Hi Randall.

Thank you for sharing that info.

It will certainly be useful for our readers.

Thank you.

Regards,

Sara

Reply

Khidir
September 8, 2019 at 9:48 am

Hello, great piece of code, was wondering on the code I would use to
display output from the Serial.print to lcd.print, how can I connect the
output of latitude and longitude from the serial print to my LCD.

Reply

Sara Santos
September 8, 2019 at 4:27 pm

Hi.

You can follow this tutorial to learn how to display something on the LCD
display.

https://randomnerdtutorials.com/esp32-esp8266-i2c-lcd-arduino-ide/

This tutorial is for ESP32 and ESP8266, but it should work with Arduino.
You just need to connect the right I2C pins.

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 58/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials

Regards,


Menu 
Sara

Reply

Zee
September 23, 2019 at 2:50 pm

Would like to make a clock – shift registers to LED display using the GPS
– any future project?

Purely Hours – minutes and seconds.

How do you alter Hours to GMT +2 ??

Reply

Sara Santos
October 2, 2019 at 3:51 pm

Hi Zee.

Thanks for the suggestion, but that’s not in our plans.

Regards,

Sara

Reply

sarojini
October 29, 2019 at 7:45 am

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 59/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 
Can we able to use this gps for outdoor positioning like for marine
applications ?

Reply

Sara Santos
October 29, 2019 at 11:19 am

Hi.

Yes, you can do that.

You just need to check if it has enough accuracy for your specific
application.

Regards,

Sara

Reply

christian
November 29, 2019 at 5:55 am

I have Got Longitude and latitude successfully now i want to save these
longitude and latitude in database online. i am using esp8266 esp01 and
neo6m gps. can you please guide me how i can send it to database using
esp8266.

Reply

Sara Santos
December 2, 2019 at 2:24 pm

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 60/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 
Hi Christian, you can follow this project:
https://randomnerdtutorials.com/esp32-esp8266-mysql-database-php/

Regards,

Sara

Reply

christian
December 3, 2019 at 3:27 am

Thnk Sara

Reply

Ahmed Zarroug
January 4, 2020 at 5:03 am

did yo guys make a GPS data logger yet ? Thank you

Reply

Sara Santos
January 4, 2020 at 11:46 am

Hi.

We don’t have any tutorial about that.

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 61/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials

Regards,


Menu 
Sara

Reply

Pedro
January 30, 2020 at 8:27 pm

Hi! This might be a stupid question but why do I have to use the TX/RX
pins? Can I use other Digital Pins? I’m asking because I’d like to output
the information to another software (Max/MSP) to be interpreted there by
another kind of code but.

Thanks!

Reply

Sara Santos
January 31, 2020 at 10:09 am

Hi Pedro.

As we’re using software serial, you can choose any pins to connect.

You just need to modify your code accordingly.

Regards,

Sara

Reply

tesfalem
March 12, 2020 at 8:14 am
https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 62/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 
hi sara

just i have done it by pic micro controller using mp lab IDE c code.

but i will like to do again by Arduino, sis could you help me please just
what is the difference between them

Reply

Sara Santos
March 12, 2020 at 9:58 am

Hi.

I’m sorry but I didn’t understand your question.

Can you reformulate?

Regards,

Sara

Reply

tesfalem
March 12, 2020 at 12:20 pm

i will do gps interface with arduino display in lcd.

pleas help me the cod ms sara

Reply

tesfalem
March 12, 2020 at 2:00 pm

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 63/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials

hi sara & Rui santos


Menu 
this is great tutorial thanks to you and your members keep it up pleas.

just i have read all even if the coments your respond is amazing .

i pass to my point i am doing GPS with Arduino using simulation now so


i would like to display this your code to LCD not to com pleas help with
same explaination

regards,

tesfalem

Reply

Colin
March 19, 2020 at 8:32 pm

Hi Sara,

Great help! I have been trying for ages to parse data ready for assembling
a string that can be sent to an SD card. Your noted helped me to do this in
minutes. Thank you.

However, using Lat = (gps.location.lat(),6); Lon = (gps.location.lng(),6);


just produces: (2020/3/19)(20/27/59) 6 6 94.40 8, where the two sixes
were the fields for Lat and Lon. Removing the sixes: Lat =
(gps.location.lat()); Lon = (gps.location.lng()); prints Lat Lon values.

Any suggestions.

Colin H.

Reply

Sara Santos
March 20, 2020 at 11:28 am

Hi Colin.

I’m sorry, but I didn’t understand your question.

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 64/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials

Regards,


Menu 
Sara

Reply

Colin
March 20, 2020 at 3:18 pm

Hi Sara,

It is just the latitude and longitude that prints out using your code are
only printed out to two decimal places.

When the ‘6’ is added to the codes, the serial print out only prints out
‘6’, and not the GPS values.

Hope that helps.

Thank you for getting back.

Colin.

Reply

Sara Santos
March 21, 2020 at 11:04 am

Hi Colin.

I don’t know why that happens. Maybe it is because you don’t have
enough signal for the module to get the coordinates?

Does your GPS module’s blue LED blinks? That means it is catching
satellite signal and can calculate the position.

Regards,

Sara

Reply

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 65/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials

Colin 
Menu 

March 20, 2020 at 5:10 pm

Thanks for getting back, Sara.

The last bit of the message, I see, got garbled.

Basically, the codes for latitude and longitude only showed two decimal
places. And, when I added the code: (gps. location. lat(), 6);, the Serial
print printed ‘6’, and no GPS value.

Best wishes

Colin.

Reply

Ufuk
April 9, 2020 at 8:14 pm

Hi

Does the length of the GPS information after the ‘$’ sign vary ?

Thanks your informations

Reply

Sara Santos
April 10, 2020 at 11:06 am

Hi.

Yes, it can vary depending if it is able to pick up all the information from
the satellites.

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 66/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials

Regards,


Menu 
Sara

Reply

Ufuk
April 11, 2020 at 7:48 pm

Hi again,

Thank you so much for your answer.

Reply

Ulrich Engel
July 2, 2020 at 5:25 pm

I have found a NEO-6M-GPS shield for arduino Uno/Mega with SD on it


for Datalogging. Do you know more about this shield. Where can I get
more information about this shield . I like to build a tracking project. Catch
gps data, show the data on a oled 1.3 display and save the data on SD-
Card. Do you know a tutorial I can use? I´m a beginner.

Greatings

Reply

Sara Santos
July 2, 2020 at 7:12 pm

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 67/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 
Hi.

We don’t have a tutorial about that.

But, we have some tutorials that you can


combine:https://randomnerdtutorials.com/guide-to-sd-card-module-with-
arduino/

https://randomnerdtutorials.com/arduino-temperature-data-logger-with-
sd-card-module/ (modify to save GPS data instead of temperature)

You can check all our Arduino projects here:


https://randomnerdtutorials.com/projects-arduino/

Regards,

Sara

Reply

Mohamed
August 26, 2020 at 3:21 pm

Hello,

I am a researcher and currently study slipping of tractor’s tires on muddy


and sandy grounds, so I need to measure the actual speed of the tractor
through GPS and measure the theoretical speed of the tires through a
tachometer.

Do you recommend a GPS device that can be connected to a laptop to


read the tractor speed data, record it, deal with it on a program, and
compare it with the theoretical speed of tires??

Will its accuracy and response be good??

What is the lowest speed that GPS can read it with good accuracy?

Do you recommend any device that can measure the actual speed of a
tractor?
https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 68/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials

What about NEO-6M for this project?



Menu 

Reply

Sara Santos
August 26, 2020 at 4:45 pm

Hi Mohamed.

I’m not familiar with sensors for your project.

The NEO-6M is not very accurate, specially if it doesn’t get signal from
many satellites. However, if the place where you’ll use it has a good
signal, maybe you can get good results.

You really need to experiment and see if it is appropriate for your project
or not.

Regards,

Sara

Reply

John Keane
August 26, 2020 at 6:50 pm

Mohamed, Guidance on achievable accuracy, time to acquire satellites


etc. is very thin on the ground. It would be good to see a proper article
written to make clear what is achievable with these low cost devices and
limited precision processors like the UNO. Is there anyone out there who
can do that?

The projects described here are an excellent introduction and very


helpful in understanding how it all works. But I doubt that the precision
comes close to what you need for monitoring low speed movement of a
tractor. I think the positional accuracy is unlikely to be better than about
2m. (Does anyone know otherwise?)

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 69/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials

I have a similar interest in monitoring the speed of a passenger carrying



Menu 
miniature railway train (speeds below 5mph). I gave up because GPS
modules that can achieve positional accuracy below 1m cost hundreds if
not thousands of dollars. I stayed with axle speed monitoring using a
sensor that gave 22 pulses per revolution – and positional accuracy of
close to a couple of centimeters – which works for me, but doesn’t solve
your problem of wheel slip.

I hope someone is able to give you a more positive and helpful response.

Reply

Ramazan
December 19, 2020 at 4:48 am

hi sara

thanks alot for your tutorial.

in serial monitor, i see Latitude= 36.125423 Longitude= 43.998405

i want to store those into string variables as below:

String lati = gps.location.lat(), 6;

String logi = gps.location.lng(), 6;

but in serial monitor shows this :

lati= 36.13

logi= 44.00

i want data store in string whith decimal.

please help me

thanks

Reply

Adeem Baig
February 3, 2021 at 11:01 pm

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 70/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials

Hi. Great tutorial. It works fine. A detailed explanation helped a lot.



Menu 

I have another issue. I’m trying to combine neo 6m and dht22 with
esp8266. It works fine when I use they delay of 500 ms or below.
Unfortunately, it doesn’t work when I use a delay above 500ms. With
500ms or no delay, there are a lot of duplicate readings and a lot of data to
handle. Can you guide any solution to that? A delay of 5000ms would be
fine. Thanks

Reply

Sara Santos
February 6, 2021 at 11:49 am

Hi.

I suggest that you try use timers instead of delays.

It may also be useful to use taskscheduler:


https://www.arduino.cc/reference/en/libraries/taskscheduler/

Regards,

Sara

Reply

Rick
February 8, 2021 at 2:44 pm

what’s the Neo6 Rx buffer size ?thanks

Reply

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 71/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials

Asmaa 
Menu 
April 4, 2021 at 3:26 pm

Hi

Thanks a lot for your useful tutorials .

I am used NEO-6M GPS Module with ESP32 and connect Vcc with 3.3V
also used your code but the module didn’t work (no output on serial
monitor)
Can you tell me where the problem, please?

Reply

Jose
April 29, 2021 at 8:19 pm

how can you make a 0 to 60 mph meter ?

that shows how much time took to reach 60mph

Regards

Jose

Reply

Hamza ASA
May 29, 2021 at 10:49 am

Hello Sara Santos,

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 72/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials

thank you for your interesting project and it was very beneficial to me.

Menu 

Now I am trying to adapt your code with the stm32 bluebill for a current
project but I am having problems.

Could you help me because I’m new to programming?

Reply

Asmaa
November 1, 2021 at 5:50 pm

I want to know how to use PPS pin of the GPS

Reply

Ernst
August 14, 2022 at 2:44 pm

Hallo,

I wanted to run the sketch with an ESP32. It did not work. Compilation
Error ! It takes me one and a half day to find the right SoftwareSerial.h .
There are a few different Libraries. So be so kind and give a hint at the
beginning of the Tutorial. The library is in the Arduino core.

Reply

Sara Santos
August 15, 2022 at 11:27 am

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 73/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 
Hi.

This code is not compatible with the ESP32.

It is for the Arduino board.

Search on google for “ESP32 with NEO-6M” and you’ll find some sample
codes for the ESP32.

At the moment, we don’t have any examples for this module with the
ESP32.

Regards,

Sara

Reply

Danylo
August 29, 2022 at 9:49 pm

Hi, When i tried the first code which gave Dan output of NMEA
sentences it worked.

But fated install the TinyGPS++ library and running the new code
nothing appears on the serial monitor at all.

Ps. My baud rate is 9600

Reply

Danny
August 15, 2022 at 1:14 pm

Hello Ernst,

I think I can help. I have a project ‘Navigator-II’, using an NodeMCU


ESP-32, GPS Neo-M8N and OLED display, last worked on it on 6/2022. I

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 74/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials

am using a SoftwareSerial.h library, just have to check the version.


Menu 
I can send you the info, code and picture. I am sure you will find the
answer.

Reply

Ernst
August 16, 2022 at 6:23 am

Hallo Danni,

ich habe dieses Tutorial mit der passenden SoftwareSerial Datei in


Betrieb. Ich möchte jetzt aber mehr. Ihr Angebot nehme ich daher gerne
an.

Zu meiner Person: Anfänger mit Arduino Programmierung, Teste gerne


Tutorials. Mein Alter: 80 Jahre.

Meine E-mail Adresse oldschueller at t-online.de

Reply

Ernst
August 16, 2022 at 3:42 pm

Hello Danny,

thank you very much for your offer. I appreciate your help. I am a
newcommer in Arduino and like it very much to get Tutorials working. I
am in the age of 80 and therefore a little bit slow. If you able to send me
your work then please to my e-mail [email protected]. Greetings
from Germany.

Reply

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 75/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials

Danylo 
Menu 

September 27, 2022 at 8:43 pm

the first code that displays the nmea sentences works for me but the last
two codes using the tinygpsplus library doesnt work at all, i dont know why.
but the last two codes worked a couple of times before but for two weeks
now ive not been able to get it to work

my serial monitor doesnt show any errors as well.

Reply

Sara Santos
September 27, 2022 at 9:45 pm

What happens exactly with that example?

Regards,

Sara

Reply

Thisara sankalpa
October 3, 2022 at 3:59 pm

Hi , i tried my best to get this module work but i not connecting tothe
satellite or even u center software. It not showing anything on serial
monitor . I need to know, is it need to connect Satellite before everything?
And how much time will it take to connect . Thanks

Reply

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 76/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials

Sara Santos 
Menu 

October 3, 2022 at 11:02 pm

Hi.

After uploading the code, you need to place the sensor outside or near a
window to catch the satellite signal.

It will display information on the serial monitor, once it has found a stable
number of satellites.

Regards,

Sara

Reply

Roy
November 16, 2022 at 1:36 pm

Thanks for the excellent tutorial.

I am confused about one thing.

In your article, you say:

The module GND pin is connected to Arduino GND pin

The module RX pin is connected to Arduino pin 3

The module TX pin is connected to Arduino pin 4

The module VCC pin is connected to Arduino 5V pin

Code

Copy the following code to your Arduino IDE and upload it to your Arduino
board.

/*
* Rui Santos

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 77/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials

* Complete Project Details https://randomnerdtutorials.com


Menu 
*/

#include <SoftwareSerial.h>

// The serial connection to the GPS module

SoftwareSerial ss(4, 3);

void setup(){

Serial.begin(9600);

ss.begin(9600);

void loop(){

while (ss.available() > 0){

// get the byte data from the GPS

byte gpsData = ss.read();

Serial.write(gpsData);

}
}

View raw code

This sketch assumes you are using pin 4 and pin 3 as RX and TX

At the start of this extract, you say RX is pin 3 and TX is pin4.

But the last line suggests the opposite.

Which one is right?

Reply

Leave a Comment

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 78/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 

Name *

Email *

Website

Notify me of follow-up comments by email.

Notify me of new posts by email.

Post Comment

Visit Maker Advisor – Tools and Gear for


makers, hobbyists and DIYers »

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 79/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 

Home Automation using ESP8266 eBook


and video course » Build IoT and home
automation projects.

Build Web Servers with ESP32 and


ESP8266 » boards to control outputs and
monitor sensors remotely.

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 80/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 81/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 82/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 83/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 84/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 85/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 86/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 87/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 88/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 89/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 90/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 91/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 92/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 93/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 94/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 95/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 96/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 

About
Support
Terms and Conditions
Privacy Policy
Refunds
Complaints’ Book

MakerAdvisor.com
Join the Lab

Copyright © 2013-2022 · RandomNerdTutorials.com · All Rights Reserved


Mettre à jour les paramètres de confidentialité

Exclusive Member of Mediavine Home

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 97/98
28/11/2022 21:28 Guide to NEO-6M GPS Module Arduino | Random Nerd Tutorials


Menu 

https://randomnerdtutorials.com/guide-to-neo-6m-gps-module-with-arduino/ 98/98

You might also like