GPS hooked up to Raspberry pi - P1

Its been a while that haven't publish anything. I have been using Raspberry Pi for long time since it was released and the old pi hangs around doing nothing. So i thought of  hooking up an GPS to raspberry pi so that viewers out there who has interest in electronics and programming will know how it can be done.

Note: Raspberry Pi inputs or outputs supports 3.3v so the RX and TX pins also support 3.3v. So be careful about handling the voltages with the pi and devices interfacing.

I have a ublox GPS but it supports 5v so i need to do level conversion. If you want to know about level conversion please checkout my YouTube channel or the old blog posts.

First have to disable pi console in order to use the UART. If not it will get terminated. For more information Google for disabling console.

import serial 
gpsport = serial.Serial("/dev/ttyAMA0", baudrate=9600, timeout=0.2)

while True: 
    rxgps = gpsport.readline()
    if len(rxgps) > 10:

The above python script can be used for test whether pi receives serial data from GPS attached. Or you can write your own python script.

Bammm the Raspberry Pi receives the serial data from the GPS and here is a screen capture.

You can see stream of NMEA data flow from the GPS. The most important field to capture is GPGGA string. It will include position data and more. 
Enjoy the hack and play/tweak for more data from other strings.


Popular posts from this blog

Clover Display M302 hack

SIMCOM SIM900A fixed

TCP communication from NEOWAY M590E- Successful