yvesmorele
Published © CC BY-NC-SA

RC LOGGERSTATION - GPS Data Logger for RC Plane

This project describes of a low-cost GPS data logger for RC planes. In a previous project I described how to build a GPS data logger.

IntermediateFull instructions provided7,442
RC LOGGERSTATION - GPS Data Logger for RC Plane

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
×1
Graphic OLED, 128 x 64
Graphic OLED, 128 x 64
×1
NEO 6M V2
×1

Hand tools and fabrication machines

Solder Wire, Lead Free
Solder Wire, Lead Free
Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires
Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires
Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Schematics

wiring prototype

Code

RC LOGGERSTATION

Arduino
// Test for minimum program size.

#include <Wire.h>
#include "SSD1306Ascii.h"
#include "SSD1306AsciiWire.h"
#include <TinyGPS++.h>
#include <SoftwareSerial.h>
#include<SD.h>



const int cs_sd=2;
static const int RXPin = 3, TXPin = 4; //GPS communication
static const uint32_t GPSBaud = 9600;
TinyGPSPlus gps;
SoftwareSerial ss(RXPin, TXPin);

int maxspeed = 0, speed1 = 0;
int maxhigh = 0, high1 = 0;
int maxsatelite = 0, satelite1 = 0;


// 0X3C+SA0 - 0x3C or 0x3D
#define I2C_ADDRESS 0x3C

// Define proper RST_PIN if required.
#define RST_PIN -1

SSD1306AsciiWire oled;
//------------------------------------------------------------------------------
void setup() {
  Wire.begin();
  ss.begin(GPSBaud);

#if RST_PIN >= 0
  oled.begin(&Adafruit128x64, I2C_ADDRESS, RST_PIN);
#else // RST_PIN >= 0
  oled.begin(&Adafruit128x64, I2C_ADDRESS);
#endif // RST_PIN >= 0

  oled.setFont(System5x7);
  oled.clear();
  oled.println(" ");
  oled.println("GPS DATA LOGGER");
  oled.println("FOR RC PLANE");
  oled.print(" MAX SPEED AND HEIGHT");
  delay(4000);
  oled.clear();
  
  

   if(!SD.begin(cs_sd))    //Condition vrifiant si la carte SD est prsente dans l'appareil
  {
   oled.clear();
   oled.print("Defaut SD");
  
    return;
  }
  
    oled.print("Carte SD OK");

    delay(2000);

   oled.clear();
    
  File data = SD.open("donnees.txt",FILE_WRITE);              // Ouvre le fichier "donnees.txt"
  data.println(""); data.println("Demarrage acquisition");    // Ecrit dans ce fichier
  data.close(); 
}
//------------------------------------------------------------------------------
void loop() {
   
    satelite1 = (abs(gps.satellites.value()));

    oled.print("V max ");
    oled.print("H max   ");
    oled.print(" SAT  ");
     oled.println(" ");
    oled.println(" ");
   
   
    
 
  oled.println(" ");
  oled.println(" ");
   speed1 = (gps.speed.kmph());
  if ( speed1 > maxspeed) {
    maxspeed = speed1;
  }
 
  oled.setCursor(10 , 80);
  oled.print(maxspeed);
  
  high1 = (gps.altitude.meters());
  if ( high1 > maxhigh) {
    maxhigh = high1;
  }
  oled.setCursor(50 , 80);
  oled.print(maxhigh);

   oled.setCursor(100 , 80);
  oled.print(satelite1);
  
  
   String Temps=String(gps.time.hour()+1)+(":")+(gps.time.minute())+(":")+(gps.time.second());
  String Date=String(gps.date.day())+("/")+(gps.date.month())+("/")+(gps.date.year());
 
// Ecriture des donnes dans le fichier texte
  File data=SD.open("donnees.txt",FILE_WRITE);
  data.println(Date + " " + Temps + " " + String(gps.location.lat(), 6)+" "+String(gps.location.lng(), 6)+(" ")+String(gps.altitude.meters(),0)+(" ")+String(gps.speed.kmph(),0))+(" ")+String(satelite1); 
  data.close();
  
  
  
  
  
    DelayGPS(100);

  


  
   
  oled.clear();

  }

  static void DelayGPS(unsigned long ms)
{
  unsigned long start = millis();
  do
  {
    while (ss.available())
      gps.encode(ss.read());
  } while (millis() - start < ms);
}

lite library for SSD1306

gps library

Credits

yvesmorele

yvesmorele

9 projects • 30 followers
chemical scientist

Comments