GPS Dongle Interfaced With Raspberry Pi

GPS plays a prominent role in the present day navigation systems, starting out with smartphones and automobiles to much complex missile guidance systems. Yes!! the GPS is indispensable. That was, just to remind ourselves the importance of GPS and to understand how painstaking the navigation, without GPS, will be; plotting a course, getting lost, and finally finding the way.

Actual topic here, as the title says, is communication between the Pi and a GPS module and there by reading the latitude and longitude. This quick learning guide will be helpful to add position tracking to your Pi project. So lets start on the topic here.

Raspberry Pi, interfaced with a GPS module, can be used for developing an advanced real-time navigation system. Incorporating the Pi’s image processing, audio processing and web interface capabilities along with the GPS data  we can develop advanced navigation schemes for real-time implementation.

Modules Needed

  1. Raspberry Pi
  2. GPS Module

Connect the GPS module to any of the USB port in the Raspberry Pi.

Once the connection are made and the modules are powered, make sure that the  GPS module is kept in a place where the GPS has a clear view to the sky or at least near a window for reliable signal integrity. We may find problem receiving signals in indoor area, the GPS signal can get blocked by metal, deep forest, mountains etc.

Now open the python editor and program your Pi, to receive the serial data from the GPS module. A sample code is given below, which can be used as it is or you can modify it to suit your project.

To check out more details on the GPS  module, follow this link.

 So thats the code to locate your Pi. Once the Pi is on with this code, it will receive the location coordinates from the GPS and the same can viewed in the Python Shell.

Using this GPS data we can pinpoint the corresponding location on Google maps. If you are using ‘midori’ web browser, then the code given below can be used to locate the coordinates.

call(“midori https://www.google.co.in/maps/@latitude,longitude“)

The latitude and longitude values, received from the GPS module, should be concatenated with the address link. An example is shown below.

call(“midori https://www.google.co.in/maps/@9.6385,77.0059”)

The ‘call‘ function is used to run terminal commands using Python. To import the call function add the following code at the beginning of your program.

from subprocess import call

We can also get the location address using the GPS data. The following link gives the location address for corresponding GPS data

http://maps.google.com/maps/api/geocode/json?address=lattitude,longitude

Open up this link on your browser, using the ‘call‘ function, and you will get the location address.

Shop With Us

  • Click here to buy Raspberry Pi 2 from RhydoLabz.
  • Click here to buy Raspberry Pi 2 Starter Kit from RhydoLabz.
  • Click here to buy Raspberry Accessories from RhydoLabz.
  • Click here to buy GPS Dongle from RhydoLabz

Leave a Reply