The Linux Channel

TUTORIALS :: Using a GPS Sensor

Written by: Saumitra Kapoor, edited by Kiran Kankipati - Published: 28-Jul-2017


A GPS receiver uses satellites to pinpoint locations, so as long as you have a GPS receiver and a clear view of the sky, you'll never be lost again!

Have a look at this amazing site to know more about a GPS Sensor: http://electronics.howstuffworks.com :: How GPS Receivers Work

I would suggest have a look at how the GPS receiver generates a Pseudo Random Code which has a mention in the given site. The GPS system uses an array of satellites orbiting around the earth and sending time information. It picks up the signal transmitted from the satellites, calculates the time it took for the signal to arrive, and by identifying the position of satellites, triangulates the position on the surface of the globe. It uses the standard NMEA protocol (http://www.nmea.org) to transmit the position data via serial port. Let us start exploring the world of GPS!

GPS Satellites


Here is a list of components needed:


Here are some images of this module:


Image Source: http://www.alselectro.com/images/GPS_3_thumb_0cdckk0l.jpg


Image Source: https://cdn.instructables.com/F0J/9T8J/IOT2UO46/F0J9T8JIOT2UO46.MEDIUM.jpg


Image Source: http://module143.com/image/cache/catalog/skg13bl-500x500.jpg


The connections are as follows:

Skylab SKG13BL GPS Receiver



GND of GPS ------------ GND of Arduino
3.3V of GPS ------------- 3.3V on Arduino

Note: Skylab SKG13BL: It is always a good practice to read the Datasheet. So here you go: http://www.alselectro.com/files/SkyLab_Datasheet.pdf
Note : You can even use a 12V Power source, but here we are using 3.3V.

Most microcontrollers these days have built in UARTs (universally asynchronous receiver/transmitter) that can be used to receive and transmit data serially. UARTs transmit one bit at a time at a specified data rate (i.e. 9600bps, 115200bps, etc.). This method of serial communication is sometimes referred to as TTL serial (transistor-transistor logic).

The last simple connection involves connecting the TLL from GPS to Arduino Board:
Rx of GPS -------- Tx of Arduino (Pin 3)
Tx of GPS --------- Rx of Arduino (Pin 4)

* Refer Pg.8 of the Datasheet.

Now, connect the G Mouse to the GPS Receiver and connect the Arduino board to the PC via USB.


Libraries/Dependencies:
Here are the required libraries we need to install.
Install the TinyGPS Library from here: http://arduiniana.org/libraries/tinygps/
Install the Software Serial Library: https://www.arduino.cc/en/Reference/SoftwareSerial


Please take care of the following:

  • Do not connect the GPS Module to Multiple Power Supplies.
  • Place the G Mouse at a spot where it can see the sky.
  • Please go through the Datasheet.
  • You can even use Putty to obtain output (in Windows) - http://www.putty.org/
  • If the code shows error, make sure to keep the Baud Rate to 9600.
  • If you face port or driver problem,
    Do this (in Windows): Control Panel > System and Security > System > Device Manager > Ports > Arduino UNO > Update Driver Software > Browse computer manually and choose the Arduino IDE folder.


Source code:
Download the code HERE.
Kindly remember to refer the previous step in case of Port Error.


Output:
The code will give the Latitude and Longitude. Make sure to divide the output by 10^6 to get correct coordinates.

You can also visit sites likes to map the points:


So here is the output it generates:

Position: lat: 26865785 lon: 80906375 Position: lat: 26865785 lon: 80906375 Position: lat: 26865785 lon: 80906375 Position: lat: 26865783 lon: 80906375 Position: lat: 26865783 lon: 80906375 Position: lat: 26865783 lon: 80906375 Position: lat: 26865783 lon: 80906375 Position: lat: 26865783 lon: 80906373 Position: lat: 26865783 lon: 80906373 Position: lat: 26865783 lon: 80906373 Position: lat: 26865783 lon: 80906373 Position: lat: 26865783 lon: 80906373 Position: lat: 26865783 lon: 80906373 Position: lat: 26865783 lon: 80906373 Position: lat: 26865783 lon: 80906373 Position: lat: 26865783 lon: 80906372 Position: lat: 26865783 lon: 80906372 Position: lat: 26865783 lon: 80906370 Position: lat: 26865783 lon: 80906370 Position: lat: 26865783 lon: 80906370 Position: lat: 26865783 lon: 80906370 Position: lat: 26865783 lon: 80906372 Position: lat: 26865783 lon: 80906372 Position: lat: 26865783 lon: 80906375


About me: Saumitra Kapoor
My name is Saumitra Kapoor and I am in love with Electronics, Circuits, Wires and Devices. I started learning everything about it long back from wherever I could and I haven’t stopped since. I try to read a lot, build fun projects and come up with tutorials.


Featured Video:


* Click the image above to watch this video on Youtube ↗


Suggested Topics:


Network Software Development:
 Tail Drop - by Network Schedulers to Drop Packets in Network Appliances ↗
27-Jun-2018


 Bufferbloat in a Networking Device or an Appliance ↗
27-Jun-2018


 UDP sample socket code for Systems and Network software developers ↗
02-Feb-2017


 C code to check valid IP Address (IPv4) - Live Demo and Example ↗
18-Jun-2018


 iPerf tool - for network channel analysis, bandwidth tests and system & network benchmarking ↗
04-Jul-2018



Research and Projects:
 Data Profiling and Visual Analysis tool for Deep Learning and AI - VLOG - The Linux Channel ↗
21-Jun-2018


 CYRIL INGÉNIERIE - CoreFreq Linux CPU monitoring software ↗
19-Jun-2018


 Difference between Intel Xeon Server vs Desktop Core i7 vs Intel Mobile Atom vs ARM Processors ↗
19-Jun-2018


 Research Socket overhead in Linux vs Message Queues and benchmarking ↗
21-Jun-2017


 Tour of my new Home Networking Lab within VirtualBox VM ↗
16-May-2017



Linux (user-space), Systems Architecture:
 A Linux system call in C without a standard library ↗
10-Mar-2017


 Linux user-space Atomic Operations via GCC Atomic builtins ↗
22-Mar-2017


 Synchronization in Linux user-space - Architecting multi-process and multi-threads ↗
18-Sep-2018


 Dynamic linking without STDLIB in Linux user-space C programming ↗
05-May-2017


 Linux user-space Pthread Synchronization via Mutex - Live Demo and Example ↗
03-Jun-2018


 Linux user-space - Shared Memory IPC - Live Demo and Example ↗
18-Jul-2018


 Coding a simple look-up-table in C - without Linked lists and a binary search ↗
17-Jun-2018


 C code to read a /proc file in Linux user-space - Live Demo and Example ↗
11-Jun-2018



Linux Kernel Software Development:
 Linux Networking Stack :: RFS: Receive Flow Steering ↗
09-Dec-2017


 Kernel customization via make menuconfig - Linux Kernel Compilation (or a Kernel Build) ↗
11-Jul-2018


 How to submit your Linux Kernel Patch ↗
07-Feb-2017


 How to upgrade or install a latest current release Linux Kernel version manually in Ubuntu? ↗
05-Jan-2018


 Tracking Linux Kernel bugs in Kernel.org Bugzilla (or Bugzee as we call it in the Industry) ↗
24-Sep-2018



Software Development (Programming) Tools:
 Kompare GUI patch and diff tool in Linux ↗
19-Jun-2018


 Bluefish IDE - a simple versatile light-weight best editor to edit kernel source files, html files, c source code, text files, SQL schema and so on. ↗
19-Jun-2018



Embedded Projects:
 Using a GPS Sensor ↗
28-Jul-2017


 GPS Geo-tracking system using LinkIt ONE ↗
11-Jan-2017


 

Join The Linux Channel :: Facebook Group

* This website is driven by AI.

Join a course:

💎 Linux Kernel and Systems Software: PDF Brochure

💎 Linux and Network Software Developer: PDF Brochure


💗 Help shape the future: Sponsor/Donate


Recommended Topics:
Featured Video:

* Click the image above to watch this video on Youtube ↗


Trending Video:

* Click the image above to watch this video on Youtube ↗

TUTORIALS :: Research Socket overhead in Linux vs Message Queues and benchmarking:


Linux Kernel TCP Congestion Control Algorithms:
Linux Kernel Programming - Device Drivers:


Research :: Content Delivery Networks (CDN):
CDN Networks


Recommended Video:

* Click the image above to watch this video on Youtube ↗

The Linux Channel - v10.2 :: Updated: 06-Oct-2018 :: © 2018 :: Author: Kiran Kankipati
Your IP: 54.198.55.167 :: Browser: CCBot/2.0 (https://commoncrawl.org/faq/)