Cov txheej txheem:
- Khoom siv
- Kauj Ruam 1: Txuas Raspberry Pi Nrog PC
- Kauj Ruam 2: Cov Lus Qhia Luv. Txog UBlox NEO-M8N GPS Module
- Kauj Ruam 3: Interface GPS Module Nrog Raspberry Pi
- Kauj Ruam 4: Teeb UART hauv Raspberry Pi
- Kauj Ruam 5: Lov tes taw Raspberry Pi Serial Getty Service
- Kauj Ruam 6: Qhib Ttys0
- Kauj Ruam 7: Nruab Minicom thiab Pynmea2
- Kauj Ruam 8: Kev Ntsuas Tawm
- Kauj Ruam 9: Sau Python Code
- Kauj Ruam 10: Zaum Kawg
Video: Interfacing GPS Module Nrog Raspberry Pi: 10 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:24
Hlo Guys !! Puas yog koj xav cuam tshuam nrog GPS module nrog Raspberry Pi? Tab sis ntsib qee qhov nyuaj los ua nws? Tsis txhob txhawj, Kuv nyob ntawm no los pab koj! Koj tuaj yeem pib los ntawm kev siv cov hauv qab no:
Khoom siv
- Raspberry Pi 4 Qauv-B nrog 4 GB RAM
- UBlox NEO-M8N GPS Module
- Ib lub Computer
Kauj Ruam 1: Txuas Raspberry Pi Nrog PC
Ua ntej tshaj plaws, txuas koj li Raspberry Pi Board nrog lub PC. Koj tuaj yeem mus ntsib https://www.raspberrypi.org/blog/getting-started-raspberry-pi/ rau cov ntaub ntawv hais txog kev teeb tsa Raspberry Pi Imager.
Kauj Ruam 2: Cov Lus Qhia Luv. Txog UBlox NEO-M8N GPS Module
Nov yog UBlox NEO-M8N GPS Module nrog Ceramic Active Antenna. Qhov GPS Module no muaj 72-channel Ublox M8 cav hauv tus txais. Tus qauv muaj 4 tus pin: VCC (Muab Voltage), GND (Hauv av), Tx (Transmitter), thiab Rx (Txais).
Cov qauv no muab cov NMEA tsis tu ncua (National Marine Electronics Association) cov ntaub ntawv cov hlua rau TX tus pin ua rau GPS cov ntaub ntawv. Txhawm rau paub ntau ntxiv txog tus qauv no, koj tuaj yeem rub nws cov ntaub ntawv ntawm no.
Kauj Ruam 3: Interface GPS Module Nrog Raspberry Pi
Rau kev cuam tshuam, ua cov kev sib txuas raws li hauv qab no:
- Txuas Vcc ntawm GPS module rau Lub Hwj Huam Muab Tus Pin 2 (5V) ntawm Raspberry Pi.
- Txuas Tx (Tus Pin Txuas) ntawm GPS module rau Pin No.10 ntawm Raspberry Pi.
- Txuas GND (Ground Pin) ntawm GPS module rau Pin No.6 Raspberry Pi.
Koj tseem tuaj yeem xaiv lwm tus Raspberry Pi cov laug cam, tab sis nco ntsoov txheeb xyuas tus lej tus lej tsim nyog thaum ua kev sib txuas.
Kauj Ruam 4: Teeb UART hauv Raspberry Pi
Thawj qhov peb yuav ua hauv qab no yog kho cov ntaub ntawv /boot/config.txt. Txhawm rau ua qhov no, khiav cov lus txib hauv qab no:
sudo nano /boot /config.txt
Hauv qab ntawm kab ntawv config.txt, ntxiv cov kab hauv qab no
dtparam = spi = rau
dtoverlay = pi3-disable-bt
core_freq = 250
enable_uart = 1
zog_turbo = 1
ctrl+x kom tawm thiab nias y thiab nkag mus rau txuag.
Kauj ruam thib ob hauv ntu UART teeb tsa ntu no yog kho cov khau raj/cmdline.txt
Kuv yuav qhia koj ua daim ntawv theej ntawm cmdline.txt thiab txuag ua ntej ua ntej kho kom koj tuaj yeem rov qab mus rau nws tom qab yog xav tau. Qhov no tuaj yeem ua tiav siv;
sudo cp khau raj/cmdline.txt khau raj/cmdline_backup.txtsudo nano /boot.cmdline.txt
Hloov cov ntsiab lus nrog;
dwc_otg.lpm_enable = 0 console = tty1 root =/dev/mmcblk0p2 rootfstype = ext4 of elevator = hnub kawg fsck.repair = yog rootwait ntsiag to txaws plymouth.ignore-serial-consoles
Nias ctrl+x kom tawm thiab nias y thiab nkag mus rau txuag.
Tam sim no reboot pi kom pom cov kev hloov pauv
Kauj Ruam 5: Lov tes taw Raspberry Pi Serial Getty Service
a Yog tias hauv koj cov ntawv tso tawm, Serial0 txuas nrog ttyAMA0, tom qab ntawd kom nws tsis siv nws siv cov lus txib hauv qab no,
sudo systemctl nres [email protected] systemctl kaw [email protected]
b. Yog tias hauv koj cov ntawv tso tawm Serial0 txuas nrog ttys0, tom qab ntawd kom nws tsis siv nws siv cov lus txib hauv qab no,
sudo systemctl nres [email protected] systemctl kaw [email protected]
Kauj Ruam 6: Qhib Ttys0
Txhawm rau kom ttyso siv cov lus txib hauv qab no,
sudo systemctl pab [email protected]
Kauj Ruam 7: Nruab Minicom thiab Pynmea2
Siv minicom python lub tsev qiv ntawv los txuas nrog GPS module thiab ua kom paub cov ntaub ntawv.
sudo apt-tau nruab minicom
Siv lub tsev qiv ntawv pynmea2 nab los txhawm rau txheeb xyuas cov ntaub ntawv NMEA tau txais.
sudo pip nruab pynmea2
Kauj Ruam 8: Kev Ntsuas Tawm
Txhawm rau sim GPS khiav cov lus txib sudo cat /dev /ttyAMA0, Koj yuav tau txais cov txiaj ntsig raws li qhia saum toj no.
Kauj Ruam 9: Sau Python Code
Tam sim no, sau tus nab npawb nab npawb rau kev cuam tshuam ntawm GPS module nrog Raspberry pi
ntshuam ntshuam
Ntshuam sij hawm
ntshuam hlua ntshuam ntshuam pynmea2
thaum muaj tseeb: chaw nres nkoj = "/dev/ttyAMAO"
ser = serial. Serial (chaw nres nkoj, baudrate = 9600, sijhawm tas = 0.5)
dataout = pynmea2. NMEAStreamReader ()
newdata = ser.readline ()
yog newdata [0: 6] == "$ GPRMC":
newmsg = pynmea2.parse (cov ntaub ntawv tshiab)
lat = newmsg.latitude
lng = newmsg.longitude
gps = "Latitude =" +str (lat) +"thiab Longitude =" +str (lng)
luam tawm (gps)
Kauj Ruam 10: Zaum Kawg
Lub qhov rais pom saum toj no yog qhov tso tawm zaum kawg. Nws muab cov ntaub ntawv ntawm koj txoj haujlwm tseeb raws li Latitude thiab Longitude.
Txoj haujlwm no yog ua raws kab lus GPS Module nrog Arduino thiab Raspberry Pi - Los ntawm Priyanka Dixit. Mus ntsib kab lus no kom paub ntau ntxiv txog GPS, nws ua haujlwm li cas, piav qhia cov ntsiab lus tseem ceeb ntev & latitude, qhov sib txawv ntawm GPS nti & GPS module, thiab ntau ntxiv!
Pom zoo:
Ntse Buoy [GPS, Xov Tooj Cua (NRF24) thiab SD Card Module]: 5 Kauj Ruam (nrog Duab)
Ntse Buoy [GPS, Xov Tooj Cua (NRF24) thiab SD Card Module]: Qhov Smart Buoy series kab ntawv no peb (mob siab rau) sim tsim lub thawb kev tshawb fawb uas tuaj yeem ntsuas ntsuas lub hiav txwv siv cov khoom lag luam tawm. Nov yog nyeem ob ntawm plaub - xyuas kom tseeb tias koj tau hloov kho tshiab, thiab yog tias koj xav tau nrawm hauv
Arduino GPS Moos Nrog Lub Sijhawm Hauv Zos Siv NEO-6M Module: 9 Kauj Ruam
Arduino GPS Moos Nrog Lub Sijhawm Hauv Zos Siv NEO-6M Module: Hauv qhov kev qhia no peb yuav kawm paub yuav ua li cas thiaj tau txais lub sijhawm tam sim no los ntawm cov hnub qub siv arduino.Watch cov vis dis aus
Interface Arduino Mega Nrog GPS Module (Neo-6M): 8 Kauj Ruam
Interface Arduino Mega Nrog GPS Module (Neo-6M): Hauv qhov haujlwm no, kuv tau qhia yuav ua li cas cuam tshuam GPS module (Neo-6M) nrog Arduino Mega. TinyGPS lub tsev qiv ntawv tau siv los tso saib cov ntaub ntawv ntawm Longitude thiab Latitude thiab TinyGPS ++ yog siv los tso saib Latitude, Longitude, Altitude, Ceev thiab tus naj npawb ntawm satellite
Interfacing Keypad Nrog Arduino. [Txoj hauv kev tshwj xeeb]: 7 Kauj Ruam (nrog Duab)
Interfacing Keypad Nrog Arduino. [Txoj hauv kev tshwj xeeb]: Nyob zoo, thiab zoo siab tos txais kuv thawj qhov kev qhia! :) Hauv cov lus qhia no kuv xav qhia lub tsev qiv ntawv txaus rau cuam tshuam cov keyboard nrog arduino - 'Lub tsev qiv ntawv lo lus zais' suav nrog 'Lub Tsev Qiv Ntawv'. Lub tsev qiv ntawv no suav nrog cov yam ntxwv zoo tshaj plaws uas peb wi
Yuav ua li cas cuam tshuam GPS Module (NEO-6m) Nrog Arduino: 7 Kauj Ruam (nrog Duab)
Yuav ua li cas cuam tshuam GPS Module (NEO-6m) Nrog Arduino: Hauv qhov haujlwm no, kuv tau qhia yuav ua li cas cuam tshuam GPS module nrog Arduino UNO. Cov ntaub ntawv rau qhov ntev thiab txoj kab nruab nrab tau tshwm ntawm LCD thiab qhov chaw tuaj yeem pom ntawm app.List ntawm cov khoom Arduino Uno == > $ 8 Ublox NEO-6m GPS module == > $ 1516x… nyeem ntxiv