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:

(API) Watch Video: 0x1b2 NAS OS | OpenZFS | FreeNAS Memory Analysis | Filesystem Metadata Overhead | NAS Performance
0x1b2 NAS OS | OpenZFS | FreeNAS Memory Analysis | Filesystem Metadata Overhead | NAS Performance
* Click the image to watch this video on Youtube ↗


Suggested Topics:


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

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

TCP vs UDP an Expert Opinion ↗
18-Jan-2020

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

Data-Plane and Control-Plane of a Networking Device ↗
30-Oct-2019

Design & Architecture of custom Dynamic Routing Protocols ↗
01-Dec-2019

Network MTU and Path MTU Discovery PMTUD - WAN and Internet Performance Optimization ↗
30-Jan-2019

Layer-2 (L2) Multicast Frame Deep Analysis ↗
21-Dec-2019

Socket Options - Socket Programming - setsockopt(), getsockopt() ↗
15-Feb-2020

Introduction to Network Processors (NPU) ↗
03-Nov-2019

Tail Drop - by Network Schedulers to Drop Packets in Network Appliances ↗
27-Jun-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:
Coding a simple look-up-table in C - without Linked lists and a binary search ↗
17-Jun-2018

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

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

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

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

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

mmap() munmap() - map or unmap files or devices into memory ↗
22-Feb-2020

A Linux system call in C without a standard library ↗
10-Mar-2017

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


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

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

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

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

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

Tracking code changes in Linux Kernel Source code ↗
19-Nov-2018

KERNEL - The Linux Channel - a High Performance Linux Kernel ↗
12-Dec-2018


Linux Kernel Internals (PDFs) - by Ramin Farajpour:
Linux Kernel Internals :: Linux Kernel Boot Process ↗
19-Nov-2018

Linux Kernel Internals :: Linux Kernel Development ↗
03-May-2019

Linux Kernel Internals :: Implementing a Linux Kernel System Call ↗
03-May-2019


Software Development (Programming) Tools:
What is a BSP | Board Support Package | Big Picture | Embedded Systems Software Development ↗
24-Jun-2019

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

What is a Toolchain | gcc Cross-Compiler | Libraries | BSP (Board Support Package) | Embedded ↗
24-Jun-2019

Kompare GUI patch and diff tool in Linux ↗
19-Jun-2018

SNMP and MIB Browsers ↗
12-Feb-2019


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

Using a GPS Sensor ↗
28-Jul-2017

 

Join The Linux Channel :: Facebook Group


Join a course:

💎 Linux, Kernel, Networking and Device Drivers: PDF Brochure
💎 PhD or equivalent (or Post Doctoral) looking for assistance: Details
💎 ... or unlimited life-time mentorship: Details


💗 Help shape the future: Sponsor/Donate


Recommended Topics:
Featured Video:
(API) Watch Video: Linux Kernel Networking Sub-system - episode4 net/core/dev.c - Packet Transmit, Receive APIs
Linux Kernel Networking Sub-system - episode4 net/core/dev.c - Packet Transmit, Receive APIs
* Click the image to watch this video on Youtube ↗

Download: Linux Kernel Booting_1.pdf


Trending Video:
(API) Watch Video: 341 Linux TUN TAP virtual network interfaces - VTUN Project Source Code Walk - Ep3
341 Linux TUN TAP virtual network interfaces - VTUN Project Source Code Walk - Ep3
* Click the image to watch this video on Youtube ↗

TUTORIALS :: Linux Networking Stack :: RFS: Receive Flow Steering:


Linux ioctl() API interface:


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


Recommended Video:
(API) Watch Video: 0x1e1 TCP vs UDP an Expert Opinion - Part 1 #TheLinuxChannel #Networking #KiranKankipati
0x1e1 TCP vs UDP an Expert Opinion - Part 1 #TheLinuxChannel #Networking #KiranKankipati
* Click the image to watch this video on Youtube ↗