GPS Module for Raspberry Pi Tutorial


NOTE: If you don't have a Raspberry Pi you can get one buying a Raspberry Pi Starter Kit.

Difficulty: Medium –

Preparation Time: 30 minutes

NOTE: All the code examples in this tutorial use the arduPi library. You can see the documentation and download the library here.

GPS Module for Raspberry Pi Tutorial

Steps Index

Steps Index:

  1. Connecting the GPS module to Raspberry Pi.
  2. Getting GPS NMEA sentences using cutecom.
  3. Getting GPS NMEA sentences in a Raspberry Pi program.
  4. Controlling the output of standard NMEA messages.
  5. Important Issues.
  6. Video-Tutorial.

Step 1: Connecting the GPS module to Raspberry Pi:

The GPS module for Raspberry Pi is a small electronic circuit that allows to connect to your Raspberry Pi board to get position and altitude, as well as speed, date and time on UTC (Universal Time Coordinated). It uses the standard NMEA protocol ( to transmit the position data via serial port.

For connecting the GPS module to a Raspberry Pi we need to use the Rx and Tx pins of the shield.

Once the GPS is connected, you have to connect power to it. Using two small wires (red for 5V and black for GND). See the picture.

Step 4: Controlling the output of standard NMEA messages:

There are some NMEA commands that we can use for controlling the output NMEA messages of the GPS module. We can activate / deactivate each NMEA message (GGA, GLL, GSA, GSV, RMC and VTG) sending to the module these commands.


Activate => $PSRF103,00,00,01,01*25

Deactivate =>$PSRF103,00,00,00,01*24


Activate => $PSRF103,01,00,01,01*24

Deactivate => $PSRF103,01,00,00,01*25


Activate => $PSRF103,02,00,01,01*27

Deactivate => $PSRF103,02,00,00,01*26


Activate => $PSRF103,03,00,01,01*26

Deactivate => $PSRF103,03,00,00,01*27

GPS Module for Raspberry Pi Tutorial Schematic


Activate => $PSRF103,04,00,01,01*21

Deactivate => $PSRF103,04,00,00,01*20


Activate => $PSRF103,05,00,01,01*20

Deactivate => $PSRF103,05,00,00,01*21

Also it is possible to change the frequency of the output, see the GPS module firmware documentation.

This configuration will be lost when the GPS module is powered OFF.

Step 5: Important Issues:

Important Issues:

  • Handle with care the internal antenna. It's fragile.
  • The GPS module should be inside a plastic box, isolated from the environment.
  • The antenna must be in horizontal position.
  • For improving the satellites signal, the antenna has to be in a place with a clear sky view (no trees, no buildings…).
  • Maybe the GPS module takes 2-3 minutes to get signal the firs time.


For more detail: GPS Module for Raspberry Pi Tutorial

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top