0

I'm trying to read out GPS positions from a serial GPS module I have.

I'm using an Arduino Ethernet and a Haicom HI-204 III GPS (http://www.haicom.com.tw/driver/hi-204iii_usb.pdf).

If I connect the GPS directly to my computer (through a USB-serial converter) at 4800 baud, 8N1, I receive a nice stream of position and diagnostics messages:

$GPGGA,183652.000,5702.0870,N,00954.4732,E,1,06,2.0,20.5,M,42.5,M,,0000*62
$GPGSA,A,3,22,08,27,18,11,32,,,,,,,3.4,2.0,2.7*37
$GPRMC,183652.000,A,5702.0870,N,00954.4732,E,0.00,,310518,,,A*70
$GPGGA,183653.000,5702.0870,N,00954.4732,E,1,06,2.0,20.5,M,42.5,M,,0000*63
$GPGSA,A,3,22,08,27,18,11,32,,,,,,,3.4,2.0,2.7*37
$GPRMC,183653.000,A,5702.0870,N,00954.4732,E,0.00,,310518,,,A*71
$GPGGA,183654.000,5702.0870,N,00954.4732,E,1,06,2.0,20.5,M,42.5,M,,0000*64
$GPGSA,A,3,22,08,27,18,11,32,,,,,,,3.4,2.0,2.7*37
$GPGSV,3,1,12,08,67,204,28,18,59,267,23,10,47,067,26,11,46,279,32*72
$GPGSV,3,2,12,27,36,156,30,01,33,270,20,32,31,116,32,28,26,314,18*79
$GPGSV,3,3,12,22,21,217,33,14,15,140,24,20,09,055,,24,04,038,*7D
$GPRMC,183654.000,A,5702.0870,N,00954.4732,E,0.00,,310518,,,A*76
$GPGGA,183655.000,5702.0870,N,00954.4732,E,1,06,2.0,20.5,M,42.5,M,,0000*65
$GPGSA,A,3,22,08,27,18,11,32,,,,,,,3.4,2.0,2.7*37
$GPRMC,183655.000,A,5702.0870,N,00954.4732,E,0.00,,310518,,,A*77
$GPGGA,183656.000,5702.0870,N,00954.4732,E,1,06,2.0,20.5,M,42.5,M,,0000*66

Now I'm trying to read these messages from the Arduino. But when I connect the GPS to a SoftwareSerial port, I only get gibberish:

:⸮⸮J2⸮⸮>>⸮

(note that when I copy/paste the output to here, many of the charaters disappear, so they are probably completely invalid)

My code looks like this:

#include <SoftwareSerial.h>

#define rxPin 3
#define txPin 4

SoftwareSerial gpsSerial(rxPin, txPin); // RX, TX

void setup (){
  Serial.begin(4800);
  gpsSerial.begin(4800);
}

void loop (){
  while (gpsSerial.available()) {
    char c = gpsSerial.read();
    Serial.write(c);
  }
}

In think the output looks like wrong serial settings, but I have tested all speeds (and verified that 4800 baud works through the serial adapter), and as far as I can tell, SoftwareSerial is 8N1 by default.

What am I doing wrong?

  • What USB adaptor are you using? – Majenko May 31 '18 at 19:44
  • The GPS unit you link to is a USB device, not a serial device. How can you be connecting that through a USB to serial converter? – Majenko May 31 '18 at 19:48
  • Good question :-) The USB unit simply becomes USB because they have a serial to USB-converter on the cable between the GPS and the USB plug. So I cut the cable on the serial side of the converter and connected that to the Arduino. – XerXes May 31 '18 at 20:01
  • So you don't actually have any information about the electrical signalling the unit uses? You need an oscilloscope to examine the signal - see if it's TTL or EIA-232 signalling. If it's the latter you will need to feed it through a MAX232 first. – Majenko May 31 '18 at 20:02
  • Further Googling leads me to the theory that I might need a RS232-to-TTL converter between the GPS and the Arduino. I'm not sure, though, as I supply the GPS with 5 V directly from the Arduino, so there should be no need for a step down from 12 V. – XerXes May 31 '18 at 20:03

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.