Guide by Jaryd; How to add GPS to Your Arduino | Add Real-Time Location to Your Project!

Hey forum peeps, got a new one for you all.

Following on from last week, we wanted to give the Arduino some love and make a GPS guide for it as well. We use C++ and an Uno R4 (but you could easily use an R3 or even an ESP32), to get our live location with the module. We then bring it all home by combining it with a magnetometer and OLED screen to build a nifty little project that gives us distance and direction to any targe location on earth! “How to add GPS to Your Arduino | Add Real-Time Location to Your Project!”





Read more

2 Likes

Can the Neo-6M operate indoors?

Hey Ahsrab,

That depends on what your indoors is. We often struggled to get it to work inside of our big metal roofed warehouse, but if we were close to a window we could get our location to about 5 meters of accuracy.

You wouldn’t be able to find your exact location inside the building, but you would probably be able to tell which building you are in if that makes sense.

It is probably going to vary a lot and hard to tell unless it is tested. If you got any more questions let us know!

It depends a lot on your antenna. The smaller rectangular ones (~22mx8mm) pretty much require direct line of sight to the satellites. The larger square ones (25mmx25mm) are much better and will work in many indoor conditions. I have had good success with re-purposed WiFi antennae, although technically they are not properly matched. There are also many ideas around for making your own antenna.

1 Like

c:\Users\bob\Documents\Arduino\libraries\GPSParser\GPSParser.cpp: In function ‘GPSData parse_gps_data(String)’:
c:\Users\bob\Documents\Arduino\libraries\GPSParser\GPSParser.cpp:108:43: error: ‘GPSData GPSReader::_process_nmea_data(String)’ is private within this context
return tmp._process_nmea_data(nmea_chunk);
^
In file included from c:\Users\bob\Documents\Arduino\libraries\GPSParser\GPSParser.cpp:2:0:
c:\Users\bob\Documents\Arduino\libraries\GPSParser\GPSParser.h:50:13: note: declared private here
GPSData _process_nmea_data(String nmea_data);
^~~~~~~~~~~~~~~~~~
c:\Users\bob\Documents\Arduino\libraries\GPSParser\GPSParser.cpp: In member function ‘GPSData GPSReader::_process_nmea_data(String)’:
c:\Users\bob\Documents\Arduino\libraries\GPSParser\GPSParser.cpp:125:30: error: no match for ‘operator=’ (operand types are ‘String’ and ‘void’)
sentence = sentence.trim();
^
In file included from C:\Users\bob\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/Arduino.h:232:0,
from c:\Users\bob\Documents\Arduino\libraries\GPSParser\GPSParser.h:8,
from c:\Users\bob\Documents\Arduino\libraries\GPSParser\GPSParser.cpp:2:
C:\Users\bob\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/WString.h:86:11: note: candidate: String& String::operator=(const String&)
String & operator = (const String &rhs);
^~~~~~~~
C:\Users\bob\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/WString.h:86:11: note: no known conversion for argument 1 from ‘void’ to ‘const String&’
C:\Users\bob\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/WString.h:87:11: note: candidate: String& String::operator=(const char*)
String & operator = (const char cstr);
^~~~~~~~
C:\Users\bob\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/WString.h:87:11: note: no known conversion for argument 1 from ‘void’ to 'const char

C:\Users\bob\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/WString.h:88:11: note: candidate: String& String::operator=(const __FlashStringHelper*)
String & operator = (const __FlashStringHelper str);
^~~~~~~~
C:\Users\bob\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/WString.h:88:11: note: no known conversion for argument 1 from ‘void’ to 'const __FlashStringHelper

C:\Users\bob\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/WString.h:90:11: note: candidate: String& String::operator=(String&&)
String & operator = (String &&rval);
^~~~~~~~
C:\Users\bob\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/WString.h:90:11: note: no known conversion for argument 1 from ‘void’ to ‘String&&’
C:\Users\bob\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/WString.h:91:11: note: candidate: String& String::operator=(StringSumHelper&&)
String & operator = (StringSumHelper &&rval);
^~~~~~~~
C:\Users\bob\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/WString.h:91:11: note: no known conversion for argument 1 from ‘void’ to ‘StringSumHelper&&’
exit status 1

Compilation error: exit status 1

"compilation problem…using uno R4 board , IDE vers.2.3.5
all libraries are up to date …incl…your gps parser …Can you help?

Hey @robert297576, Welcome to the forums!

Sorry to hear you are having issues with this library. I have given this a spin on my end and it looks like some of that code is a little outdated now.

I have updated a few lines to get it working from my Arduino IDE. Would it be possible for you to try on your end with this version of the library to see if the changes I have made work for your setup?

GPSParserV3.zip (3.0 KB)

You should be able to follow the same steps as in our guide, simply install this library instead of the one linked from the guide.

Let us know how you go with this! If it works on your end I will get the main guide updated with the newer code.