Arduino GPS GT-U7 speedometer

Hello!

Im currently trying to make speedometer using a GT-U7 GPS Module GPS with an ardunio nano. Im following a writeup from [DIY Arduino GPS Speedometer using OLED]. Im having an issue where when I try to actually read my relative speed, it constantly displays "No data" after passing failing to pass the " if (gps.speed.isValid())" statement. Im very new to this, and am open to all criticism. I modified the code just to work with serial printing. The code is below

#include <TinyGPS++.h>
#include <SoftwareSerial.h>
#include <Wire.h>
#include <Adafruit_SH1106.h>
#define OLED_ADDRESS   0x3C
#define OLED_RESET -1
Adafruit_SH1106 display(OLED_RESET);
int RX = 0, TX = 1;
TinyGPSPlus gps;
SoftwareSerial gpssoft(RX, TX);
void setup()
{
  Serial.begin(9600);
  gpssoft.begin(9600);
}
void loop()
{
  Serial.print("working");

  while (gpssoft.available() > 0)
    if (gps.encode(gpssoft.read()))
      displayspeed();
  if (millis() > 5000 && gps.charsProcessed() < 10)
  {
    Serial.print("Error!!!");
    while (true);
  }
}
void displayspeed()
{
  if (gps.speed.isValid())
  {
;
    Serial.print("working");
    
  }
  else
  {
    Serial.print("No Data!!!");    
  }
  delay(100);
}

I used another program example just to make sure the gps was working properly, which is listed here [TinyGPSPlus/SatelliteTracker.ino at master · mikalhart/TinyGPSPlus · GitHub]

This program working fine with my gps. Im not exactly sure whats going wrong. Any input would be helpful.

The hardware serial port ( via the USB) is used by the pins you have setup with software serial, that maybe an issue .

You need a serial port for your serial print and a different port for the gps module .

Setup software serial on different pins and connect the gps to that

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.