GPS Speedometer-display problem

So the GPS is functional. So what's wrong with my sketch?
I understood that it is necessary to have the baud entered correctly for the GPS to work. When I edit the sketch according to the knowledge gained, the display still shows nothing.

Forget the GPS for now. Can you print anything on the display?

No the display still shows nothing even after changing the baud.

So you can't even get it to do "Hello World"?

Try the examples that come with the library. Until you can get it to show something, anything to verify that your code and wiring are correct, it's too early to try to get anything from the GPS on it.

I plan to try it. I am at work now. Can you please look at the sketch in the opening post to see if it is functional? The RX and TX positions are fixed and so is the baud.

It looks plausible, but I've never used one of those displays.

1 Like

:star_struck:
Yes, finally the display lit up. I had a wrong library. I had to try several of them. But I finally got into the stage when my assembly is functional. Thank you all for your advice.
This is what the final sketch looks like:


#include <TM1637TinyDisplay.h>
#include <TinyGPSPlus.h>                  // ve spravci knihoven Arduino IDE
#include <SoftwareSerial.h>               // ve spravci knihoven Arduino IDE
static const int CLK = 3, DIO = 4;        // gpio pripojeni na displej mozno zmenit
TM1637TinyDisplay displej(CLK, DIO);
static const int RXPin = 6, TXPin = 7;    // gpio pripojeni na gps mozno zmenit
static const uint32_t GPSBaud = 9600;

TinyGPSPlus gps;
SoftwareSerial ss(RXPin, TXPin);

void setup() {
  displej.setBrightness(10);              // nastaveni jasu (8-15) podle potreby se musi zmenit
    Serial.begin(115200);

  ss.begin(GPSBaud);                         // rychlost soft serial nelze zmenit
}

void loop() {
  if (ss.available()) {                   // prisli data z GPS na ss port?
    gps.encode(ss.read());                // dekodovat gps vetu
    if (gps.speed.isUpdated()) {          // jsou aktualizovana data rychlosti?
      displej.showNumberDec(gps.speed.kmph(), false); // zobrazi rychlost na displeji. pocatecni nuly vynechany
    }
  }
}

Well done.
Have you designed a housing?

I have an idea, but I still need to modify the model so that everything fits comfortably. It will all look like this.

Internal battery?

Probably not. I dimension the box so that the step down module can also fit in and it will be connected to the on-board power supply in the car. I have already assembled several things from the movie Back to the Future. :blush:

Marty!

Doctor? :grinning:

Now we know why you need the speedometer. You've gotta get back to the future, right?

I'm a fan. :smiley:
I'm still going to look into increasing the display speed. It is now 1Hz. I found a topic that dealt with this, but there is no result.

Usually, you can tell the GPS (over software serial) to send data more frequently.

I have read this whole thread but there is no message that the modification helped. So what is the correct course of action?

Try it - you just need to send the appropriate UBX command to the GPS and it looks as though the ones you need are specified in the thread you linked. Can your model of the GPS do faster updates - not all of them can.

1 Like

Marty, there's a big difference between what we read about the theory of GPS devices & the packaged examples and what can be achieved in practice. There is a significant timing issue when the Arduino code interacts with the asynchronous data stream from the GPS. People have found that data is lost and it is difficult to zero in on the reasons. Software serial is the slowest step in the data flow and if you use print statements for debugging that interferes with the data flow.

You need to get familiar with the u-center software from u-blox. It's the best way to monitor the GPS and configure it. You can use it to change the output frequency and disable sentences you don't need. You'll find out if you can configure your module or it's one that doesn't respond to config commands.

Even at 1Hz it can be difficult to know for certain that no data is being lost. TinyGPS++ only does a checksum on complete sentences -- it doesn't report on lost bytes. What are the implications for you if the speed displayed is "old" and not correct?

I've come a long way. I'll try it. My module should be able to do that. If I'm not successful, I'll go back to the working setup.