Raspberry PI: Connecting a Neo-6M  GPS Module

Neo-6M GPS Module
www.pdf24.org    Send article as PDF   

I built a project using a Neo-6M  GPS Module with the Raspberry PI. Now there are several USB solutions, and apps that work with them, but I wanted to show how to use a $20 GPS module with a a serial UART, and Python code to decode the NMEA strings. Then you can write your own GPS interface, or combine the data with Google Maps.

Hardware Setup:

The first step is to connect the GPS module to the Raspberry PI. There are only 4 wires involved, so it’s a simple connection.

Neo-6M to Raspberry Pi:

  • VCC to Pin 1, which is 3.3v
  • Gnd to Pin 6, which is Gnd
  • RX to Pin 8, Which is TX (GPIO14)
  • TX to Pin 10, which is RX (GPIO15)

Software Setup:

By default, the Raspberry Pi uses the UART as a serial console. We need to turn off that functionality so that we can use the UART for our own application.

Open a terminal session on the Raspberry Pi.

The first thing we will do is backup the file cmdline.txt before we edit it.

sudo cp /boot/cmdline.txt /boot/cmdline_backup.txt and press Enter.

The we need to edit cmdlint.txt and remove the serial interface.

Type in  sudo nano /boot/cmdline.txt and press Enter.

Delete  console=ttyAMA0,115200 and save the file by pressing Ctrl X, Y, and Enter.

Now type in  sudo nano /etc/inittab and press enter.

Find ttyAMA0 by pressing  Ctrl W and typing ttyAMA0 on the search line.

When it finds that line, press  home, insert a  # symbol to comment out that line, and Ctrl X, Y, Enter to save.

Type  sudo reboot and press Enter to restart the Pi.

Testing the GPS:

Before we start writing our own code, let’s test the GPS by using some off the shelf programs.

Open a terminal session and type  sudo apt-get install gpsd gpsd-clients and press Enter.

After that installs, let’s start the serial port:

Type stty -F /dev/ttyAMA0 9600 and press Enter.

Stop the GPS Module: sudo killall gpsd.

Now start GPSD:

Type  sudo gpsd /dev/ttyAMA0 -F /var/run/gpsd.sock and press Enter.

Now display by typing  cgps -s and press Enter.

Neo-6M GPS Module Output

To exit the Display, type Ctrl C.

Previous Post
IR-CUT Camera Module

Streaming Video with the Raspberry Pi Zero W & Pi Camera

I needed a really tiny yet cheap camera so I thought of the Raspberry Pi Camera module. The Version 2 Camera Module does 8MP with good quality, although a 5MP  ... Read more

Next Post
BerryGPS IMU

BerryGPS setup Guide for Raspberry Pi

BerryGPS-IMU v2 Plate has been designed to fit perfectly with the Raspberry Pi Zero. It is also compatible with all other versions Raspberry Pi, including the Pi 3B+. BerryGPS-IMU v2 uses ... Read more

Short URL: http://tinyurl.com/ychfxfe2

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.



Do NOT follow this link or you will be banned from the site!