Getting GPS data from USB, but not serial

I have one of these GPS modules https://a.co/d/ev8gpLa that I'm trying to use to get time information into my project.

The module spits out data just fine over its USB connection, acquires a fix quickly, etc.; but I cannot for the life of me get it to output usable data from the breakout pins that my arduino uno can read.

It does seem to be sending data, but it's rendered on my serial monitor as a string of mostly □ and �. I assume that's why I can't get my project to parse it with TinyGPS++ and do anything.

I've tried several different baud rates, but I would assume that the baud rate would be the same as the USB one (9600) and that's what my serial monitor is set to.

Welcome, Nathan!
Best for you to read

but first, please post your code in code tags (click on the word "code" at the top of the message box) so we can take a look while you're reading the helpful advice!

#include <SoftwareSerial.h>
SoftwareSerial mySerial(10, 11); // RX, TX

void setup() {
  Serial.begin(9600);
  mySerial.begin(9600);
}

void loop() {
  if (mySerial.available()) {
    char receivedChar = mySerial.read();
    

    Serial.print(receivedChar);
  }
}

I've used various testing programs trying to get it to output something useful, this is my current diagnose code.

nathanthezealot,
I can confirm that your code works, and correctly displays NMEA sentences (after adjusting for the pins my GPS receiver is connected to).

So the problem must lie somewhere else.

Have you got the TXD pin of the GPS module connected to the RX pin (10) of your SoftwareSerial, and the RXD pin of the GPS module connected to the the TX pin (11) of your SoftwareSerial?

How did you test this? With a computer?

It's a USB Device, so it will need your Arduino to act as a USB Host.

Which Arduino UNO do you have?
R3 and earlier don't have native USB Host; R4 may have ...

That usually indicates that the baud rate is wrong.

https://learn.sparkfun.com/tutorials/serial-communication/all#common-pitfalls

Not necessarily - "Baud Rate" doesn't really have meaning over USB

You are connecting to a 3.3V device, so be careful connecting the Arduino Tx line. The GPS does appear to have 510 ohm series resistors in the Rx/Tx lines, so its doubtful you will damage anything with a 5V signal.

Did you try 4800 baud? Only change the baud rate on the SoftwareSerial port, leave the Serial port at 9600 (although it would be better to set Serial and the serial monitor to a high baud rate, I usually run 115200).

You can simply leave the Arduino TX pin disconnected to avoid this problem - the code does not transmit any data to the GPS module.

2 Likes

I've tried both pins to be sure, what limited documentation there is for this module made it unclear which pin is which.
I didn't see that part about 3.3v vs 5v, so I worry I've cooked something in the module. I've ordered another GPS module of a different type, we'll see if I can find something with that.
Thanks for the help.

Good GPS problem solving tutorial: My GPS does not work | StuartsProjects

I picked up a different GPS module and it seems to work fine, so I assume it was either faulty or I cooked something with the wrong voltage.

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