Fabrication industrielle
Internet des objets industriel | Matériaux industriels | Entretien et réparation d'équipement | Programmation industrielle |
home  MfgRobots >> Fabrication industrielle >  >> Manufacturing Technology >> Processus de fabrication

Enregistreur de données GPS, courbe en temps réel, hauteur maximale et vitesse maximale

Composants et fournitures

Arduino UNO
arduino uno
× 1
Cavalier (barre omnibus), jeu de fils de cavalier
× 1
Arduino Proto Shield
× 1
Écran LCD TFT SPI 1,8" avec prise MicroSD
ou autre avec carte SD
× 1
u-blox gps neo 6m
× 1

Outils et machines nécessaires

Fer à souder (générique)
Fil à souder, sans plomb
Dénudeur et coupe-fil, 18-10 AWG / 0.75-4mm² Fils de capacité

À propos de ce projet

PRÉSENTATION

Je pratique l'aéromodélisme et j'aime connaître la vitesse et l'altitude de mes avions. Malheureusement, les enregistreurs de données GPS commerciaux sont très chers.

J'ai donc décidé de faire un enregistreur de données GPS basé sur Arduino pour un coût inférieur à 50€.

Mon premier prototype est basé sur Arduino Uno R3 avec un écran Sainsmart ST7735 avec carte SD intégrée et un module GPS NEO 6M V2.

Dans le deuxième projet, j'utiliserais un Arduino Nano avec un écran OLED SSD1306, le même module GPS et une carte micro SD. Le poids avec étui doit être d'environ 40 grammes et s'intègre facilement dans un avion de taille moyenne (taille L 50 mm X l 30 mm X H 22 mm).

Ce sera mon prochain projet (j'attends les matériaux.)

TESTER

Ce n'est pas facile de filmer un écran d'Arduino dans une voiture, mais je l'ai fait et vous pouvez voir le résultat sur la vidéo.

Le prochain test sera avec le nouveau prototype, plus petit et plus léger, sur un avion radiocommandé. A suivre !


Code

  • enregistreur de données gps
  • sauvegarde SD
enregistreur de données gps Arduino
#include #include #include  #define cs 10#define dc 9#define rst 8 #include #include  Adafruit_ST7735 tft =Adafruit_ST7735(cs, dc, rst); statique const int RXPin =4, TXPin =3; //Communication GPSstatic const uint32_t GPSBaud =9600;#define OLED_RESET 5TinyGPSPlus gps;SoftwareSerial ss(RXPin, TXPin);int x=80;int xh=80;int maxhigh=0;int maxspeed =0, speed1 =0;int high1 =0;;void setup(){ Serial.begin(9600); ss.begin(GPSbaud); tft.initR(INITR_GREENTAB); tft.fillScreen(ST7735_BLACK); tft.setCursor(5, 58); tft.setTextSize(1) ; tft.setTextColor(ST7735_GREEN,ST7735_BLACK); tft.print("initialisation"); }boucle vide(){ tft.setTextSize(1); tft.setTextColor(ST7735_GREEN,ST7735_BLACK); // affichage des informations à chaque bonne réception satellite while (ss.available()> 0){ gps.encode(ss.read()); if (gps.location.isUpdated()){ cadre(); tft.setCursor(5, 44); tft.setTextColor(ST7735_GREEN,ST7735_BLACK); tft.print("Latitude :"); tft.setTextColor(ST7735_CYAN,ST7735_BLACK); tft.print(gps.location.lat(), 6); tft.setCursor(5, 58); tft.setTextColor(ST7735_GREEN,ST7735_BLACK); tft.print("Longitude :"); tft.setTextColor(ST7735_CYAN,ST7735_BLACK); tft.print(gps.location.lng(), 6); //affichage ecran date tft.setCursor(5, 7); tft.setTextColor(ST7735_GREEN,ST7735_BLACK); tft.print("date :"); tft.setTextColor(ST7735_CYAN,ST7735_BLACK); tft.print(gps.date.day()); tft.print(" "); tft.print(gps.date.mois()); tft.print(" "); tft.print(gps.date.année()); //affichage ecran heure tft.setCursor(5, 20); tft.setTextColor(ST7735_GREEN,ST7735_BLACK); tft.print("heure :"); tft.setTextColor(ST7735_CYAN,ST7735_BLACK); tft.print(gps.time.hour()+1); tft.print(" "); tft.print(gps.time.minute()); tft.print(" "); tft.print(gps.time.second()); tft.print(" "); tft.setTextColor(ST7735_GREEN,ST7735_BLACK); tft.setCursor(3, 30); //affichage ecran altitude tft.setCursor(5, 80); tft.print("Hm :"); tft.setTextColor(ST7735_CYAN,ST7735_BLACK); tft.print (gps.altitude.meters(),0) ; tft.setTextColor(ST7735_CYAN,ST7735_BLACK); tft.print(" "); tft.setTextColor(ST7735_GREEN,ST7735_BLACK); tft.setCursor(5, 95); hmax(); tft.print("Hmax :"); tft.setTextColor(ST7735_CYAN,ST7735_BLACK); tft.print(maxhigh); tft.setTextColor(ST7735_CYAN,ST7735_BLACK); tft.print(" "); courbeh(); //affichage ecran vitesse tft.setCursor(5, 115); tft.setTextColor(ST7735_GREEN,ST7735_BLACK); tft.print("Acte V :"); tft.setTextColor(ST7735_CYAN,ST7735_BLACK); tft.print (gps.speed.kmph(),0) ; tft.setTextColor(ST7735_CYAN,ST7735_BLACK); tft.print(" "); tft.setCursor(5, 130); tft.setTextColor(ST7735_GREEN,ST7735_BLACK); vmax(); tft.print("vmax:"); tft.setTextColor(ST7735_CYAN,ST7735_BLACK); tft.print(vitesse max); tft.setTextColor(ST7735_CYAN,ST7735_BLACK); tft.print(" "); tft.setTextColor(ST7735_GREEN,ST7735_BLACK); courbe(); //affichage ecran nombre de satellites tft.setCursor(5, 147); tft.setTextColor(ST7735_GREEN,ST7735_BLACK); tft.print("nombre de Sam :"); tft.setTextColor(ST7735_CYAN,ST7735_BLACK); tft.print(gps.satellites.value()); tft.setTextColor(ST7735_CYAN,ST7735_BLACK); tft.print(" "); // Cote horizontale. de précision (100ths-i32) Serial.print("HDOP ="); Serial.println(gps.hdop.value()); SmartDelay(400); } }}// delai pour une bonne réceptionstatic void smartDelay(unsigned long ms){ unsigned long start =millis(); do { while (ss.available()) gps.encode(ss.read()); } while (millis() - start 123) { x=80; tft.fillRect(82,110,43,30,ST7735_BLACK); }}void courbeh() { int nouvelleValeurh; // conversion vitesse max (350 km/h) en pixel nouvelleValeurh =map((gps.altitude.meters()), 0, 1000, 104, 72); // voiture l'cran a 64 pixels de haut xh++; tft.drawPixel(xh,nouvelleValeurh,ST7735_CYAN); si (xh>123) { xh=80; tft.fillRect(82,72,43,35,ST7735_BLACK); }}void vmax() {// calculer vitesse maximale rapide1 =(gps.speed.kmph()); if ( vitesse1> vitesse max) { vitesse max =vitesse1; } } void hmax() {// calculer l'altitude maximum high1 =(gps.altitude.meters()); if ( high1> maxhigh) { maxhigh =high1; } }
sauvegarde SDArduino
enregistreur de données
#include #include#include #include  #define cs 10#define dc 9#define rst 8 #include #include Adafruit_ST7735 tft =Adafruit_ST7735(cs, dc, rst);static const int RXPin =4, TXPin =3; //Communication GPSstatic const uint32_t GPSBaud =9600;const int cs_sd=4;#define OLED_RESET 5TinyGPSPlus gps;SoftwareSerial ss(RXPin, TXPin);int x=80;int xh=80;int maxhigh=0;int maxspeed =0, speed1 =0;int high1 =0;;void setup(){ Serial.begin(9600); ss.begin(GPSbaud); tft.initR(INITR_GREENTAB); tft.fillScreen(ST7735_BLACK); tft.setCursor(5, 58); tft.setTextSize(1) ; tft.setTextColor(ST7735_GREEN,ST7735_BLACK); tft.print("initialisation"); tft.setCursor(5, 70); tft.print("init SD"); retard(1000); if(!SD.begin(cs_sd)) //Condition réelle si la carte SD est présente dans l'appareil { tft.setCursor(5, 82); tft.print("SD par défaut"); retourner; } tft.setCursor(5, 82); tft.print("Carte SD OK"); retard(1000); tft.fillScreen(ST7735_BLACK); Données du fichier =SD.open("donnees.txt",FILE_WRITE); // Ouvre le fichier "donnees.txt" data.println(""); data.println("Démarrage acquisition"); // Ecrit dans ce fichier data.close(); }boucle vide(){ tft.setTextSize(1); tft.setTextColor(ST7735_GREEN,ST7735_BLACK); // affichage des informations à chaque bonne réception satellite while (ss.available()> 0){ gps.encode(ss.read()); if (gps.location.isUpdated()){ cadre(); tft.setCursor(5, 44); tft.setTextColor(ST7735_GREEN,ST7735_BLACK); tft.print("Latitude :"); tft.setTextColor(ST7735_CYAN,ST7735_BLACK); tft.print(gps.location.lat(), 6); tft.setCursor(5, 58); tft.setTextColor(ST7735_GREEN,ST7735_BLACK); tft.print("Longitude :"); tft.setTextColor(ST7735_CYAN,ST7735_BLACK); tft.print(gps.location.lng(), 6); //affichage ecran date tft.setCursor(5, 7); tft.setTextColor(ST7735_GREEN,ST7735_BLACK); tft.print("date :"); tft.setTextColor(ST7735_CYAN,ST7735_BLACK); tft.print(gps.date.day()); tft.print(" "); tft.print(gps.date.mois()); tft.print(" "); tft.print(gps.date.année()); Chaîne Date=Chaîne(gps.date.day())+(" ")+(gps.date.month())+(" ")+(gps.date.year()); //affichage ecran heure tft.setCursor(5, 20); tft.setTextColor(ST7735_GREEN,ST7735_BLACK); tft.print("heure :"); tft.setTextColor(ST7735_CYAN,ST7735_BLACK); tft.print(gps.time.hour()+1); tft.print(" "); tft.print(gps.time.minute()); tft.print(" "); tft.print(gps.time.second()); tft.print(" "); tft.setTextColor(ST7735_GREEN,ST7735_BLACK); tft.setCursor(3, 30); Chaîne Temps=Chaîne(gps.time.hour()+1)+(" ")+(gps.time.minute())+(" ")+(gps.time.second()); //affichage ecran altitude tft.setCursor(5, 80); tft.print("Hm :"); tft.setTextColor(ST7735_CYAN,ST7735_BLACK); tft.print (gps.altitude.meters(),0) ; tft.setTextColor(ST7735_CYAN,ST7735_BLACK); tft.print(" "); tft.setTextColor(ST7735_GREEN,ST7735_BLACK); tft.setCursor(5, 95); hmax(); tft.print("Hmax :"); tft.setTextColor(ST7735_CYAN,ST7735_BLACK); tft.print(maxhigh); tft.setTextColor(ST7735_CYAN,ST7735_BLACK); tft.print(" "); courbeh(); //affichage ecran vitesse tft.setCursor(5, 115); tft.setTextColor(ST7735_GREEN,ST7735_BLACK); tft.print("Acte V :"); tft.setTextColor(ST7735_CYAN,ST7735_BLACK); tft.print (gps.speed.kmph(),0) ; tft.setTextColor(ST7735_CYAN,ST7735_BLACK); tft.print(" "); tft.setCursor(5, 130); tft.setTextColor(ST7735_GREEN,ST7735_BLACK); vmax(); tft.print("vmax:"); tft.setTextColor(ST7735_CYAN,ST7735_BLACK); tft.print(vitesse max); tft.setTextColor(ST7735_CYAN,ST7735_BLACK); tft.print(" "); tft.setTextColor(ST7735_GREEN,ST7735_BLACK); courbe(); //affichage ecran nombre de satellites tft.setCursor(5, 147); tft.setTextColor(ST7735_GREEN,ST7735_BLACK); tft.print("nombre de Sam :"); tft.setTextColor(ST7735_CYAN,ST7735_BLACK); tft.print(gps.satellites.value()); tft.setTextColor(ST7735_CYAN,ST7735_BLACK); tft.print(" "); // Cote horizontale. de précision (100ths-i32) Serial.print("HDOP ="); Serial.println(gps.hdop.value()); SmartDelay(400); // Ecriture des données dans le fichier texte File data=SD.open("donnees.txt",FILE_WRITE); data.println(Date + " " + Temps + " " + Chaîne(gps.location.lat(), 6)+" "+Chaîne(gps.location.lng(), 6)+(" ")+Chaîne( gps.altitude.meters(),0)+(" ")+String(maxhigh)+(" ")+String(gps.speed.kmph(),0)+(" ")+String(maxspeed)); data.close(); } }}// delai pour une bonne réceptionstatic void smartDelay(unsigned long ms){ unsigned long start =millis(); do { while (ss.available()) gps.encode(ss.read()); } while (millis() - start 123) { x=80; tft.fillRect(82,110,43,30,ST7735_BLACK); }}void courbeh() { int nouvelleValeurh; // conversion vitesse max (350 km/h) en pixel nouvelleValeurh =map((gps.altitude.meters()), 0, 1000, 104, 72); // voiture l'cran a 64 pixels de haut xh++; tft.drawPixel(xh,nouvelleValeurh,ST7735_CYAN); si (xh>123) { xh=80; tft.fillRect(82,72,43,35,ST7735_BLACK); }}void vmax() {// calculer vitesse maximale 1 =(gps.speed.kmph()); if ( vitesse1> vitesse max) { vitesse max =vitesse1; } } void hmax() {// calculer l'altitude maximum high1 =(gps.altitude.meters()); if ( high1> maxhigh) { maxhigh =high1; } }

Schémas


Processus de fabrication

  1. Créez un détecteur d'incendie en quelques minutes avec Samsung SAMIIO, Arduino UNO et Raspberry Pi
  2. Acquisition de données en temps réel d'un panneau solaire à l'aide d'Arduino
  3. Comment créer un moniteur d'énergie et un enregistreur de données Arduino
  4. Animation LCD et jeux
  5. Enregistreur de données de température et d'humidité
  6. Calculatrice UNO simple
  7. Persistance de la vision
  8. module GPS u-blox LEA-6H 02 avec Arduino et Python
  9. cube LED 4x4x4 avec Arduino Uno et 1sheeld