GPS Modules with Ar...
 
Notifications
Clear all

GPS Modules with Arduino and Raspberry Pi

78 Posts
19 Users
3 Likes
7,602 Views
(@dronebot-workshop)
Workshop Guru Admin
Joined: 5 years ago
Posts: 1053
Topic starter  

Learn how satellite positions systems like GPS work, how to use GPS modules with Arduino and Raspberry Pi, and build a GPS position logger which can display results on Google Maps.

Article with Code Samples: https://dronebotworkshop.com/using-gps-modules/

The Global Positioning System, or GPS, is one of several satellite positioning systems that we can use to determine our location, altitude and the exact time - from anywhere in the world.

Thanks to these systems, and the availability of low-cost receiver modules, we can easily add GPS functionality to any project.

Today I’ll explain how these positioning systems work, what kind of data we can get out of them, and how we can use these popular modules with both the Arduino and Raspberry Pi.

And, as a fun experiment, I’ll show you how to build a simple Arduino-based GPS logger that saves your position onto a microSD card, using a file format that can be imported into Google Maps. I took a walk in the park with it to give it a test.

Here is what you’ll see in today's video:

00:00 - Introduction
01:25 - Satellite-Based Navigation Systems
08:00 - Look at GPS Modules
10:34 - Basic GPS Operation with SoftwareSerial
15:28 - GPS Libraries - TinyGPS++
19:55 - Beitian 880 with HMC5883 magnetometer
25:48 - Adafruit Ultimate GPS with Raspberry Pi
32:19 - Build a GPS Position Logger
47:52 - Conclusion

As always, you’ll find a detailed article with code samples and cheat sheets on the DroneBot Workshop website. And a dedicated thread for it on the DroneBot Workshop Forum, so you can discuss it in detail.

This is the first of a few GPS-related videos and articles I’ll be producing, as I have a couple of GPS projects on the go. So please subscribe so that you don't miss any of them.

"Never trust a computer you can’t throw out a window." — Steve Wozniak


   
Quote
(@sj_h1)
Member
Joined: 3 years ago
Posts: 167
 

As usual an excellent video. I have a couple of questions. I always have trouble identifying the connectors used on theses devices. The spec sheet only says "1.00mm 4pins". If I want to buy this type of connector what would I search for? Another issue I have come across is project boxes to mount my projects. The only boxes I can seem to find are those that are for the Arduino or Raspberry Pi only. No room for other devices. At least that's all I can find amazon. Does anyone have a resource of someone who sells various box sizes?

 


   
ReplyQuote
(@larry-manson)
Member
Joined: 3 years ago
Posts: 18
 

On Amazon search plastic boxes and then select the department of Industrial and Scientific.  It will give you some possibilities.

 

Digikey

Mouser

Really any electronic distributor

Hardware and Electrical distributors will have junction boxes.

 

 

 

 


   
ReplyQuote
(@larry-manson)
Member
Joined: 3 years ago
Posts: 18
 

In the early days we used varnished wood for chassis for radio kits. I've sprayed varnish on card stock and used it to build electronic components. Plastic storage containers can be found at the dollar store, Walmart or wherever. https://www.mcmaster.com/ has a ton of mechanical things.  EBAY. Polystyrene sheets can be cut and glued together with acetone. 


   
ReplyQuote
MACE
 MACE
(@mace)
Member
Joined: 3 years ago
Posts: 8
 

Doesn't the Arduino have a built-in LED that can be blinked?  Why use a separate red -- brightness, visibility?  I'd loved to have see the system in operation.


   
ReplyQuote
Aswin
(@aswin)
Member
Joined: 3 years ago
Posts: 9
 

it is a very exciting video as usual but the GPS module are very defective to find in India.

I like all your videos they are very exciting and interesting.

it has been a long time since uploaded a video in BD1 the real robot series I am eagerly waiting for DB1 the real robot part 17. there are totally how many parts in the DB1 real robot series. will there also be DB2 the real robot? 

Aswin


   
ReplyQuote
(@kiranshashiny)
Member
Joined: 5 years ago
Posts: 3
 

What are the other identical modules similar to the ones mentioned in the video.
I'm from India and am interested in building such a project - but we don't have the Beitian modules as in the video, sold around.

There is a Neo-6M and sister modules - which is advertised as confirming to NMEA standards.
Appreciate any inputs from other members as well.
Loved the video - very useful, informational and your style of teaching is amazing, down to earth explaining of complex terms. 


   
ReplyQuote
(@kiranshashiny)
Member
Joined: 5 years ago
Posts: 3
 

I was hoping to see an introduction to GSM as well, either in the video or a follow up to the video.
I'm new to this and as soon as I Googled - I got results for GSM as well.
So, an introduction or another supporting video on GSM with GPS would've helped as I found your explaining much more understandable.
Thanks.


   
ReplyQuote
MadMisha
(@madmisha)
Member
Joined: 4 years ago
Posts: 340
 
Posted by: @kiranshashiny

There is a Neo-6M and sister modules - which is advertised as confirming to NMEA standards.

That should work. It is a standalone module. That means that you can communicate with it through UART, I2C or SPI and it will do everything you need. 

 

Here is a tutorial for using that exact one and it uses the same library that Bill uses. Tutorial Here If you have issues for some reason after following Bill's example, you can look there but it should be the same.

 

Most things will work with arduino as long as you can communicate with it. Libraries help but are not always required. If no library is available then you would have to use the datasheet to find out how to use it. There are sometimes small caveats like repeated start conditions for I2C are not compatible with the wire library but those are rare and you can usually find a workaround but it usually takes a lot more time. When in doubt, read the datasheet. If you see something you don't recognize, google it to find out if it will work your intended micro.


   
ReplyQuote
(@leeol)
Member
Joined: 3 years ago
Posts: 3
 

My GPS modules seem to work as I can see raw data but the other softwares don't work.  I am pretty sure the problem is that my main sentence from the sensor starts with $GNGGA instead of $GPGGA. Does anyone else have this problem or know what other software to use?


   
ReplyQuote
(@leeol)
Member
Joined: 3 years ago
Posts: 3
 

I found a solution to my problem. The Arduino program GPS_SoftwareSerial_Parsing which is

one of the examples from the Adafruit GPS Library apparently can parse $GNGGA sentences. 


   
ReplyQuote
(@leeol)
Member
Joined: 3 years ago
Posts: 3
 

There is a difference between the video "cheat sheet" and the download "cheat sheet"


   
ReplyQuote
(@mark-bolton)
Member
Joined: 3 years ago
Posts: 108
 

Wonderfully presented work!

As to RTK ... I assume this is a sharpened pencil version of DGPS.

When I was chasing low flying Geophys airplanes round the country side we would take the recorded data stream from the survey aircraft. We would also have a base station GPS set up in the general area of the survey. Not In Real time ..i.e. hours or days later we would take the two positional files and "normalize" the moving one to the stationary one, by simple subtraction.  We called it DGPS.

The robot that I am thinking about.... Running a grid on salt pans looking for electromagnetic anomalies... would need to have a better Geo-location system than raw GPS and it would need to be available to the robot in real time to shrink the circle of uncertainty as it did its traverses across the salt pans.  Sometimes in the Western Australian Goldfields GPS is all over the place like a giddy goat.

Set up a stationary GPS and look at the KML files later and the maps shows a huge and sporadic instance of baseline  wandering and fuzziness. Now this is all well and good after the airplane has flown the survey, to constrain the track error down a bit.

A slow moving robot could have similar directional noise damping implemented by just lowering the sampling rate on the directional data.

But it would be possible ? I wonder. To share real time data from a bog basic dingo DGPS with the moving robot so as it wasnt having to smooth and guess its path to conform with the grid. All we would need to do is do a  "compare" .. probably on a time base in the tens of seconds just so as to keep the robot from hunting ... with IOT architecture it should be possible?

I hope I haven't hidden the TL;DR nature of my technical conjecture too much in the anecdote . I hope that the anecdote more clearly illuminates the said technical conjecture.

Kindest Regards

M

 

 

 

 


   
ReplyQuote
(@dronebot-workshop)
Workshop Guru Admin
Joined: 5 years ago
Posts: 1053
Topic starter  
Posted by: @mark-bolton

As to RTK ... I assume this is a sharpened pencil version of DGPS.

Yes, basically they are the same thing. And I'm currently working on another video/article about GPS RTK, although I can't work on it this week as there are a crew of questionably qualified individuals sawing trees down around my house, so my backyard is currently a war zone!

Essentially, with RTK (real time kinematics) you establish a fixed GNSS receiver at a known longitude and latitude. As it "knows" what it's location is, it will "know" how inaccurate the satellite signal is. It then calculates a correction coefficient and transmits it (in my case using telemetry radios) to nearby GPS RTK-capable receivers.

The errors in the satellite positions are primarily caused by disturbances in the ionosphere and troposphere, so the theory is that any receivers close to the reference antenna will also experience the same distortions.  By applying the correction signals sent from the reference you should, in theory, be able to get resolution down near a centimeter, although in my application (an outdoor waypoint robot) I'd be happy to get it down to under 15 cm.

Sparkfun has a few good articles that outline the process, I've been using them as guides:

https://learn.sparkfun.com/tutorials/what-is-gps-rtk/all

https://learn.sparkfun.com/tutorials/setting-up-a-rover-base-rtk-system

https://learn.sparkfun.com/tutorials/how-to-build-a-diy-gnss-reference-station

Glad you enjoyed the video!

😎

Bill

"Never trust a computer you can’t throw out a window." — Steve Wozniak


   
ReplyQuote
(@mark-bolton)
Member
Joined: 3 years ago
Posts: 108
 

Thanks Bill I will look into the references you sent.

One thing a n00b should know is that there are different mapping conventions.

Lat and Long is for mariners and aviators.

UTM is for us folks that like to find things attached to the dirty part of the planet.

This is important information that IMHO deserves a mention in any into to GPS systems.

Kind Regards

M

 


   
ReplyQuote
Page 1 / 6