1

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~~
4™5f3y=›ùÙ)É9Ӧ̙¦ ...

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?

3 Answers 3

1

I looked up the datasheet and product specs for the GPS device. It says that the output is RS-232. Note that RS-232 is NOT compatible with the Arduino levels. Arduino "talks and listens" at 5V or 3.3V depending on which board you're using. So what you need is a RS-232-to-TTL converter. Now, TTL speaks Arduino. So Arduino will be able to understand that. So try using a MAX232 IC or a shield, whichever you're comfortable with.

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. 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. 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. Sep 2, 2016 at 16:20
  • No worries, @AjayPrabhu. Thank you very much for helping. 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. Sep 2, 2016 at 18:05
1

You can get 5V TTL USB serial adaptors. The classic being an FTDI one. Also you can get the MAX chip level converters as a tiny module, if you already have a normal RS232 adaptor. I would recommend connecting the GPS to your PC as a reality check. The garbled that you are seeing is typical Baud rate issues.

Also there can be polarity issues with the signal. (Not sure if you can switch the pin polarity of the Arduino in software.) So if you are connecting to a standard RS232 adaptor I think the MAX chips are available in inverting and none inverting versions.

Some PC RS232 adaptors are 5V tolerant. Google this for confirmation. You should just connect the GPS tx to the PC RX if you try this. (And 0V obviously.)

1

In the comments I see that is not clear how you connect the module in your arduino. The native mode is PS2 (old mouse and keyboard) you can use that directly with your arduino (PS2 protocol is 5v too), for this, you need implement a clock/data protocol. If you use the rs-232 converter, notice that RS-232 as a amplitude from -12v ~ 12v this burn your arduino, so you need use a rs232-ttl converter.

Serial software are not a good choise, if you use that, save your data in a buffer and write only one time, in the end.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.