Skip to main content
Arduino

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

Garbled serial from GPS device

I'm using an Arduino Uno. "Regular" serial is plugged into my computer, and I can receive just fine.

I'm using AltSoftSerial (tried SoftwareSerial, same results) with RX and TX on pins 8 and 9 to interface with a BR-355S4 GPS module. According to the data sheet on that module, the RX and TX are at 5v, which I believe is what the Arduino expects.

I combined the Serial and SoftwareSerial examples to test the connectivity from the Arduino to my PC and from the GPS to the arduino.

#include <AltSoftSerial.h>
AltSoftSerial altSerial;
void setup() {
 //Initialize serial and wait for port to open:
 Serial.begin(19200);
 while (!Serial) {
 ; // wait for serial port to connect. Needed for native USB port only
 }
 printAsciiTable();
 altSerial.begin(4800);
}
void printAsciiTable(){
 Serial.println("ASCII Table ~ Character Map");
 int thisByte;
 for(thisByte = 33; thisByte < 127; thisByte++){
 Serial.write(thisByte);
 Serial.print(", dec: ");
 Serial.print(thisByte);
 Serial.print(", hex: ");
 Serial.print(thisByte, HEX);
 Serial.print(", oct: ");
 Serial.print(thisByte, OCT);
 Serial.print(", bin: ");
 Serial.println(thisByte, BIN);
 }
 Serial.println("~~Done with ASCII Table~~");
}
void loop() {
 char c;
 if(altSerial.available()){
 c = altSerial.read();
 Serial.print(c);
 }
}

The data coming into the Serial Monitor tool looks fine until it starts pulling from the GPS serial stream (ellipses added by me):

...
|, dec: 124, hex: 7C, oct: 174, bin: 1111100
}, dec: 125, hex: 7D, oct: 175, bin: 1111101
~, dec: 126, hex: 7E, oct: 176, bin: 1111110
~~Done with ASCII Table~~
4TM5f3y=›ùÙ)É9Ó¦ÌTM¦ ...

I would like to receive the correct NMEA strings from the GPS module on altSerial and push them out to Serial. The garbled nature of the serial data looks like a baud rate issue, but I've tried a handful of combinations for Serial and altSerial speed with no success. Any ideas?

Answer*

Draft saved
Draft discarded
Cancel
5
  • This might be the case, but it also might not. Can you say where you found the "datasheet" that lead you to conclude this? Most of the information seems to be quite non-specific, so it's hard to be certain if the device itself uses RS232 signalling, or if they merely make a cable adapter available that converts between their undocumented proprietary signalling and proper RS232, just as they seem to make one which converters it for use with USB. Commented Sep 2, 2016 at 6:47
  • The model I bought is not using RS-232. Check the data sheet I linked in the initial question and search for "voltage," you'll see that it's using 5v for TX and RX. Commented Sep 2, 2016 at 13:48
  • I may have I jumped to a conclusion too quickly. The PS/2 to RS-232 cable set for PS/2 to RS232 conversion is what got me thinking. [link] usglobalsat.com/store/… . You can see that the TX and RX pins go directly to the RS-232 connector. With not much info available in the "datasheet" I made the assumption that it uses RS-232. I apologize for not being too clear about how I came to the above answer. Commented Sep 2, 2016 at 16:20
  • No worries, @AjayPrabhu. Thank you very much for helping. Commented Sep 2, 2016 at 17:42
  • I spent some time looking around if anyone interfaced the same with arduino or any microcontroller. I found this project. You might want to take a look at this [link] (danceswithferrets.org/geekblog/?p=482). Hope this helps. Commented Sep 2, 2016 at 18:05

lang-cpp

AltStyle によって変換されたページ (->オリジナル) /