Loading...
Pages: [1]   Go Down
Author Topic: Small GPS problem  (Read 492 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey,
I recently bought the LEA-6H smart. Now I want to connect it to my Arduino.
http://www.rfdesign.co.za/pages/5645456/Products/GPS-Products/Receiver-Boards.asp

So I plugged the 5V to 5V and the gnd to gnd and the TTL out to my arduino uno pin3.

I user the software serial library and im reading in the data, but the data comes in as random junk.
What format do I get the data in. I thought it comes in as BYTE.
I tried a baud rate of 9600 and 4800 on my software serial library that reading in data.
So this is what i used. Serial.print(mySerial.read(), BYTE)

char c = (char)mySerial.read();

what must I wrote to get the proper format. Sorry this must be really dumb question. But I tried alot of things.

Further, (Serial.print(mySerial.read(), BYTE))I dont know why but my arduino 1.0 IDE does not support this so I used the arduino 0022 IDE and it recognises that.



Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 50
Posts: 3457
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If the output is NMEA0183, then the baud should be 4800.

I would try this. The Serial.write function will not translate anything, so I found it to be faster.

Code:
while(mySerial.available())
{
   Serial.write(mySerial.read());
}

edit: The datasheet shows the default setting at 9600 baud. In that case you might want to increase the baud rate of your Serial port.
« Last Edit: April 14, 2012, 01:59:28 pm by SurferTim » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

×µU•›:;;;;;;;;;­UË+ë·q_SWq§§§§§§§§§c«™Ÿåë·q_qq}§§§§§§Ÿ§ŸŸ§£§§§§§§«—åë·q_qY}§}§§§§§§§§

This is my output.


#include <SoftwareSerial.h>
#include <TinyGPS.h>
#define rxPin 3
#define txPin 7


// set up a new serial port
SoftwareSerial mySerial =  SoftwareSerial(rxPin, txPin);

void setup()  {
  // define pin modes for tx, rx, led pins:
  pinMode(rxPin, INPUT);     
  // set the data rate for the SoftwareSerial port
  mySerial.begin(9600);
  Serial.begin(9600);
 
}
void loop()
{
  if(mySerial.available() > 0)
  {
      Serial.write(mySerial.read());
  }
}
I tried setting baus rate of mySerial to 4800 and 9600 for the the combination on my Serial 4800 9600 57600 115200. I also changed the baud rate on the monitor to the appropriate Serial baud rate. For each I get similar output like the one above. For each I get junk.

Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 316
Posts: 35566
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
SoftwareSerial mySerial =  SoftwareSerial(rxPin, txPin);
You have a mySerial connected to these pins? Or a GPS?

If you have a GPS, why not name the SoftwareSerial instance gps, so it is clear what the instance is for?

Which GPS is it?
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 277
Posts: 25566
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
So I plugged the 5V to 5V and the gnd to gnd and the TTL out to my arduino uno pin3.
That link say the TTL output is only produced if you set an optional link, have you done this as well. Otherwise you are trying to read RS232 signals and they are inverted and +12V and -12V
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That link say the TTL output is only produced if you set an optional link, have you done this as well. Otherwise you are trying to read RS232 signals and they are inverted and +12V and -12V

optional link? No I have not. Didnt know I had to do that.

How do I connect the ('optional link')?



Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The way I see it if you use the GND next to the 5V, you using the rs232 and the GND by ttl out u are using TTL?
I dont think u need a jumper.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 277
Posts: 25566
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The only way to be sure is to measure it, preferably with an oscilloscope. The signal should be normally high at 5V and go down to 0V when data is being transmitted. You could test this with an LED if you are careful but a scope is the best.
From the look of what you are getting you have an upside down signal.
Logged

Pages: [1]   Go Up
Print
 
Jump to: