
GPS based Location detection using Raspberry Pi
Call for Price
GPS based Location detection using Raspberry Pi
Description
ABSTRACT
Global Positioning System, which the technology used to find the location. GPS can be interfaced with the Raspberry Pi Serially to get the positioning parameters like Latitude and Longitude. It can be used for automation application like detecting the location of the vehicle or to detect the person by using GPS. Direct serial data obtained from the GPS using Raspberry Pi should be decoded to get an approximate value of Latitude and Longitude. Raspberry Pi which having the GPIO pins for transmitter and receiver in the name of GPIO14 and GPIO15
HARDWARE REQUIRED
- Raspberry Pi
- SD card
- Power supply
- VGA to HDMI converter (Optional)
- Global Positioning System (GPS)
SOFTWARE REQUIRED
- Raspbian Stretch OS
- SD card Formatter
- Win32DiskImager (or) Etcher
PYTHON LIBRARIES USED
- Serial library for enabling serial communication to read the GPS value.
CODE
import serial
port = serial.Serial("/dev/serial0", baudrate=9600, timeout=0.5)
while True:
rcv = port.readline()
rcv = rcv.split()
if ('GPGGA' in rcv[0]):
R = rcv[0].split(',')
try:
lat = float(R[2][:2]) + float(R[2][2:4]) / 60 + float(R[2][4:]) / 3600
long = float(R[4][:3]) + float(R[4][3:5]) / 60 + float(R[4][5:]) / 3600)
print("Latitude")
print(lat)
print("Longitude")
print(long)
except:
pass
Additional information
| Weight | 0.000000 kg |
|---|





Reviews
There are no reviews yet.