Cov txheej txheem:

GPS Tracker: 6 Kauj Ruam
GPS Tracker: 6 Kauj Ruam

Video: GPS Tracker: 6 Kauj Ruam

Video: GPS Tracker: 6 Kauj Ruam
Video: Смарт-Часы Maimo Watch - Детальный ОБЗОР + ТЕСТЫ 2024, Kaum ib hlis
Anonim
GPS taug qab
GPS taug qab

Hav Guys hauv daim vis dis aus no peb yuav ua GPS tracker siv Esp 8266 (nodemcu) thiab neo 6m GPS module yog li cia peb pib

Khoom siv:

NodemcuJumpersNeo 6m GPS module Lub txhab nyiaj fais fab

Kauj ruam 1: Kev thaiv kab

Thaiv
Thaiv

Txuas RX tus pin ntawm GPS module rau D1 tus pin ntawm nodemcu boardTX tus pin ntawm GPS module rau D2 tus pin ntawm nodemcuVcc tus pin rau 3.3voltsGnd tus pin rau Gnd

Kauj ruam 2: Blynk Iot App

Blynk Iot App Cov
Blynk Iot App Cov

Nruab blynk app https://play.google.com/store/apps/details?id=cc.blynk&hl=en_US Ntxiv 2 daim ntawv lo tus nqi tso saib thiab npe 1 tus nqi raws li Latitude thiab xaiv tus pin v1And npe tus nqi thib ob li Longitude thiab xaiv tus pin v2And tam sim no ntxiv 3 tus nqi zaub thiab npe thawj tus raws li satellite thiab xaiv tus pin v4And tam sim no lub npe thib ob raws li nrawm thiab xaiv tus pin v3And tam sim no lub npe thib 3 raws li Qhia thiab xaiv tus pin v5And tam sim no ntxiv daim ntawv qhia thiab xaiv tus pin v0 Thiab tam sim no xaiv thawb rau 1 thib ob rau txhua tus widget thiab tsim nws

Kauj ruam 3: Code

Code
Code

Ib daim ntawv lees paub yuav raug xa mus rau koj tus email account luam cov cim thiab muab nws tso rau hauv cov cai thiab tseem kho thiab sau koj li WiFi ssid thiab tus lej nkag mus rau tus lej thiab muab tso rau nws !! Tus lej yog // Lub Sijhawm Sijhawm GPS Tracker nrog Nodemcu ESP8266#suav nrog #include #define BLYNK_PRINT Serial #suav nrog #include static const int RXPin = 4, TXPin = 5; // GPIO 4 = D2 (sib txuas Tx ntawm GPS) thiab GPIO 5 = D1 (Txuas Rx ntawm GPSstatic const uint32_t GPSBaud = 9600; // yog tias Baud tus nqi 9600 tsis ua haujlwm hauv koj rooj plaub ces siv 4800TinyGPSPlus gps; // Tus TinyGPS ++ objectWidgetMap myMap (V0); // V0 rau tus lej virtual ntawm Daim Ntawv Qhia WidgetSoftwareSerial ss (RXPin, TXPin); // Qhov txuas txuas mus rau GPS ntaus ntawv tsis muaj. ntawm satellites teb Txoj hlua kab; // Hloov pauv los khaws kev taw qhia lossis kev taw qhia ntawm GPSchar auth = "--------------------"; // Koj Qhov Project authentication keychar ssid = "-------"; // Lub npe ntawm koj lub network (HotSpot lossis Router lub npe) char pass = "-------"; // Tus lej zais sib xws // tsis tau kos npe rau hauv move_index; // txav qhov ntsuas, yuav siv tom qab tsis tau kos npe rau int move_index = 1; // qhov chaw ruaj khov rau tam sim no tsis muaj teeb tsa () {Serial.begin (115200); Serial.println (); ss.begin (GPSBaud); Blynk.begin (auth, ssid, dhau); timer.setInterval (5000L, checkGPS); // txhua 5 zaug xyuas yog tias GPS txuas nrog, tsuas yog yuav tsum tau ua ib zaug} void checkGPS () {if (gps.charsProcessed () <10) {Serial.println (F ("Tsis muaj GPS kuaj pom: khij kab thaiv.")); Blynk.virtualWrite (V4, "GPS yuam kev"); // Tus Nqi Zaub widget ntawm V4 yog tias GPS tsis pom}} void loop () {thaum (ss.available ()> 0) {// kos duab qhia cov ntaub ntawv txhua lub sij hawm cov kab lus tshiab raug kho kom raug. yog (gps.encode (ss.read ())) displayInfo (); } Blynk.run (); timer.run ();} void displayInfo () {if (gps.location.isValid ()) {ntab latitude = (gps.location.lat ()); // Khaws qhov Lat. thiab Lon. ntab ntog = (gps.location.lng ()); Serial.print ("LAT:"); Serial.println (latitude, 6); // ntab rau x qhov chaw zauv zauv Serial.print ("LONG:"); Serial.println (ntev, 6); Blynk.virtualWrite (V1, Txoj hlua (latitude, 6)); Blynk.virtualWrite (V2, Txoj hlua (ntev, 6)); myMap.location (txav_index, latitude, longitude, "GPS_Location"); spd = gps.speed.kmph (); // tau txais nrawm Blynk.virtualWrite (V3, spd); sats = gps.satellites.value (); // tau txais tus lej ntawm satellites Blynk.virtualWrite (V4, sats); bearing = TinyGPSPlus:: cardinal (gps.course.value ()); // tau txais kev taw qhia Blynk.virtualWrite (V5, kev coj tus kheej); } Serial.println ();}

Kauj ruam 4: Kev nthuav qhia

Kev nthuav qhia
Kev nthuav qhia
Kev nthuav qhia
Kev nthuav qhia

Siv lub npov khoob tso tag nrho cov kab ke rau nws thiab tam sim no txuas lub powerbank rau Nodemcu board

Kauj ruam 5:

Duab
Duab

Txhua yam ua tiav !!

Kauj Ruam 6:

Pom zoo: