Hackster is hosting Hackster Holidays, Ep. 6: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Monday!Stream Hackster Holidays, Ep. 6 on Monday!
vinay y.n
Published © GPL3+

Tiny GPS GNSS Module Interfacing With Microcontroller

Interfacing ultra-low power REYAX RYS8830 GNSS Module with Microcontroller.

BeginnerFull instructions provided5 hours607
Tiny GPS GNSS Module Interfacing With Microcontroller

Things used in this project

Hardware components

RYS8830
×1
0.96" OLED 64x128 Display Module
ElectroPeak 0.96" OLED 64x128 Display Module
×1
NodeMCU ESP8266 Breakout Board
NodeMCU ESP8266 Breakout Board
×1
Logic Level FET N-Channel
Logic Level FET N-Channel
×1
Resistor 10k ohm
Resistor 10k ohm
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Solder Wire, Lead Free
Solder Wire, Lead Free

Story

Read more

Schematics

Schematics

used Jumper wires to connect the development board to the microcontroller

Code

CODE TO INTERFACE RYS8830 WITH MICROCONTROLLER

Arduino
CODE TO INTERFACE RYS8830 WITH MICROCONTROLLER
#include <TinyGPS++.h>
#include <SoftwareSerial.h>
static const int RXPin = D5, TXPin = D6;
static const uint32_t GPSBaud = 115200;
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
// The TinyGPS++ object
TinyGPSPlus gps;

// The serial connection to the GPS device
SoftwareSerial ss(RXPin, TXPin);
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);
void setup()
{
  Serial.begin(115200);
  ss.begin(GPSBaud);
ss.print("@GSTP\r\n");//positioning stop
  delay(500);  
  ss.print("@GNS 47\r\n");// Positioning-use satellite use GPS + GLONASS + SBAS + QZSS L1-CA + QZSS L1-S
  delay(500); 
 // ss.print("@GPPS 1\r\n");// enable 1PPS function
 // delay(500); 
  ss.print("@GSR\r\n");// hot start
  delay(2000);

  if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { // Address 0x3D for 128x64
    Serial.println(F("SSD1306 allocation failed"));
    for(;;);
  }
  delay(2000);
  display.clearDisplay();
  
}

void loop()
{
  // This sketch displays information every time a new sentence is correctly encoded.
  while (ss.available() > 0)
    if (gps.encode(ss.read()))
      displayInfo();

  if (millis() > 5000 && gps.charsProcessed() < 10)
  {
    Serial.println(F("No GPS detected: check wiring."));
    while(true);
  }
}

void displayInfo()
{
  Serial.print(F("Location: ")); 
  if (gps.location.isValid())
  {
    Serial.print(gps.location.lat(), 6);
    Serial.print(F(","));
    Serial.print(gps.location.lng(), 6);
  }
  else
  {
    Serial.print(F("INVALID"));
  }

  Serial.print(F("  Date/Time: "));
  if (gps.date.isValid())
  {
    Serial.print(gps.date.month());
    Serial.print(F("/"));
    Serial.print(gps.date.day());
    Serial.print(F("/"));
    Serial.print(gps.date.year());
  }
  else
  {
    Serial.print(F("INVALID"));
  }

  Serial.print(F(" "));
  if (gps.time.isValid())
  {
    if (gps.time.hour() < 10) Serial.print(F("0"));
    Serial.print(gps.time.hour());
    Serial.print(F(":"));
    if (gps.time.minute() < 10) Serial.print(F("0"));
    Serial.print(gps.time.minute());
    Serial.print(F(":"));
    if (gps.time.second() < 10) Serial.print(F("0"));
    Serial.print(gps.time.second());
    Serial.print(F("."));
    if (gps.time.centisecond() < 10) Serial.print(F("0"));
    Serial.print(gps.time.centisecond());
  }
  else
  {
    Serial.print(F("INVALID"));
  }

  Serial.println();
  display.setTextSize(1);
  display.setTextColor(WHITE);

 
  

  display.setCursor(0,10);
  display.print("Latitude:");
  display.print(gps.location.lat(), 6);
  display.setCursor(0,30);
  display.print("Longitude:");
  display.print(gps.location.lng(), 6);
  
  display.display(); 
  delay(1000);
  display.clearDisplay();
}

Credits

vinay y.n

vinay y.n

26 projects • 45 followers
An electronic product engineer with 8 years of experience in the field. The passion for electronics began as a hobby 11 years ago.

Comments