Problem with Venus GPS connecting to Arduino

I’m trying to connect a Arduino Pro 3.3v with a Venus GPS . I’ve got the GPS module configure correctly, and when I hook it up directly to the serial port (via an FTDI converter) it works great. So I hooked it up to the Arduino and wrote a simple test program, but its not reading correctly.

The first program I wrote was with SoftwareSerial, but the char read is always garbage. I would almost guess that it was the wrong baud rate, except I verified it was 38400 with the FTDI to the serial port.

#include <SoftwareSerial.h>
int rxPin = 2;
int txPin = 3;
SoftwareSerial gpsSerial =  SoftwareSerial(rxPin, txPin);

void setup()
{
  pinMode(rxPin, INPUT);
  pinMode(txPin, OUTPUT);
  Serial.begin(9600);
  gpsSerial.begin(38400);
}

void loop()
{
  char c;
  c = gpsSerial.read();
  Serial.print(c);
}

I tried the same thing using NewSoftSerial, but gpsSerial.available() never returns true, so it never reads.

#include <NewSoftSerial.h>
int rxPin = 2;
int txPin = 3;
NewSoftSerial gpsSerial =  NewSoftSerial(rxPin, txPin);

void setup()
{
  pinMode(rxPin, INPUT);
  pinMode(txPin, OUTPUT);
  Serial.begin(9600);
  gpsSerial.begin(38400);
}

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

I’m new to the Arduino, and I’m not sure if this is a hardware or software problem, but any help would be appreciated.

http://www.arduino.cc/en/Reference/SoftwareSerial

SoftwareSerial only works effectively at baud rates 9600bps and below according to that page. Try using the venus software to drop the baud rate to 9600 and see if that works better for you. :slight_smile:

edit:

I bet these could help you too!

GPS library for arduino:

http://arduiniana.org/libraries/tinygps/

I believe this software serial library will operate better with higher baud rates:

http://arduiniana.org/libraries/newsoftserial/

Ok, I missed that about the 9600 max baud rate with the SoftwareSerial library. Thanks.

In my second example above I used the NewSoftSerial, but the available() method never returns true. Any ideas why that might be?

Make sure your pin 2 (RX) is hooked up to the TX line of the GPS and make sure both devices are grounded together.

Is it a 3.3V GPS device? TTL logic?

If so, available() should work.

Mikal

The Venus GPS is a 3.3v device, and I’m using the 3.3V TTL UART interface.

Oops, missed that you used were using that in the second example… sorry, been busy… and I’m tired.

Just off a hunch, try removing

pinMode(rxPin, INPUT);

pinMode(txPin, OUTPUT);

So I tried something else tonight. I wired the UART interface from the Venus GPS to the hardware serial interface on Arduino, and then wired the Rx/Tx lines on the FTDI to pins 2 & 3. This works, but I’d much rather do it the other way.

#include <NewSoftSerial.h>
int rxPin = 2;
int txPin = 3;
NewSoftSerial logSerial = NewSoftSerial(rxPin, txPin);

void setup()
{
  Serial.begin(38400);
  logSerial.begin(9600);
}

void loop()
{
  char c = Serial.read();
  logSerial.print(c);
}

macpod:
Oops, missed that you used were using that in the second example… sorry, been busy… and I’m tired.

Just off a hunch, try removing

pinMode(rxPin, INPUT);

pinMode(txPin, OUTPUT);

I wanted to let you know that I tried this as well with my original example with no success.

Oh, you didn’t drop the baud rate yet on the venus. For 8Mhz arduinos (like your 3.3v arduino pro), try at a MAX a baud rate of 28800 with newsoftserial.

So a bit of an update. When I originally configured the Venus with the Skytraq GPS Viewer software, I set the update rate to 10Hz and the baud rate was automatically moved to 38400. Which agrees with what the white papers say. However if you configure the NMEA messages to only send GPRMC messages, you can then drop the baud rate to 9600, but still keep the 10Hz update rate.

So that part of my project is working great now. However, now I’m having problems logging the data to a micro SD card. Check out my other thread for details on that:

viewtopic.php?t=19781

So, were you able to do it without the FTDI? I’m trying right now, so if you could paste the code, it’d be great. Thanks!

Laura