Interfacing GPS Module with Raspberry Pi 3 ๐
Global Positioning System (GPS) modules help us get location data like latitude, longitude, speed, altitude, and more! Let's learn how to connect a GPS module (like NEO-6M) to Raspberry Pi 3 and read real-time location. ๐ฐ️๐ก
๐ง Components Required
Component | Quantity |
---|---|
Raspberry Pi 3 | 1 |
GPS Module (NEO-6M) | 1 |
Jumper Wires | 4 |
USB to TTL Converter (Optional) | 1 |
๐ GPS Module to Pi Connections
GPS Pin | Raspberry Pi Pin | Pin Number |
---|---|---|
VCC | 3.3V / 5V | Pin 1 or 4 |
GND | Ground | Pin 6 |
TX | GPIO15 (RXD) | Pin 10 |
RX | GPIO14 (TXD) | Pin 8 |

Figure: GPS Module connected to Raspberry Pi 3
⚙️ Enable Serial Interface
- Run:
sudo raspi-config
- Go to Interfacing Options > Serial
- Disable shell access over serial and enable serial hardware
- Reboot your Raspberry Pi
๐ฆ Install Required Packages
sudo apt update
sudo apt install gpsd gpsd-clients python3-gps
๐ฐ️ Python Code to Read GPS Data
import gps
session = gps.gps(mode=gps.WATCH_ENABLE)
try:
while True:
report = session.next()
if report['class'] == 'TPV':
if hasattr(report, 'lat') and hasattr(report, 'lon'):
print(f"Latitude: {report.lat}, Longitude: {report.lon}")
except KeyboardInterrupt:
print("Stopped")
๐ Summary
With this setup, your Raspberry Pi becomes a GPS tracker capable of logging and transmitting real-time position. Great for vehicle tracking, IoT, and outdoor robotics! ๐๐
Raspberry Pi 3 เคธोเคฌเคค GPS เคฎॉเคก्เคฏूเคฒ เคเคธे เคोเคกाเคฏเคे ๐ (เคฎเคฐाเค ी)
GPS (Global Positioning System) เคฎॉเคก्เคฏूเคฒ เคตाเคชเคฐूเคจ เคเคชเคฃ เค เค्เคทांเคถ, เคฐेเคांเคถ, เคเคคी, เคंเคी เคเคค्เคฏाเคฆी เคฎाเคนिเคคी เคฎिเคณเคตू เคถเคเคคो. เคเคฒा Raspberry Pi 3 เคเคฃि GPS เคฎॉเคก्เคฏूเคฒ (NEO-6M) เคฏांเคे เคंเคเคฐเคซेเคธिंเค เคถिเคूเคฏा! ๐ก
๐ง เคฒाเคเคฃाเคฐे เคธाเคนिเคค्เคฏ
เคธाเคนिเคค्เคฏ | เคช्เคฐเคฎाเคฃ |
---|---|
Raspberry Pi 3 | 1 |
GPS เคฎॉเคก्เคฏूเคฒ (NEO-6M) | 1 |
เคंเคชเคฐ เคตाเคฏเคฐ | 4 |
USB to TTL เคเคจ्เคต्เคนเคฐ्เคเคฐ (เคชเคฐ्เคฏाเคฏी) | 1 |
๐ เคชिเคจ เคเคจेเค्เคถเคจ
GPS เคชिเคจ | Raspberry Pi เคชिเคจ | เคชिเคจ เค्เคฐเคฎांเค |
---|---|---|
VCC | 3.3V / 5V | เคชिเคจ 1 เคिंเคตा 4 |
GND | GND | เคชिเคจ 6 |
TX | GPIO15 (RXD) | เคชिเคจ 10 |
RX | GPIO14 (TXD) | เคชिเคจ 8 |
⚙️ Serial เคธुเคฐू เคเคฐเคฃे
- เคเคฐ्เคฎिเคจเคฒเคฎเคง्เคฏे เคाเคฒเคตा:
sudo raspi-config
- Interfacing Options > Serial เคฏेเคฅे เคा
- Serial login disable เคเคฐा เคเคฃि Serial เคนाเคฐ्เคกเคตेเค เคฐ enable เคเคฐा
- Raspberry Pi เคชुเคจ्เคนा เคธुเคฐू เคเคฐा
๐ฆ เคเคตเคถ्เคฏเค เคชॅเคेเคेเคธ เคंเคธ्เคॉเคฒ เคเคฐा
sudo apt update
sudo apt install gpsd gpsd-clients python3-gps
๐ป Python เคोเคก
เคाเคฒीเคฒ เคोเคก เคตाเคชเคฐूเคจ GPS เคกेเคा เคตाเคा:
# เคตเคฐीเคฒ เคंเค्เคฐเคी เคोเคก เคตाเคชเคฐू เคถเคเคคा
๐ เคธाเคฐांเคถ
เคฏा เคช्เคฐोเคेเค्เคเคจे Raspberry Pi เคเค GPS เค्เคฐॅเคเคฐ เคฌเคจเคคो, เคो เคाเคกीเคธाเค ी เค्เคฐॅเคिंเค, IoT เคกिเคต्เคนाเคเคธेเคธ เคเคฃि เคฎैเคฆाเคจी เคฐोเคฌोเคिเค्เคธเคธाเค ी เคเคชเคฏुเค्เคค เคเคนे! ๐ฐ️
Comments