I-Arduino GPS: yendawo nokuma

I-Arduino GPS

Nge ibhodi lokuthuthukisa I-Arduino ingenza amaphrojekthi amaningi, umkhawulo uvame ukuba umcabango. Ngefayela le- izingxenye zikagesi namamojula, ukusebenza kungangezwa ukuze ukwazi ukwenza izinto eziningi. Okunye kwalokhu kusebenza kungaba yikhono lokukwenza thola izinto noma abantu, noma thola ngokuma nge-Arduino GPS.

Lolu hlobo ukubeka nokulandela kungenziwa kusetshenziswa i-RFID noma abamukelayo njengalena esizoxoxa ngayo kulesi sihloko. Ngalokhu uzokwazi ukudala inqwaba yamaphrojekthi, kusuka emidlalweni yokwakha umtshina nokuthola izinto, ukuthola izinto ezebiwe, ukwazi ukuzitholela usebenzisa i-GPS, njll.

I-Arduino NEO-7 GPS Module

I-NEO-6 GPS Arduino

Ukuze ube ne-Arduino GPS, ungasebenzisa Amadivayisi we-NEO-6, umndeni owenziwe u-U-Blox futhi ongaxhunywa ebhodini le-Arduino ngendlela elula. Ngaphezu kwalokho, banokuxhumana okuphelele, ne-UART, SPI, I2C, kanye ne-USB, ngaphezu kokuxhasa izivumelwano ze-NMEA, UBX kanambambili ne-RTCM.

Ngaphezu kwalokho, le Arduino GPS ene-NEO-6 futhi ikuvumela ukuthi unciphise ubukhulu bephrojekthi yakho, ngoba ine usayizi omncane, kanye nezindleko eziphansi. Mayelana nokusetshenziswa, nayo incane. Uma ikumodi esebenzayo, izodinga kuphela i-37mA. Inikwe amandla yi-2.7 kuya ku-3.6V yezinhlobo ze-NEO-6Q ne-NEO-6M, kuyilapho kukhona ezinye zamandla kagesi aphansi abizwa nge-NEO-6G adinga kuphela phakathi kuka-1.75 no-2v.

Uma zihlanganiswe ku- imodyuli, izofaka i- amandla ombane okuzovumela ukuyinika amandla ngqo kusuka kuxhumano lwe-Arduino 5v.

Eminye imingcele ethokozisayo yale moduli yile:

  • Imizuzwana engama-30 ka- isikhathi sokushisa kubanda, futhi kusekhondi elilodwa kuphela ukuqala okushisayo.
  • La imvamisa yesilinganiso esiphezulu basebenza ngo-5Hz kuphela.
  • Ukunemba kwesikhundla kwamamitha ayi-2.5 wokuhluka.
  • Ukunemba kwejubane 0.1 m / s.
  • Ukuhluka komumo okungu-0.5º kuphela.

Ungathenga kuphi i-NEO-6 ye-Arduino GPS

Ungawathola lawa madivayisi namamojula ezitolo eziningi ezikhethekile ze-elekthronikhi, noma naku-Amazon. Isibonelo, lapha ungakwazi ithenge ngentengo ephansi kakhulu:

Isibonelo no-Arduino

Isithombe se-Arduino IDE

Ungafunda kabanzi ngokuhlela nge-Arduino ngezifundo zamahhala ze-PDF ongazenza landa kusuka lapha.

Into yokuqala okufanele uyenze ukuyixhuma ebhodini lakho lokuthuthuka futhi ube ne-Arduino GPS yakho ukuxhuma imodyuli yakho ye-NEO-6 ebhodini. I- ukuxhumana zenziwe zaba lula kakhulu (ukuxhumana kwe-NEO-6 module - ukuxhumana kwe-Arduino):

  • I-GND - GND
  • I-TX - RX (D4)
  • I-RX - TX (D3)
  • I-Vcc - 5V

Uma usuyixhumile, kuzofanele futhi ukuthi ulande ifayela le- Umtapo wezincwadi weSoftSerial ku-IDE yakho ye-Arduino, njengoba izodingeka ekuxhumaneni nge-serial. Kungenzeka ukuthi usunayo vele kusuka kwamanye amaphrojekthi, kepha uma kungenjalo, kuzofanele ube nayo landa bese ufaka ku-IDE yakho.

Uma lokho sekwenzile, ungaqala ngekhodi yakho elula ukwenza okufundwayo. Isibonelo, njengoba imigomo eminingana ingasetshenziswa, nanku umdwebo ye-NMEA:

#include <SoftwareSerial.h>

const int RX = 4;
const int TX = 3;

SoftwareSerial gps(RX, TX);

void setup()
{
   Serial.begin(115200);
   gps.begin(9600);
}

void loop()
{
   if (gps.available())
   {
      char data;
      data = gps.read();
      Serial.print(data);
   }
}

Vele, ungenza ukuguqulwa kwakho noma usebenzise ezinye izivumelwano uma ufisa ... Ungasebenzisa futhi izibonelo ezitholakalayo ku-IDE yakho yalomtapo wezincwadi. Kepha, ngaphambi kokuqeda i-athikili, kufanele ukwazi lokho ifomethi ye-NMEA (INational Marine Electronics Asociation) icace kakhulu, ukuze uyiqonde, kufanele wazi syntax yayo:

$ GPRMC, hhmmss.ss, A, llll.ll, a, yyyyy, a, vv, xx, ddmmyy, mm, a * hh

Okusho ukuthi, i- $ GPRMC ilandelwa uchungechunge lwe- amapharamitha akhombisa indawo:

  • hhmsib.ss: yisikhathi se-UTC ngamahora, imizuzu namasekhondi.
  • Aisimo somamukeli, lapho i-A = OK ne-V = isexwayiso.
  • llll.ll, ukuze: yi-latitude, lapho u-can kungaba u-N noma u-S, enyakatho noma eningizimu.
  • yyyy.yy, a: ubude. Futhi i-kungaba u-E noma u-W, okungukuthi, empumalanga noma entshonalanga.
  • vv: ijubane ngamafindo.
  • xx: inkambo ngezigaba.
  • nngibhabhi: usuku lwe-UTC, ngezinsuku, izinyanga nonyaka.
  • mm, a: umehluko wamagnetic ngama-degree, kanti i-a ingaba u-E noma u-W empumalanga noma entshonalanga.
  • * H H: I-Checksum noma i-checksum.

Isibonelo, ungathola okuthile okufana nalokhu:

$GPRMC,115446,A,2116.75,N,10310.02,W,000.5,054.7,191194,020.3,E*68


Okuqukethwe yi-athikili kunamathela ezimisweni zethu ze izimiso zokuhlelela. Ukubika iphutha chofoza lapha.

Yiba ngowokuqala ukuphawula

Shiya umbono wakho

Ikheli lakho le ngeke ishicilelwe. Ezidingekayo ibhalwe nge *

*

*

  1. Ubhekele imininingwane: Miguel Ángel Gatón
  2. Inhloso yedatha: Lawula Ugaxekile, ukuphathwa kwamazwana.
  3. Ukusemthethweni: Imvume yakho
  4. Ukuxhumana kwemininingwane: Imininingwane ngeke idluliselwe kubantu besithathu ngaphandle kwesibopho esisemthethweni.
  5. Isitoreji sedatha: Idatabase ebanjwe yi-Occentus Networks (EU)
  6. Amalungelo: Nganoma yisiphi isikhathi ungakhawulela, uthole futhi ususe imininingwane yakho.