How to connect Neo 6M GPS module to Raspberry Pi 3

in #raspberrypi6 years ago

I have been working on a wardriving project and decided to share the whole project on Steemit network. This is the first part which will show how to use Neo 6M GPS module over UART connection.

(Photos are my own)

After testing the module both on raspberries UART and USB Serial Module (CP2102), USB module turned out to be more reliable with less signal losses.

Connecting the module


The module has 5 pin connectors that needed to be soldered in my case. You can find data on the pinout in their official data sheet.

Connect it as following

VCC (Power supply pin)  -> 3.3V / 5V on RPI (GPIO 01/02) / USB module

GND (Ground) -> GND  on RPI (GPIO 06) / USB module

TXD (Data out) -> RXD on RPI (GPIO 10) / USB module

RXD (Data in) -> TXD on RPI (GPIO 08) / USB module

PPS (Pulse per second) is being used for having an accurate clock which is not needed in this case.

After connecting GPS module, RPI can be turned on. Red LED on top of the GPS module will start flickering as a good proof that wiring worked well.
To test out is connection working properly I have ran the following command

sudo cat /dev/ttyUSB0

"ttyUSB0" is subjective, it was 0 in my case because I had no other USB devices connected to RPI. It should start outputting a lot of data which means the connection works flawlessly.


Installing the software


I will install gpsd and all of it's depencies. GPSD is a GPS daemon that reads data from GPS module and makes it available to other software.

sudo apt install gpsd gpsd-client

Download and installation may take a few minutes depending on the SD card speed. Great for a quick coffee break!  Next thing to do was set the baud rate to 9600 which is best option for this serial module.

stty -F /dev/ttyUSB0 9600

Now to start GPS daemon and link the module

sudo gpsd /dev/ttyUSB0 -F /var/run/gpsd.sock

That's about all. Quick 'n easy! Before usage with airodump/kismet, I wanted to check is location assigned properly. After quick googling the best solution was cgps (gps client). 

cgps -s

It took 5 seconds to have fixed position outside while doing the same in doors was almost IMPOSIBLE!