hamradioshop.ro
Articole > Software pentru radioamatori Litere mici Litere medii Litere mari     Comentati acest articol    Tipariti

QTH locator cu ESP32 DevKit si NEO6GPS

Doru Sandu ex. YO9CXY

Dupa cum s-ar putea sa va mai aduceti aminte, radioamatorii anilor ’80 din RO au avut mari probleme si discutii cu identificarea locatiei corecte folosind harti cu precizie indoielnica sau deadreptul gresit tiparite. Astazi, si cel mai ieftin telefon mobil (nu tocmai!) poate incarca un soft de tipul “QTH locator”, fiind capabil sa stabileasca locatia statiei cu o precizie foarte buna. Poate si unele transceivere au incorporate astfel de facilitati, numai ca celor care inca mai au indemanarea sa construiasca le propun un aparat simplu si de ajutor la un pret de cateva zeci de lei.

Consultand internetul, am fost placut surprins de articolul “How to Make Pocket GPS with GPS Neo-6M and ESP32” publicat de CiferTech in data de 2 January 2023.

Toate amanuntele acestui articol le puteti gasi la adresa https://github.com/cifertech/Pocket-GPS

Plecand de la acest exemplu, am incercat sa modific si sa imbunatatesc dispozitivul cu noi facilitati.

Asa ca va propun din nou sa folosim mikrocontrollerul ESP32, un display ILI9341-SPI si un modul NEO-6-GPS. Ca sursa de alimentare putem folosi orice alimentator, baterie sau acumulator de 5V. Din punct de vedere hardware totul se reduce la conectarea sursei de alimentare si a portului serial Rx/Tx – pini (16 si 17) disponubil intre microcontroller si modulul GPS.

Atentie! Modulul NEO-6-GPS se alimenteaza la tensiunea stabilizata de 3,3V a mikrocontrollerului.

Alte module pot avea optiuni diferite. Folosirea altor tensiuni de alimrntare poate distruge GPS-ul.

Eventuala incasetare se face cu evitarea componentelor metalice care ar putea ecrana antena.

  

 

Pin connection for the ILI9341 display/2.8inch SPY

TFT_CS    = 5;          // Pin-29 ESP32 "VSPISS" (GPIO 05)

TFT_DC    = 21;       // PIN-33 ESP32 "I2CSDA" (GPIO 21)

TFT_MOSI  = 23;    // MOSI---> ESP32 pin 37 "VSPIMOSI" (GPIO 23)

TFT_SCK   = 18;      // SCLK---> ESP32 pin 30 "VSPISCK"  (GPIO 18)

TFT_Vcc + RST + LED   = -1;       // Connected to +Vcc (1K/5V) or directly 3V3

Softul este usor de inteles si de modificat pentru alte aplicatii. Chiar mi-ar face placere sa aflu ideile dumneavoastra sau propuneri pentru noi dispositive utile .

Nu ramane decat sa copiati progranul asa cum este, sa-l salvati cu extensia “.ino” in compilatorul Arduino IDE de unde cu pregatirile necesare sa fie incarcat in microcontroller.

Antetul contine cateva informatii utile si explica precizia masuratorilor calculate cu 6, 8 sau 10 caractere. De asemeni, in continutul programului observati un buton “#define BUTTON_PIN 12”, care pe moment nu este folosit dar care impreuna cu un modul GSM poate salva vieti in caz de urgenta. Acesta va face obiectul unui upgrade intr-o perioada cat se poate de scurta.

 

 

/*

Software inspired by "Free Software Foundation, Inc. https://fsf.org/ *Copyright (C) 2007* The Free Software Foundation (FSF) is a nonprofit organization with mission to promote the freedom of computer users".

The changes made by ex.YO9CXY are in accordance with the map published by:

https://www.egloff.eu/qralocator/

The calculation ensures the following degrees of precision:

- 6 characters, approximately an area of ​​3 x 4 km

- 8 characters, approximately 150 x 250 m

- 10 characters, approximately 5 x 7 m

The software is non-commercial, personal use is permitted only within the limits imposed by copyright law. For comments you can contact me at: gocomraex@gmail.com

*/

 

// Libraries

#include <TinyGPS++.h>

TinyGPSPlus gps;                // The TinyGPS++ object

 

#include <HardwareSerial.h>

HardwareSerial neogps(1);

#define RXD2 16

#define TXD2 17

 

#include <TFT_eSPI.h>           // Include the graphics library

TFT_eSPI tft = TFT_eSPI();      // Create object "tft" 

 

#define BUTTON_PIN 12           // For further development

bool buttonPressed = false;

bool buttonEnabled = true;

// ************************************************************ //

 

const unsigned char boot[] PROGMEM =

{

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xc0, 0x00, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xc0, 0x00, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3d, 0xe0, 0x00, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x78, 0x00, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x78, 0x00, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xe0, 0x3e, 0x00, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xf0, 0x7e, 0x00, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xf9, 0xf7, 0x00, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x3f, 0xc7, 0xc0, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x0f, 0xc1, 0xc0, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x0f, 0x83, 0xf0, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x0f, 0x87, 0xf0, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x3f, 0xcf, 0x7c, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xef, 0x3c, 0xfe, 0x1c, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xc7, 0xf0, 0xfc, 0x0f, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x83, 0xf0, 0x78, 0x0f, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x01, 0xe0, 0xfc, 0x1e, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x87, 0xf1, 0xee, 0x3c, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xc7, 0xff, 0xcf, 0xf8, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x79, 0xfe, 0x3f, 0x83, 0xf0, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xfe, 0x1f, 0x03, 0xe0, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xe0, 0x78, 0x1f, 0x03, 0xc0, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xe0, 0xfc, 0x3f, 0x87, 0x80, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xf0, 0xfe, 0x79, 0xcf, 0x00, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x7b, 0xcf, 0xf1, 0xfe, 0x00, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x3f, 0x87, 0xe0, 0xfc, 0x00, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x3c, 0x1f, 0x03, 0xc0, 0x78, 0x00, 0x00,

0x00, 0x00, 0x00, 0x00, 0x01, 0x9c, 0x78, 0x1f, 0x07, 0xe0, 0xf0, 0x00, 0x00,

0x00, 0x00, 0x00, 0x00, 0x03, 0xfe, 0x7c, 0x3f, 0x8f, 0xf1, 0xe0, 0x00, 0x00,

0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0x1e, 0x3b, 0xde, 0x7b, 0xc0, 0x00, 0x00,

0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0x8e, 0xf1, 0xfc, 0x3f, 0x80, 0x00, 0x00,

0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xcf, 0xe0, 0xf8, 0x1f, 0x00, 0x00, 0x00,

0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xe3, 0xc0, 0xf8, 0x1e, 0x00, 0x00, 0x00,

0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xf1, 0xe1, 0xfc, 0x3c, 0x00, 0x00, 0x00,

0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf9, 0xf3, 0xde, 0x78, 0x00, 0x00, 0x00,

0x00, 0x00, 0x00, 0x01, 0xff, 0xff, 0xfc, 0x7f, 0x8f, 0xf0, 0x00, 0x00, 0x00,

0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xfe, 0x3f, 0x07, 0xe0, 0x00, 0x00, 0x00,

0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0x1e, 0x03, 0xc0, 0x00, 0x00, 0x00,

0x00, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0x9f, 0x07, 0x80, 0x00, 0x00, 0x00,

0x00, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xc7, 0x8f, 0x00, 0x00, 0x00, 0x00,

0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0xe3, 0xde, 0x00, 0x00, 0x00, 0x00,

0x00, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xf1, 0xfc, 0x00, 0x00, 0x00, 0x00,

0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0xf8, 0xf8, 0x00, 0x00, 0x00, 0x00,

0x00, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xfe, 0x70, 0x00, 0x00, 0x00, 0x00,

0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xfe, 0x20, 0x00, 0x00, 0x00, 0x00,

0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,

0x00, 0x00, 0x00, 0x02, 0x3f, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00,

0x00, 0x00, 0x00, 0x07, 0x9f, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00,

0x00, 0x00, 0x00, 0x0f, 0x8f, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00,

0x00, 0x00, 0x00, 0x1f, 0xe7, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x00,

0x00, 0x00, 0x00, 0x3d, 0xe3, 0xff, 0xff, 0xff, 0xf0, 0x5e, 0x80, 0x00, 0x00,

0x00, 0x00, 0x00, 0x78, 0xf1, 0xff, 0xff, 0xff, 0xc7, 0xff, 0x00, 0x00, 0x00,

0x00, 0x00, 0x00, 0xf0, 0x3c, 0xff, 0xff, 0xff, 0x1f, 0xfc, 0x70, 0x00, 0x00,

0x00, 0x00, 0x03, 0xe0, 0x7c, 0x7f, 0xff, 0xfe, 0x7f, 0xf8, 0xf0, 0x00, 0x00,

0x00, 0x00, 0x03, 0xf0, 0x7f, 0x3f, 0xff, 0xf8, 0xff, 0xf3, 0xe0, 0x00, 0x00,

0x00, 0x00, 0x07, 0xf9, 0xef, 0x1f, 0xff, 0xf3, 0xff, 0xc7, 0xc0, 0x00, 0x00,

0x00, 0x00, 0x0f, 0x3f, 0xc7, 0xcf, 0xff, 0xe7, 0xff, 0x8f, 0xc0, 0x00, 0x00,

0x00, 0x00, 0x1e, 0x1f, 0x83, 0xc7, 0xff, 0xcf, 0xff, 0x3f, 0x80, 0x00, 0x00,

0x00, 0x00, 0x7c, 0x0f, 0x03, 0xe3, 0xff, 0x9f, 0xfe, 0x3f, 0x00, 0x00, 0x00,

0x00, 0x00, 0x7c, 0x0f, 0x87, 0xf9, 0xff, 0xbf, 0xfc, 0xfe, 0x00, 0x00, 0x00,

0x00, 0x00, 0xfe, 0x1f, 0xcf, 0x38, 0xff, 0x3f, 0xf8, 0xfe, 0x00, 0x00, 0x00,

0x00, 0x01, 0xef, 0x39, 0xfe, 0x3e, 0x7e, 0x7f, 0xe3, 0xfc, 0x00, 0x00, 0x00,

0x00, 0x07, 0xc7, 0xf8, 0xfc, 0x1e, 0x3e, 0xff, 0xe7, 0xf8, 0x00, 0x00, 0x00,

0x00, 0x07, 0x83, 0xe0, 0x78, 0x0f, 0x1c, 0xff, 0x83, 0xf0, 0x00, 0x00, 0x00,

0x00, 0x0f, 0x01, 0xe0, 0xfc, 0x1e, 0x0d, 0xff, 0x83, 0xe0, 0x00, 0x00, 0x00,

0x00, 0x3f, 0x83, 0xf1, 0xfe, 0x3c, 0x01, 0xff, 0x01, 0xc0, 0x00, 0x00, 0x00,

0x00, 0x3f, 0x8f, 0xfb, 0xcf, 0xf8, 0x01, 0xfe, 0x40, 0x80, 0x00, 0x00, 0x00,

0x00, 0x79, 0xee, 0x3f, 0x87, 0xf0, 0x03, 0xfc, 0x70, 0x00, 0x00, 0x00, 0x00,

0x01, 0xf0, 0xfc, 0x1f, 0x03, 0xe0, 0x03, 0xf9, 0xf8, 0x40, 0x00, 0x00, 0x00,

0x01, 0xc0, 0x7c, 0x1f, 0x03, 0xc0, 0x03, 0xf1, 0xfc, 0xf0, 0x00, 0x00, 0x00,

0x03, 0xe0, 0xfc, 0x3f, 0x87, 0x00, 0x07, 0xe7, 0xf9, 0xf8, 0x00, 0x00, 0x00,

0x0f, 0xe0, 0xfe, 0x7b, 0xcf, 0x00, 0x03, 0xc7, 0xf0, 0xf8, 0x0e, 0x00, 0x00,

0x0f, 0x7b, 0xcf, 0xf1, 0xfe, 0x00, 0x07, 0xcf, 0xe0, 0xfc, 0x1e, 0x10, 0x00,

0x1c, 0x3f, 0x87, 0xe0, 0xfc, 0x00, 0x07, 0x9f, 0xc0, 0x3c, 0x0e, 0x38, 0x00,

0x3c, 0x1f, 0x03, 0xc0, 0x78, 0x00, 0x07, 0x3f, 0x80, 0x38, 0x1e, 0x38, 0x00,

0xf8, 0x1f, 0x07, 0xe0, 0xf0, 0x00, 0x02, 0x7f, 0x00, 0x00, 0x1e, 0x3c, 0xe0,

0x38, 0x3f, 0x0f, 0xf1, 0xe0, 0x00, 0x06, 0x7e, 0x00, 0x00, 0x3c, 0x78, 0xf0,

0x3e, 0x7b, 0xde, 0x77, 0xc0, 0x00, 0x04, 0xf8, 0x00, 0x00, 0x3c, 0x38, 0xf0,

0x0e, 0xf3, 0xfc, 0x3f, 0x80, 0x00, 0x00, 0xf0, 0x00, 0x00, 0xf8, 0x78, 0xf0,

0x0f, 0xe0, 0xf8, 0x1e, 0x00, 0x00, 0x01, 0xc0, 0x00, 0x01, 0xf8, 0xf9, 0xe0,

0x03, 0xc0, 0xf8, 0x1e, 0x00, 0x00, 0x01, 0x80, 0x00, 0x1f, 0xf0, 0xf0, 0xe0,

0x01, 0xc1, 0xf8, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xc1, 0xf1, 0xe0,

0x01, 0xf3, 0xde, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x81, 0xe1, 0xe0,

0x00, 0x77, 0x9f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x07, 0xc3, 0xc0,

0x00, 0x3f, 0x07, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xc3, 0xc0,

0x00, 0x3e, 0x07, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x07, 0x80,

0x00, 0x0f, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0x0f, 0x80,

0x00, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xfc, 0x0f, 0x00,

0x00, 0x03, 0xbe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xf0, 0x3e, 0x00,

0x00, 0x01, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xc0, 0x7c, 0x00,

0x00, 0x01, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x00,

0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xf0, 0x00,

0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x5f, 0xe0, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xc0, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0x00, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xf8, 0x00, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00

};

// ****************************** //

 

const unsigned char cloud[] PROGMEM =

{

  B00000000,B00000111,B10000000,B00000000,

  B00000000,B00011111,B11100000,B00000000,

  B00000000,B01111111,B11111000,B00000000,

  B00000000,B11111111,B11111100,B00000000,

  B00000001,B11111100,B11111110,B00000000,

  B00000011,B11110000,B00111111,B00000000,

  B00000011,B11100000,B00011111,B00000000,

  B00000011,B11000000,B00001111,B00000000,

  B00000111,B11000000,B00001111,B10000000,

  B00000111,B10000000,B00000111,B10000000,

  B00000111,B10000000,B00000111,B10000000,

  B00000111,B10000000,B00001111,B10000000,

  B00000111,B11000000,B00001111,B00000000,

  B00000011,B11100000,B00011111,B00000000,

  B00000011,B11110000,B00111111,B00000000,

  B00000001,B11111100,B11111110,B00000000,

  B00000001,B11111111,B11111110,B00000000,

  B00000000,B11111111,B11111100,B00000000,

  B00000000,B11111111,B11111100,B00000000,

  B00000000,B01111111,B11111000,B00000000,

  B00000000,B01111111,B11110000,B00000000,

  B00000000,B00111111,B11110000,B00000000,

  B00000000,B00111111,B11100000,B00000000,

  B00000000,B00011111,B11000000,B00000000,

  B00000000,B00001111,B11000000,B00000000,

  B00000000,B00001111,B10000000,B00000000,

  B00000000,B00000111,B10000000,B00000000,

  B00000000,B00000111,B00000000,B00000000,

  B00000000,B00000010,B00000000,B00000000,

  B00000000,B00000000,B00000000,B00000000

};

// ****************************** //

 

const unsigned char speed[] PROGMEM =

{

  B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,

  B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,

  B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,

  B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,

  B00000000,B00000000,B00001111,B11111100,B00000000,B00000000,B00000000,

  B00000000,B00000000,B01111111,B11111111,B10000000,B00000000,B00000000,

  B00000000,B00000001,B11111000,B11000111,B11100000,B00000000,B00000000,

  B00000000,B00000111,B10000000,B11000000,B01111000,B00000000,B00000000,

  B00000000,B00011111,B00000000,B11000000,B00111110,B00000000,B00000000,

  B00000000,B00111111,B00000000,B00000000,B00111111,B00000000,B00000000,

  B00000000,B01110011,B00000000,B00000000,B00110011,B10000000,B00000000,

  B00000000,B11100001,B00000000,B00000000,B00100001,B11000000,B00000000,

  B00000001,B11000000,B00000000,B00000000,B00000000,B11100000,B00000000,

  B00000011,B10000000,B00000000,B00000000,B00000000,B01110000,B00000000,

  B00000011,B00000000,B00000000,B00000000,B00000000,B00110000,B00000000,

  B00000111,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,

  B00000111,B10000000,B00000000,B00000000,B00000000,B01111000,B00000000,

  B00001111,B11000000,B00000000,B00000000,B00000000,B11111100,B00000000,

  B00001100,B00000000,B00000000,B00000000,B00000000,B00001100,B00000000,

  B00011000,B00000000,B00000000,B00000000,B00000100,B00000110,B00000000,

  B00011000,B00000000,B00000000,B00000000,B00111000,B00000110,B00000000,

  B00011000,B00000000,B00000000,B00000001,B11110000,B00000110,B00000000,

  B00111000,B00000000,B00000001,B11100111,B11100000,B00000111,B00000000,

  B00110000,B00000000,B00000111,B11111111,B11000000,B00000011,B00000000,

  B00110000,B00000000,B00000110,B00011111,B10000000,B00000011,B00000000,

  B00110000,B00000000,B00001100,B00001111,B00000000,B00000011,B00000000,

  B00111110,B00000000,B00001100,B00001100,B00000000,B00011111,B00000000,

  B00111110,B00000000,B00001100,B00001100,B00000000,B00011111,B00000000,

  B00110000,B00000000,B00001100,B00001100,B00000000,B00000011,B00000000,

  B00110000,B00000000,B00000110,B00011000,B00000000,B00000011,B00000000,

  B00110000,B00000000,B00000111,B11111000,B00000000,B00000011,B00000000,

  B00111000,B00000000,B00000001,B11100000,B00000000,B00000111,B00000000,

  B00011000,B00000000,B00000000,B00000000,B00000000,B00000110,B00000000,

  B00011000,B00000000,B00000000,B00000000,B00000000,B00000110,B00000000,

  B00011000,B00000000,B00000000,B00000000,B00000000,B00000110,B00000000,

  B00001100,B00000000,B00000000,B00000000,B00000000,B00001100,B00000000,

  B00001111,B11000000,B00000000,B00000000,B00000000,B11111100,B00000000,

  B00000111,B10000000,B00000000,B00000000,B00000000,B01111000,B00000000,

  B00000111,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,

  B00000011,B00000000,B00000000,B00000000,B00000000,B00110000,B00000000,

  B00000011,B00000011,B11111111,B11111111,B11110000,B00110000,B00000000,

  B00000000,B00000011,B11111111,B11111111,B11110000,B00000000,B00000000,

  B00000000,B00000011,B00000000,B00000000,B00110000,B00000000,B00000000,

  B00000000,B00000011,B00000000,B00000000,B00110000,B00000000,B00000000,

  B00000000,B00000011,B11111111,B11111111,B11110000,B00000000,B00000000,

  B00000000,B00000011,B11111111,B11111111,B11110000,B00000000,B00000000,

  B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,

  B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,

  B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,

  B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000 

};

// ****************************** //

 

const unsigned char satellite[] PROGMEM =

{

  B00000000,B00000000,B00000001,B10000000,B00000000,B00000000,B00000000,

  B00000000,B00000000,B00000011,B11000000,B00000000,B00000000,B00000000,

  B00000000,B00000000,B00000111,B11100000,B00000000,B00000000,B00000000,

  B00000000,B00000000,B00001110,B01110000,B00000000,B00000000,B00000000,

  B00000000,B00000000,B00011100,B00111000,B00000000,B00000000,B00000000,

  B00000000,B00000000,B00111000,B00011000,B11111000,B00000000,B00000000,

  B00000000,B00000000,B01110000,B00001001,B11111100,B00000000,B00000000,

  B00000000,B00000000,B11100000,B00000011,B10001110,B00000000,B00000000,

  B00000000,B00000001,B11000000,B00000111,B00000111,B00000000,B00000000,

  B00000000,B00000001,B11000000,B00001110,B00000011,B10000000,B00000000,

  B00000000,B00000000,B11100000,B00011100,B00000001,B11000000,B00000000,

  B00000000,B00000000,B01110000,B00111000,B00000000,B11100000,B00000000,

  B00000000,B00000000,B00111000,B01110000,B00000000,B01110000,B00000000,

  B00000000,B00000000,B00011100,B11100000,B00000000,B00111000,B00000000,

  B00000000,B00000000,B00001001,B11000000,B00000000,B00011000,B00000000,

  B00000000,B00000000,B00000011,B10000000,B00000000,B00011000,B00000000,

  B00000000,B00000000,B00000111,B00000000,B00000000,B00011000,B00000000,

  B00000000,B00000000,B00001110,B00000000,B00000000,B00111000,B00000000,

  B00000000,B00000000,B00001100,B00000000,B00000000,B01110000,B00000000,

  B00000000,B00000000,B00001110,B00000000,B00000000,B11100000,B00000000,

  B00000000,B00000000,B00011111,B00000000,B00000001,B11000000,B00000000,

  B00000000,B00000000,B01111111,B10000000,B00000011,B10011100,B00000000,

  B00000000,B00000000,B11110111,B11000000,B00000111,B00001110,B00000000,

  B00000000,B00000000,B01110000,B11100000,B00001110,B00000111,B00000000,

  B00000000,B00000000,B00111000,B01110000,B00011100,B00000011,B10000000,

  B00000000,B00000000,B00011100,B00111000,B00111000,B00000001,B11000000,

  B00000000,B00000000,B00011110,B00011100,B01110000,B00000001,B11000000,

  B00000000,B00000000,B00011111,B00011110,B11100000,B00000011,B10000000,

  B00000000,B00000000,B00011111,B10011111,B11001000,B00000111,B00000000,

  B00000000,B00000000,B00001111,B11001111,B10011100,B00001110,B00000000,

  B00000000,B00000000,B00000111,B11111100,B00001110,B00011100,B00000000,

  B00000000,B00000000,B00000000,B01111000,B00000111,B00111000,B00000000,

  B00000000,B00000000,B00000000,B00111000,B00000011,B11110000,B00000000,

  B00000000,B00000000,B00000000,B00010000,B00000001,B11100000,B00000000,

  B00000000,B00000000,B00000000,B00000000,B00000000,B11000000,B00000000,

  B11000000,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,

  B11000001,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,

  B11000000,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,

  B11000000,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,

  B11100000,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,

  B01100000,B01111000,B00000000,B00000000,B00000000,B00000000,B00000000,

  B01100000,B00111110,B00000000,B00000000,B00000000,B00000000,B00000000,

  B00110000,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,

  B00111000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,

  B00011100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,

  B00001110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,

  B00000111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,

  B00000011,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,

  B00000000,B11111110,B00000000,B00000000,B00000000,B00000000,B00000000,

  B00000000,B00111110,B00000000,B00000000,B00000000,B00000000,B00000000 

};

// ****************************** //

 

const unsigned char alt[] PROGMEM =

{

  B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,

  B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,

  B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,

  B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,

  B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,

  B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,

  B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,

  B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,

  B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,

  B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,

  B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,

  B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,

  B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,

  B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,

  B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,

  B00000000,B00000000,B00000000,B00011100,B00000000,B00000000,B00000000,

  B00000000,B00000000,B00000000,B00111100,B00000000,B00000000,B00000000,

  B00000000,B00000000,B00000000,B01111110,B00000000,B00000000,B00000000,

  B00000000,B00000000,B01110000,B01111111,B00000000,B00000000,B00000000,

  B00000000,B00000000,B01111000,B11100111,B00000110,B00000000,B00000000,

  B00000000,B00000000,B11111101,B11100011,B10001111,B00000000,B00000000,

  B00000000,B00000000,B11111111,B11000011,B00011111,B10000000,B00000000,

  B00000000,B00000001,B11001111,B10000000,B00111111,B11000000,B00000000,

  B00000000,B00000011,B11000111,B00000000,B01111111,B11100000,B00000000,

  B00000000,B00000011,B10000011,B00000000,B11110111,B01110000,B00000000,

  B00000000,B00000111,B00000000,B00000000,B01100111,B00110000,B00000000,

  B00000000,B00000111,B00000000,B00000000,B00000111,B00000000,B00000000,

  B00000000,B00001110,B00000000,B00011000,B00000111,B00000000,B00000000,

  B00000000,B00011111,B00011110,B01111110,B00000111,B00000000,B00000000,

  B00000000,B00011111,B11111111,B11111111,B11100111,B00000000,B00000000,

  B00000000,B00111111,B11110111,B11100111,B11100111,B00000000,B00000000,

  B00000000,B00111000,B11100001,B10000001,B11000111,B00000000,B00000000,

  B00000000,B01110000,B00000000,B00000000,B00000111,B00000000,B00000000,

  B00000000,B11110000,B00000000,B00000000,B00000111,B00000000,B00000000,

  B00000000,B11100000,B00000000,B00000000,B00000111,B00000000,B00000000,

  B00000001,B11000000,B00000000,B00000000,B00000110,B00100000,B00000000,

  B00000001,B11000000,B00000000,B00000000,B00000000,B01100000,B00000000,

  B00000011,B10000000,B00000000,B00000000,B00000000,B01110000,B00000000,

  B00000111,B10000000,B00000000,B00000000,B00000000,B01110000,B00000000,

  B00000111,B00000000,B00000000,B00000000,B00000000,B00111000,B00000000,

  B00001110,B00000000,B00000000,B00000000,B00000000,B00011100,B00000000,

  B00001110,B00000000,B00000000,B00000000,B00000000,B00011100,B00000000,

  B00011111,B11111111,B11111111,B11111111,B11111111,B11111110,B00000000,

  B00011111,B11111111,B11111111,B11111111,B11111111,B11111110,B00000000,

  B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,

  B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,

  B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,

  B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,

  B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,

  B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,

  B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,

  B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,

  B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,

  B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,

  B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,

  B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000 

};

// ************************************************************ //

 

void setup()

{

  Serial.begin(115200);         // For serial monitoring

  neogps.begin(9600, SERIAL_8N1, RXD2, TXD2);  // 16 = RX, 17 = TX, Other pins can be defined!

  pinMode(BUTTON_PIN, INPUT_PULLUP);

 

  // Initializing the ILI9341 display

  tft.init();

  tft.setRotation(1);           // We set the display orientation

  tft.fillScreen(TFT_BLACK);    // Clear the display

      tft.setTextColor(TFT_YELLOW, TFT_BLACK);   // Sets the text/background color

      tft.setTextSize(4);       // We set the size of the text

      tft.setCursor(60, 100);

      tft.println("GPSBox by");

      tft.setCursor(60, 145);

      tft.setTextSize(3);

      tft.println("*ex-YO9CXY*");

      tft.setCursor(120, 180);

      tft.setTextSize(2);

      tft.println("v1.0.1");

  delay(3000);

  tft.fillScreen(TFT_BLACK);

}

// ************************************************************ //

 

void loop()

{

  boolean gpsData = false;

  for (unsigned long start = millis(); millis() - start < 1000;)

  {

    while (neogps.available()) // Checking the data available on the serial interface

    {

      // Actions when GPS data is decoded

      if (gps.encode(neogps.read())) // It reads and decodes the data from the GPS

      { gpsData = true; }

    }

  }

 

  // Checks for a valid location and active satellites

  if (gps.location.isValid() && gps.satellites.value() > 0)

  {

    // Showing valid GPS data

    tft.fillScreen(TFT_BLACK);  // Clear the display

    tft.drawBitmap(5, 180, satellite, 50, 50, TFT_WHITE);

    tft.setTextColor(TFT_YELLOW);

// ****************************** //

 

        // Showing UTC date

        tft.setCursor(50, 160);

        tft.print("date (UTC): ");

        if (gps.date.day() < 10) tft.print("0");

        tft.print(gps.date.day());

        tft.print("/");

        if (gps.date.month() < 10) tft.print("0");

        tft.print(gps.date.month());

        tft.print("/");

        tft.print(gps.date.year());

        tft.print("  ");

      // ****************************** //

 

        // Showing UTC time

        tft.setCursor(75, 183);

        tft.print("time (UTC): ");

        if (gps.time.hour() < 10) tft.print("0");

        tft.print(gps.time.hour());

        tft.print(":");

        if (gps.time.minute() < 10) tft.print("0");

        tft.print(gps.time.minute());

        tft.print(":");

        if (gps.time.second() < 10) tft.print("0");

        tft.println(gps.time.second());

// ****************************** //

 

    // Showing of visible satellites

    tft.setTextColor(TFT_WHITE);

    tft.setCursor(135,210);

    tft.print("Satellites: ");

    tft.setTextSize(3);

    tft.print(gps.satellites.value());

// ****************************** //

 

    // Showing Latitude & Longitude

    tft.drawBitmap(6, 5, cloud, 30, 30, TFT_YELLOW);

    tft.fillRect(70, 5, 40, 70, TFT_BLACK);

 

    tft.setTextColor(0x07FF);

    tft.setTextSize(2);

    tft.setCursor(40,10);

    tft.print("Lat: ");

    tft.print(gps.location.lat(),4);  

    tft.setCursor(40,30);

    tft.print("Lng: ");

    tft.print(gps.location.lng(),4);

 

    double latitude = gps.location.lat();     // Latitudinea locatiei

    double longitude = gps.location.lng();    // Longitudinea locatiei

// ****************************** //

 

    // Showing Speed

    tft.drawBitmap(6, 50, speed, 50, 50, TFT_YELLOW);

    tft.fillRect(60, 75, 50, 40, TFT_BLACK);

   

    tft.setCursor(60,60);

    tft.print("Speed (km/h)");

    tft.setCursor(60,80);

    tft.print(gps.speed.kmph());

// ****************************** //

 

    // Showing Altitude

    tft.drawBitmap(6, 100, alt, 50, 50, TFT_YELLOW);

    tft.fillRect(60, 120, 50, 35, TFT_BLACK);

 

    tft.setCursor(60,110);

    tft.print("Altitude (m)");

    tft.setCursor(60,130);

    tft.print(gps.altitude.meters(), 0);

// ****************************** //

 

        // Showing QTH_locator

        tft.setTextColor(TFT_RED);

        tft.setCursor(200, 10);

        tft.print("QTHlocator");

        tft.setCursor(200, 30);

        tft.print(QTH_locator(latitude, longitude));

    delay(8000);

  }

// ************************************************************ //

 

  else

  {

    tft.fillScreen(TFT_BLACK);  // Clear the display

    tft.drawBitmap(6, 5, boot, 100, 100, TFT_WHITE);

    tft.setTextColor(TFT_WHITE);  

    tft.setTextSize(2);

    tft.setCursor(10,120);

    tft.print("Finding satellites!");

        delay(1000);

  }

}

// ************************************************************ //

 

// Calculating QTH_locator

String QTH_locator(double latitude, double longitude)

{

  // First letter (general area - longitude)

  char firstLetter = 'A' + int((longitude + 180) / 20);

 

  // Second letter (general area - latitude)

  char secondLetter = 'A' + int((latitude + 90) / 10);

 

  // First digit (sub-square - longitude)

  int firstDigit = int(fmod(longitude + 180, 20) / 2);

 

  // Second digit (sub-square - latitude)

  int secondDigit = int(fmod(latitude + 90, 10) / 1);

 

  // Third letter (under subdivision - longitude)

  char thirdLetter = 'A' + int(fmod(longitude + 180, 2) * 12);

 

  // Fourth letter (under subdivision - latitude)

  char fourthLetter = 'A' + int(fmod(latitude + 90, 1) * 24);

 

  // Fifth digit (extra precision - longitude)

  int fifthDigit = int(fmod(fmod(longitude + 180, 2) * 12, 1) * 10);

 

  // Sixth digit (extra precision - latitude)

  int sixthDigit = int(fmod(fmod(latitude + 90, 1) * 24, 1) * 10);

 

  // Seventh letter (even finer precision - longitude)

  char seventhLetter = 'A' + int(fmod(fmod(fmod(longitude + 180, 2) * 12, 1) * 10, 1) * 24);

 

  // Eighth letter (even finer precision - latitude)

  char eighthLetter = 'A' + int(fmod(fmod(fmod(latitude + 90, 1) * 24, 1) * 10, 1) * 24);

// ****************************** //

 

  // Building the final locator

  String QTH_locator = "";

  QTH_locator += firstLetter;

  QTH_locator += secondLetter;

  QTH_locator += String(firstDigit);

  QTH_locator += String(secondDigit);

  QTH_locator += thirdLetter;

  QTH_locator += fourthLetter;

  QTH_locator += String(fifthDigit);

  QTH_locator += String(sixthDigit);

  QTH_locator += seventhLetter;

  QTH_locator += eighthLetter;

 

  return QTH_locator;

}

// ********************** END OF PROGRAM ********************** //

 

Descrierea programului:

Inceputul programului se face intotdeauna cu stabilirea librariilor/bibliotecilor necesare  si crearea obiectelor cu care se va lucra in continuare:

#include <TinyGPS++.h>

TinyGPSPlus gps;                // The TinyGPS++ object

 

#include <HardwareSerial.h>

HardwareSerial neogps(1);

#define RXD2 16

#define TXD2 17

 

#include <TFT_eSPI.h>           // Include the graphics library

TFT_eSPI tft = TFT_eSPI();      // Create object "tft"

 

Codurile hexazecimale care urmeaza sunt destinate sa construiasca iconitele pe display, si fac parte din programul original amintit:

-          const unsigned char boot[] PROGMEM =

-          const unsigned char cloud[] PROGMEM =

-          const unsigned char speed[] PROGMEM =

-          const unsigned char satellite[] PROGMEM =

-          const unsigned char alt[] PROGMEM =

 

Nu am modificat nimic in acest cod pentru ca este realizat foarte bine si necesita o munca extrem de migaloasa.

In continuare avem rutina SETUP care initializeaza displayul, portul de comunicatie seriala si se ocupa de afisarea unui logo de inceput:

 

void setup()

{

  Serial.begin(115200);         // For serial monitoring

  neogps.begin(9600, SERIAL_8N1, RXD2, TXD2);  // 16 = RX, 17 = TX, Other pins can be defined!

  pinMode(BUTTON_PIN, INPUT_PULLUP);

 

  // Initializing the ILI9341 display

  tft.init();

  tft.setRotation(1);           // We set the display orientation

  tft.fillScreen(TFT_BLACK);    // Clear the display

      tft.setTextColor(TFT_YELLOW, TFT_BLACK);   // Sets the text/background color

      tft.setTextSize(4);       // We set the size of the text

      tft.setCursor(60, 100);

      tft.println("GPSBox by");

      tft.setCursor(60, 145);

      tft.setTextSize(3);

      tft.println("*ex-YO9CXY*");

      tft.setCursor(120, 180);

      tft.setTextSize(2);

      tft.println("v1.0.1");

  delay(3000);

  tft.fillScreen(TFT_BLACK);

}

 

Rutina urmatoare LOOP, este codul care se repeat atata timp cat intreg montajul este alimentat cu tensiune.  Mai intai se face o declaratie:

boolean gpsData = false;

apoi se verifia existent datelor furnizate de reteaua GPS:

  for (unsigned long start = millis(); millis() - start < 1000;)

  {

    while (neogps.available()) // Checking the data available on the serial interface

    {

      // Actions when GPS data is decoded

      if (gps.encode(neogps.read())) // It reads and decodes the data from the GPS

      { gpsData = true; }

    }

  }

Daca nu suntem vizibili pentru sateliti se afiseaza un mesaj sugestiv de avertizare, ramane doar sa-l descoperiti prin detasarea antenei sau pornind dispozitivul intr-un loc unde satelitii nu sunt vizibili:

  else

  {

    tft.fillScreen(TFT_BLACK);  // Clear the display

    tft.drawBitmap(6, 5, boot, 100, 100, TFT_WHITE);

    tft.setTextColor(TFT_WHITE);  

    tft.setTextSize(2);

    tft.setCursor(10,120);

    tft.print("Finding satellites!");

        delay(1000);

  }

 

Daca totul este in regula, se trece la afisarea datelor pe display folosind culori si iconite sugestive:

Mai intai se afiseaza data UTC furnizata de satelitii stationari GPS:

// Showing UTC date

        tft.setCursor(50, 160);

        tft.print("date (UTC): ");

        if (gps.date.day() < 10) tft.print("0");

        tft.print(gps.date.day());

        tft.print("/");

        if (gps.date.month() < 10) tft.print("0");

        tft.print(gps.date.month());

        tft.print("/");

        tft.print(gps.date.year());

        tft.print("  ");

      // ****************************** //

 

In continuare se afiseaza ora exacta UTC:

// Showing UTC time

        tft.setCursor(75, 183);

        tft.print("time (UTC): ");

        if (gps.time.hour() < 10) tft.print("0");

        tft.print(gps.time.hour());

        tft.print(":");

        if (gps.time.minute() < 10) tft.print("0");

        tft.print(gps.time.minute());

        tft.print(":");

        if (gps.time.second() < 10) tft.print("0");

        tft.println(gps.time.second());

// ****************************** //

 

Apoi numarul satelitilor vizibili:

    // Showing of visible satellites

    tft.setTextColor(TFT_WHITE);

    tft.setCursor(135,210);

    tft.print("Satellites: ");

    tft.setTextSize(3);

    tft.print(gps.satellites.value());

// ****************************** //

Acestea sunt date care ne furnizeaza informatii despre buna functionare a dispozitivului nostru.

Partea cea mai interesanta vine cu date concrete despre locatia in care ne aflam.

In primul rand coordonatele geografice:

// Showing Latitude & Longitude

    tft.drawBitmap(6, 5, cloud, 30, 30, TFT_YELLOW);

    tft.fillRect(70, 5, 40, 70, TFT_BLACK);

 

    tft.setTextColor(0x07FF);

    tft.setTextSize(2);

    tft.setCursor(40,10);

    tft.print("Lat: ");

    tft.print(gps.location.lat(),4);  

    tft.setCursor(40,30);

    tft.print("Lng: ");

    tft.print(gps.location.lng(),4);

 

    double latitude = gps.location.lat();     // Latitudinea locatiei

    double longitude = gps.location.lng();    // Longitudinea locatiei

// ****************************** //

 

Viteza de deplasare:

 // Showing Speed

    tft.drawBitmap(6, 50, speed, 50, 50, TFT_YELLOW);

    tft.fillRect(60, 75, 50, 40, TFT_BLACK);

   

    tft.setCursor(60,60);

    tft.print("Speed (km/h)");

    tft.setCursor(60,80);

    tft.print(gps.speed.kmph());

// ****************************** //

 

Altitudinea:

    // Showing Altitude

    tft.drawBitmap(6, 100, alt, 50, 50, TFT_YELLOW);

    tft.fillRect(60, 120, 50, 35, TFT_BLACK);

 

    tft.setCursor(60,110);

    tft.print("Altitude (m)");

    tft.setCursor(60,130);

    tft.print(gps.altitude.meters(), 0);

// ****************************** //

 

Si in sfarsit cea mai importanta informatie asteptata, QTH locatorul:

        // Showing QTH_locator

        tft.setTextColor(TFT_RED);

        tft.setCursor(200, 10);

        tft.print("QTHlocator");

        tft.setCursor(200, 30);

        tft.print(QTH_locator(latitude, longitude));

 

Intrucat aici se inccheie rutina loop, se asteapta aproximativ 8 secunde pentru ca afisarea sa nu devina suparatoare prin reinprospatare. Existau si alte metode, insa aceasta este cea mai simpla:

    delay(8000);

 

Dupa cum puteti observa usor, informatia locatorului este obtinuta printr-un calcul folosind latitudinea si longitudinea:

// Calculating QTH_locator

String QTH_locator(double latitude, double longitude)

{

  // First letter (general area - longitude)

  char firstLetter = 'A' + int((longitude + 180) / 20);

 

  // Second letter (general area - latitude)

  char secondLetter = 'A' + int((latitude + 90) / 10);

 

  // First digit (sub-square - longitude)

  int firstDigit = int(fmod(longitude + 180, 20) / 2);

 

  // Second digit (sub-square - latitude)

  int secondDigit = int(fmod(latitude + 90, 10) / 1);

 

  // Third letter (under subdivision - longitude)

  char thirdLetter = 'A' + int(fmod(longitude + 180, 2) * 12);

 

  // Fourth letter (under subdivision - latitude)

  char fourthLetter = 'A' + int(fmod(latitude + 90, 1) * 24);

 

  // Fifth digit (extra precision - longitude)

  int fifthDigit = int(fmod(fmod(longitude + 180, 2) * 12, 1) * 10);

 

  // Sixth digit (extra precision - latitude)

  int sixthDigit = int(fmod(fmod(latitude + 90, 1) * 24, 1) * 10);

 

  // Seventh letter (even finer precision - longitude)

  char seventhLetter = 'A' + int(fmod(fmod(fmod(longitude + 180, 2) * 12, 1) * 10, 1) * 24);

 

  // Eighth letter (even finer precision - latitude)

  char eighthLetter = 'A' + int(fmod(fmod(fmod(latitude + 90, 1) * 24, 1) * 10, 1) * 24);

// ****************************** //

 

  // Building the final locator

  String QTH_locator = "";

  QTH_locator += firstLetter;

  QTH_locator += secondLetter;

  QTH_locator += String(firstDigit);

  QTH_locator += String(secondDigit);

  QTH_locator += thirdLetter;

  QTH_locator += fourthLetter;

  QTH_locator += String(fifthDigit);

  QTH_locator += String(sixthDigit);

  QTH_locator += seventhLetter;

  QTH_locator += eighthLetter;

 

  return QTH_locator;

}

 

Codul este structurat scolareste si comentat cu generozitate astfel incat oricine poate sa-l modifice dupa nevoi sau sa foloseasca portiuni de cod pentru alte lucrari.

Consider ca fragmentele de cod nu pot fi atribuite unui autor unic.

Pentru radioamatori ar fi necesare doar primele 6 caractere calculate, dar dupa ce veti consulta harta amintita in comentariul de la inceputul programului, veti ramane surprinsi de exactitatea calculului cu 10 caractere.

 

Precizia masuratorilor depinde foarte mult de:

-          ecranarea locatiei cu constructii metalice

-          tipul antenei GPS

-          pozitia antei GPS

-          numarul de sateliti vizibili

-          calitatea modulului GPS folosit. Datorita acestuia pot aparea diferente de masuratori in comparatie cu alte device-uri. In special se va constata o viteza relativ mica de deplasare “Speed” chiar si atunci cand se sta nemiscat! Se poate observa pe fotografie.

*** Cu aceste detalii inchei expunerea cu precizarea ca oricine ma poate contacta pentru sprijin. Radioamatori sau nu, incepatori sau avansati, daca aveti nelamuriri sau observatii, va stau la dispozitie in limita cunostintelor mele. Ideile inovatoare sunt binevenite de la oricine!

 

73! de ex.YO9CXY

D. Sandu, gocomraex@gmail.com

Tel. 0742997202

Doru Sandu ex. YO9CXY

Articol aparut la 20-9-2024

997

Inapoi la inceputul articolului

Comentarii (12)  

  • Postat de Adrian - YO3HJV (yo3hjv) la 2024-09-22 05:11:36 (ora Romaniei)
  • Salut Sandu, am facut si eu ceva asemanator, dar am adaugat un senzor barometric cu care monitorizez presiunea atmosferica si afisez un grafic orizontal pe baza caruia poti evalua daca se apropie un front de furtuna.
    I-a placut atat de mult unui amic incat i l-am facut cadou.
    73, Adrian https://yo3hjv.blogspot.com/2023/12/portable-gps-barometer-utc-clock.html

  • Postat de Mircea Bochis - YO5AXB (yo5axb) la 2024-09-22 15:02:59 (ora Romaniei)
  • FELICITARI! Vreau si eu un exemplar pe bani evident.Cu multumiri anticipate,Mircea,YO5AXB.

  • Postat de Florentin - YO9CHO (yo9cho) la 2024-09-23 03:40:21 (ora Romaniei)
  • Felicitari Dorule!
    73!

  • Postat de Doru Sandu - YO9CXY (yo9cxy) la 2024-09-27 19:49:18 (ora Romaniei)
  • Pentru YO9CHO,
    Multumesc Florin, crezi ca ne mai putem intalni in RO?
    73!
      Comentariu modificat de autor.

  • Postat de Doru Sandu - YO9CXY (yo9cxy) la 2024-09-27 19:58:47 (ora Romaniei)
  • Pentru YO5AXB
    Draga Mircea, sa stii ca postarile mele sunt doar in urma unor experimente pe o placa de test. Constructii definitive, in cutie, aspectoase, nu am. De altfel imi este destul de greu sa le realizez intrucat sunt prins cu alte treburi si nu pot desfasura activitati comerciale. Montajul este destul de simplu. Documentatia este mai mult decat necesara iar realizarea se poate face pe o placa cu circuit imprimat pentru test (placa cu gaurele). Ca sa nu te refuz, totusi mai ai rabdare sa vina frigul si sa ma bage fortat in casa!
    73!

  • Postat de Doru Sandu - YO9CXY (yo9cxy) la 2024-09-27 20:07:07 (ora Romaniei)
  • Pentru YO3HJV
    Multumesc Adrian, voi analiza si articolul tau - pare interesant. Defapt ideea mea a fost alta, sa folosesc aproape tot ce se poate de la modulul NEO6GPS si sa compar cu alte cateva module GPS pe care le am. Sunt oarecun dezamagit.
    Oare tot ce e mai prost pe piata se gaseste in RO!
    73!
      Comentariu modificat de autor.

  • Postat de Mircea Bochis - YO5AXB (yo5axb) la 2024-09-28 18:12:00 (ora Romaniei)
  • YO9CXY, astept cu nerabdare sa vina frigul...HI,HI,HI... am si eu multe pe cap cu microundele si prefer sa cumpar decit sa ma complic mai tare...multumesc mult pentru mesaj,73,Mircea,YO5AXB.

  • Postat de Doru Sandu - YO9CXY (yo9cxy) la 2024-09-29 10:58:51 (ora Romaniei)
  • Pentru YO5AXB
    OK Mircea, voi avea in vedere.
    Many 73! de ex.YO9CXY

  • Postat de Mircea Bochis - YO5AXB (yo5axb) la 2024-09-29 18:50:01 (ora Romaniei)
  • yo9cxy,multumesc mult,73,mircea yo5axb

  • Postat de Adrian - YO3HJV (yo3hjv) la 2024-09-29 23:41:26 (ora Romaniei)
  • @YO9CXY- Doru, uBlox e un producator decent de receptoare GNSS. Daca ai varianta M/V chiar poti sa scoti frecventa stabila la 10 MHz din el. Face si el ce fac cam toate celelalte module din piata si la un pret... elvetian.
    Din pacate pentru ei, la jumatate de pret poti lua receptoare GNSS cu performate cel putin identice daca nu chiar mai bune. Am folosit uBlox dar acum merg pe receptoare "ieftine" care insa au avantajul ca receptioneaza, decodeaza si pot corela si alte constelatii (GLONASS, Galileo, BEIDOU) de care uBlox Neo6 nu le cunoaste...
    Tind sa te contrazic, nu mai exista "piata din Romania". Putem cumpara tot ce pot cumpara si nemtii, ideea este sa ne facem temele inainte de a ne decide pe un anumit produs. uBlox este elvetiano-austriac insa doar prejudecatile ne impiedica sa vedem calitatile unei "bazaconii" chinezesti.
    In varianta mea de receptor, cea din link, tot un Neo6 am folosit, mai mult ca sa scap de el din cutii ca il plimbam prea mult prin ele. Pentru acea aplicatie, e suficient.
    Ca sa obtii insa mai multa performanta si corelare intre constelatii, trebuie sa mergi cel putin la M8 sau mai noi. M6 e vechi iar pentru generatiile mai noi scuturi mai bine portofelul.
    Neo6 e deja obsolete, nu il mai gasesti iar M8 este vreo 28-30 USD doar circuitul :-)

    73 de YO3HJV

  • Postat de Doru Sandu - YO9CXY (yo9cxy) la 2024-09-30 01:13:31 (ora Romaniei)
  • Pentru YO3HJV
    Scopul articolelor mele este acela de a da posibilitatea constructorilor (atatia cat mai sunt) sa modifice softul pentru ce au prin casa.
    Intrucat radioamatorii nu fac parte dintr-o categorie "comerciala", nu pot investi doar pentru supercalitate, lucrez cu ce-i mai ieftin atragand atentia asupra performantelor.
    Multumesc pentr interventie!
    73! de ex.YO9CXY.

  • Postat de Adrian - YO3HJV (yo3hjv) la 2024-09-30 14:31:53 (ora Romaniei)
  • @YO9CXY - Pai, scopul este atins! Eu exprimam o opinie cu privire la Neo6 si dezamagirea ta, insotita de o observatie generala la care am simtit nevoia sa aduc niste precizari.
    Neo6M a ajuns cel mai ieftin? Intreb pentru ca am o cutie cu tot felul de module de mult timp luate si la momentul ala Neo6M era destul de scumpicel.

    Scrieti un mic comentariu la acest articol!  

    Opinia dumneavoastra va aparea dupa postare sub articolul "QTH locator cu ESP32 DevKit si NEO6GPS"
    Comentariul trebuie sa se refere la continutul articolului. Mesajele anonime, cele scrise sub falsa identitate, precum si cele care contin (fara a se limita la) atac la persoana, injurii, jigniri, expresii obscene vor fi sterse iar dupa caz se va ridica dreptul de a posta comentarii.
    Comentariu *
     
    Trebuie sa va autentificati pentru a putea adauga un comentariu.


    Opiniile exprimate în articole pe acest site aparţin autorilor şi nu reflectă neapărat punctul de vedere al redacţiei.

    Copyright © Radioamator.ro. Toate drepturile rezervate. All rights reserved
    Articole | Concursuri | Mica Publicitate | Forum YO | Pagini YO | Call Book | Diverse | Regulamentul portalului | Contact