RC LOGGERSTATION - GPS Data Logger for RC Plane

by yves.morele | September 16, 2020 | (2) Posted in Projects

This project describes a low cost GPS data logger for rc aircraft,  light weight and small for put in in a radio controlled plane.

the power for arduino must be made by the battery of the plane to have less weight on the plane and with a small size.


 CHOICE OF MATERIAL :

My choice is,

For the microcontroller : Arduino nano generic

For the screen : SSD 1306 oled display

For the GPS : UBLOX NEO-6M V2

For the sd card reader/writer : generic but the less weight as posssible

For the box : ABS box

I made this choice so as to have the smallests components possible (I did not choose the arduino micro for lack of memory) and with the least weight.

Despite this I was forced to use a lite library for the OLED screen otherwise I saturate the dynamic memory and made the arduino unstable.


 ASSEMBLING :

The wiring must be done with the minimum length of wire and without the connectors on the electronic cards so as to lighten the final assembly to the maximum.

DISPLAYING :

On the display for not saturating the dynamic memory of the arduino nano, I am just putting the interesting informations.

In the booting sequence, I am displaying the home screen and after, if the sd card is ready for recording the trajectory. after that the screen display max speed, max height and the numbers of sattelite.

PROGRAMMING :

// 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);
}

RESULT :
I put the prototype in one of my gliders, and for comparison I put also a Canmore GPS GT-730FL data logger.
In the next video you can see the accurate of the values between the two system.
The data can be import in google earth for visualisation of the trajectory of the plane.



COMMENTS

Helijatek on October 20, 2020
Excellent article! Just what I was looking for.
Log In to reply
yves.morele on October 20, 2020
Thank's
Log In to reply

You need to log-in to comment on articles.


RC LOGGERSTATION - GPS Data Logger for RC Plane