Cov txheej txheem:

Txuas VK16E GPS Nrog Arduino UNO: 3 Cov Kauj Ruam
Txuas VK16E GPS Nrog Arduino UNO: 3 Cov Kauj Ruam

Video: Txuas VK16E GPS Nrog Arduino UNO: 3 Cov Kauj Ruam

Video: Txuas VK16E GPS Nrog Arduino UNO: 3 Cov Kauj Ruam
Video: We Launched a Balloon into the Atmosphere 2024, Hlis ntuj nqeg
Anonim
Txuas VK16E GPS Nrog Arduino UNO
Txuas VK16E GPS Nrog Arduino UNO

Nov yog cov lus qhia yooj yim rau cov neeg uas xav paub yuav txuas thiab siv lawv li GPS module nrog Arduino li cas.

Kuv tab tom siv Arduino UNO Shield #Hackduino thiab VK16E GPS module.

rau cov ntaub ntawv ntau ntxiv xa cov ntawv teev npe.

Kauj Ruam 1: Kev Sib Txuas Hauv Circuit

Kev Txuas Hluav Taws Xob
Kev Txuas Hluav Taws Xob

BLACK xaim mus rau Qhov kawg board Gnd txuas

RED xaim mus rau Qhov kawg board 5V txuas

XEEB xaim mus rau Qhov kawg board RxD kev sib txuas

GREEN hlau rau Qhov kawg board TxD kev txuas

WHITE xaim mus rau Qhov kawg board PPS txuas

Raws li peb cov cai

txuas

RXPin ntawm pawg thawj coj saib rau digitalPin 4, TXPin of board to digitalPin 3

Vcc mus rau 5v thiab GND rau GND

Kauj ruam 2: Programming

Ua ntej tshaj plaws koj xav tau yog lub tsev qiv ntawv:

Koj tuaj yeem rub tawm los ntawm no

Tom qab teeb tsa lub tsev qiv ntawv hauv arduino qhib DeviceExample.ino los ntawm cov piv txwv> me meGPS ++

lossis luam cov cai hauv qab no yooj yim.

#suav nrog

#suav nrog

/ * * https://alaspuresujay.github.io/ * ua raws kuv ntawm instagram https://www.instagram.com/alaspuresujay * Cov qauv piv txwv no qhia txog kev siv TinyGPS ++ (TinyGPSPlus) ib txwm muaj. Nws yuav tsum tau siv SoftwareSerial, thiab xav tias koj muaj 9600-baud serial GPS ntaus ntawv txuas ntawm tus pin 4 (rx) thiab 3 (tx). */ static const int RXPin = 4, TXPin = 3; zoo li qub uint32_t GPSBaud = 9600;

// TinyGPS ++ kwv

TinyGPSPlus gps;

// Qhov txuas txuas mus rau GPS ntaus ntawv

SoftwareSerial ss (RXPin, TXPin);

void teeb tsa ()

{Serial.begin (115200); ss.begin (GPSBaud);

Serial.println (F ("DeviceExample.ino"));

Serial.println (F ("Kev qhia yooj yim ntawm TinyGPS ++ nrog txuas nrog GPS module")); Serial.print (F ("Xeem TinyGPS ++ tsev qiv ntawv v.")); Serial.println (TinyGPSPlus:: libraryVersion ()); Serial.println (F ("los ntawm Sujay Alaspure")); Serial.println (); }

void lub voj ()

{// Cov duab kab lus no qhia cov ntaub ntawv txhua txhua lub sijhawm kab lus tshiab raug kho kom raug. thaum (ss.available ()> 0) yog (gps.encode (ss.read ())) displayInfo ();

yog (millis ()> 5000 && gps.charsProcessed () <10) {Serial.println (F ("Tsis muaj GPS kuaj pom: khij kab thaiv.")); thaum (muaj tseeb); }}

tsis muaj dab tsi displayInfo ()

{

ntab latt = gps.location.lat ();

Serial.print (gps.location.lat (), 10); Serial.print (F (",")); Serial.print (gps.location.lng (), 10); Serial.print (""); Serial.print (latt, 10);

Serial.print (F ("Qhov chaw:")); yog (gps.location.isValid ()) {Serial.print (gps.location.lat (), 6); Serial.print (F (",")); Serial.print (gps.location.lng (), 6); } lwm {Serial.print (F ("INVALID")); }

Serial.print (F ("Hnub/Sijhawm:"));

yog (gps.date.isValid ()) {Serial.print (gps.date.month ()); Serial.print (F ("/")); Serial.print (gps.date.day ()); Serial.print (F ("/")); Serial.print (gps.date.year ()); } lwm {Serial.print (F ("INVALID")); }

Serial.print (F (""));

yog (gps.time.isValid ()) {yog (gps.time.hour () <10) Serial.print (F ("0")); Serial.print (gps.time.hour ()); Serial.print (F (":")); yog (gps.time.minute () <10) Serial.print (F ("0")); Serial.print (gps.time.minute ()); Serial.print (F (":")); yog (gps.time.second () <10) Serial.print (F ("0")); Serial.print (gps.time.second ()); Serial.print (F (".")); yog (gps.time.centisecond () <10) Serial.print (F ("0")); Serial.print (gps.time.centisecond ()); } lwm {Serial.print (F ("INVALID")); }

Serial.println ();

}

Kauj ruam 3: Sau ntawv:

Sau ntawv
Sau ntawv
Sau ntawv
Sau ntawv

Thov tso GPS module sab nraum koj lub tsev lossis ntawm lub qhov rais.

  1. Tsis kim GPS modules xws li VK16E tsis muaj qhov qhia tau tseeb 1pps.
  2. Tej zaum koj yuav pom tias zoo li ntau GPS qauv uas siv lub kav hlau txais xov thaj, GPS module yuav xav tau los ntawm lub qhov rais lossis sab nraum. GPS cov cim zoo li sib txawv hauv qhov muaj zog nyob ntawm qhov chaw thiab ib puag ncig cov tuam tsev thiab lwm yam. GPS module kuj tseem yuav tau txais txiaj ntsig los ntawm kev nyob deb dua ntawm Qhov Khoom Siv Qhov kawg, nyob ntawm koj qhov kev teeb tsa shack thiab hauv av. Vim li no koj yuav xav txuas lub GPS module rau hauv cov khoom siv ob peb meters ntawm xaim. Kuv pom zoo kom siv kab ntawv tshuaj ntsuam nrog lub vijtsam txuas nrog Gnd. 4)
  3. Tus Qauv muaj Green LED raws li pom hauv cov duab saum toj no, uas txuas ntxiv ON thaum lub GPS module tab tom nrhiav rau lub xauv xov tooj cua, thiab flashes ntawm 1 mem tes ib pliag thaum xauv.

yuav txheeb xyuas qhov chaw nyob hauv google daim ntawv qhia li cas siv hauv qab no txuas

maps.google.com/?q=, lat-> lattitude

lng-> ntev

Pom zoo: