serial communication GPS

Hi all,

I have a problem with a serial communication that I'm trying to set up. I have a GPS module (navman 1220A), which uses standard NMEA protocol. It communicates with a serial connection, 4800 bps. I hooked it up to a (seperate) 12 V power source, connected the NMEA ground to Arduino ground, and data out to Arduino pin 0 (Rx).

Than I set up a sketch which simply repeats the serial in signal (using Serial.read()) to the computer (using Serial.println()). Problem is, there is no signal to be seen. The serial monitor on my computer displayes nothing. The serial connection to my computer is ok (tested that) but it seams that the NMEA signal is not coming through.

Any ideas / suggestions?

Thanks, Jzz

Hi,

Thanks for the prompt reply. The solution seems logical enough, but does not seem to work. I have a Duemilanove, btw.

I have set up the example from the Arduino website:
http://arduino.cc/en/Reference/SoftwareSerialExample

and adapted it. I have set up the ‘normal’ serial port as well (Serial.begin(4800)) and use Serial.print(somechar, DEC) instead of mySerial.print(somechar). The serial monitor just spits out zero’s.

So still nothing. it is possible to use the normal serial port AND a SoftwareSerial port, isn’t it?

Jzz

The SoftwareSerial class is obsolete. You might have better luck using NewSoftSerial.

Hi all,

I have tried to use NewSoftSerial, but got some vague error message on compiling. Haven't had the time to get into it more deeply and I have some nightshifts now, so in a few days will try again. Thanks for replying though.

Jzz

Hi,

I tried the NewSerialSoft library, but can’t seem to get it to work. I get the following compile error. Seems off topic (in hardware) but anyway:

o: In function `setup':
undefined reference to `NewSoftSerial::NewSoftSerial(unsigned char, unsigned char, bool)'

My sketch:

// include the SoftwareSerial library so you can use its functions:
#include <NewSoftSerial.h>

// set up a new serial port
NewSoftSerial mySerial(2, 3);

void setup()  

{

  mySerial.begin(4800);

  mySerial.println("Hello, world?");

  Serial.begin(4800);

  Serial.println("Goodnight moon!");


}


void loop() {


  if (mySerial.available()) {

      Serial.print((char)mySerial.read());

  }

}

The error occurs while the compiler crosses the mySerial.begin(4800); line.

Any suggestions, or should I post in another forum (software)?

Ok, cleared that. I moved the NewSoftSerial library to the standard library folder and it compiles w/o errors. Don't ask me why.

The original problem persists, however. No serial input whatsoever from the software serial port. What is wrong?

The GPS antenna is much like a gps unit from Sparkfun. The only difference is that i connected the GPS to a different power source than the Arduino. The serial ground is connected to Arduino ground and the serial in connected to pin 2 (which is declared in the software serial port).

Any more suggestions?

Put an LED and 1K resistor across the input and see if it is flashing. This checks if there is a signal coming from your GPS and making it into the arduino.

After that check the baud rates.

Good one, I’ll try that. The baud rates should be ok, both are 4800 bps.

Ok, one step further. After it didn't work last time I fiddled with the wiring and it ended up in the wrong way. Now I have NMEA (serial) out of the antenna on pin 2 for sure.

I hooked up a led like Grumpy_Mike suggested, and yes it is flashing. I also get Serial feed to the computer now, but it is all gibberish. This suggests a baud rate problem I think, but I don't see how. The antenna manual says:

0-5V, 4800 bps,8,N,1

As I understand, 0-5V is what Arduino expects, 4800 bps is the baud rate that I set. The rest of the numbers refer to the amount of bits, the parity bit and the stop bit, right? These are standard aren't they?

Any more suggestions?

PS: some of the gibberish:

?§}§??£“'§c§????“£??§u§?£???§?£?§?“?“??§£?§u«'wåëÜ}mEµ-彝eû?;Û«v–Öv
v¶Öv
vÖ¶vövö¶v
vÖ6vöv¶ÖvÚvÖöv6vöVvövÖvv¶¶vÖV·ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ[×
ÅõuûÛö–¶vVÖ¶ö6íl,Yv6ëíö––66Ö,ÖövVu;û?vÖ6ö¶vV­¶6vvVëíYÙ´³ZÖÚÚÚ²²y=Ûq_qY}§}§?§??§??§?§?§??§?§§§§§§§£??§£??§£“«?}åënq_qYS§?§§?§?§?§?'§?§??§'?§?'§—?§?§“?§?“§—§??§?§?'§?«'}åënq_qYS§?§?§?§?§??§'?§?§??§“§?—?§??§?§?§?“§??§“§—§?§??«'?åënq_qYS§?§?§?§??§?§??—§??§?§?§?—?§??§??§?“§??§??§—§?§?§??«'wåënq_[ey§????§}§??£“'§c§????“£??§u§?£???§?£?§?“?“??§£?§u«'uåëÜ}mEµ-彝eû;?;Û«v
v–Öv
v¶Öv
vÖ¶vövö¶v
vÖ6vöv¶Öv-ìÚY³ÚvÖöv6vöVvövÖvv¶¶vÖV·

So all on one line (no line breaks)

MOD:

Yess!!!

Solved it, turns out the signal wás inverted after all. I adapted the NewSoftSerial call accordingly (NewSoftSerial gps (2, 3, true);) and now it works like a charm!

Thanks for all the input!!!

Jzz

One last question, do I have to set this topic as solved somehow or is that not possible/nessesary?

Jzz

Not necessary on this forum threads sort of just fizzle ou.......