MTK3339 GPS with Arduino Leonardo
Moderators: adafruit_support_bill, adafruit

MTK3339 GPS with Arduino Leonardo

by fran.manez on Fri Feb 01, 2013 12:24 pm

Hi,

I'm testing the MTK3339 GPS with Arduino Leonardo and is not working.

I followed this tutorial: http://learn.adafruit.com/adafruit-ulti ... ter-wiring, I load a 'blank' sketch into the Arduino, but when I open the serial monitor from the Arduino IDE I don't view any data.

Attached is a picture with my wiring

Can you help me with my problem?

Thanks!!
Attachments
wiring.JPG
wiring.JPG (51.93 KiB) Viewed 1897 times
fran.manez
 
Posts: 4
Joined: Fri Feb 01, 2013 11:53 am

Re: MTK3339 GPS with Arduino Leonardo

by adafruit_support_rick on Fri Feb 01, 2013 4:36 pm

Looks right. Have you set the data rate in the serial monitor to 9600?

Try different jumper wires or different breadboard locations. Sometimes the connections can be a little finicky.

adafruit_support_rick
 
Posts: 12938
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: MTK3339 GPS with Arduino Leonardo

by dennisma on Fri Feb 01, 2013 7:30 pm

I don't have this particular GPS but doesn't the TX pin on the Arduino go to the RX pin on the GPS (and Arduino's RX go to the GPS's TX).

From the pic it looks like RX is going to RX and TX is going to TX (which is normally wrong).

Or maybe it is just late on Friday and I can't tell...
User avatar
dennisma
 
Posts: 31
Joined: Fri Feb 01, 2013 5:39 pm

Re: MTK3339 GPS with Arduino Leonardo

by fran.manez on Sat Feb 02, 2013 4:41 am

driverblock,

I set the the data rate in the serial monitor to 9600. And I have changed the jumper wires and the breadboard locations... and not working yet.
It's possible that the GPS module is damaged or defective?

I tried to load the other examples in the tutorial and not working.

The GPS fix light flashes every second. Then changes to flash every 15 seconds ... this is correct?

______

dennisma,

the connections are correct. They are the same as in the tutorial:
// Connect VIN to +5V
// Connect GND to Ground
// Connect GPS RX (data into GPS) to Digital 0
// Connect GPS TX (data out from GPS) to Digital 1
fran.manez
 
Posts: 4
Joined: Fri Feb 01, 2013 11:53 am

Re: MTK3339 GPS with Arduino Leonardo

by dennisma on Sat Feb 02, 2013 10:33 am

fran.manez wrote:driverblock,
the connections are correct. They are the same as in the tutorial:
// Connect VIN to +5V
// Connect GND to Ground
// Connect GPS RX (data into GPS) to Digital 0
// Connect GPS TX (data out from GPS) to Digital 1


Yes, but that appears incorrect. Digital 0 is RX and it always connects to TX on a GPS. The Transmit (TX) line of the GPS must connect to the Receive (RX) of the Arduino. That is normally how GPS's hook up

If you do not believe me (and why should you?), look at Adafruit's wearable GPS wiring instructions at http://learn.adafruit.com/flora-wearabl ... ook-up-gps

It says: "Likewise connect RX to TX and TX to RX..."

See the wiring from same page:
Image

Now look at your board. You have Digital 0 (RX) connected to GPS RX. It won't work.

Also look at this wire hookup from the net. Notice that Digital Pin 0 (RX) is connecting to TX. Also note that Pin 1 is not connected because it doesn't need to be. You never talk to the GPS, you just receive the NMEA sentences from it.

Image
User avatar
dennisma
 
Posts: 31
Joined: Fri Feb 01, 2013 5:39 pm

Re: MTK3339 GPS with Arduino Leonardo

by adafruit_support_rick on Sat Feb 02, 2013 11:15 am

Dennisma is correct. The picture in the tutorial shows the wrong wiring on Tx and Rx. Swap the green and orange wires on the Leonardo.

Meanwhile, I'll see about fixing the tutorial...

adafruit_support_rick
 
Posts: 12938
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: MTK3339 GPS with Arduino Leonardo

by dennisma on Sat Feb 02, 2013 2:37 pm

driverblock wrote:Dennisma is correct. The picture in the tutorial shows the wrong wiring on Tx and Rx.


Always good to know I am not going crazy... yet.

fran.manez let us know how it works out for you.
User avatar
dennisma
 
Posts: 31
Joined: Fri Feb 01, 2013 5:39 pm

Re: MTK3339 GPS with Arduino Leonardo

by adafruit_support_rick on Sat Feb 02, 2013 4:05 pm

Wait... wait a minute....

We're all wrong!! :shock: :roll: :oops:

@dennisma - the tutorial step the OP is doing calls for Direct Writing to the computer. For this purpose, wiring TX to TX and Rx to RX is actually correct, since the idea is to bypass the ATmega328 and go straight to the USB interface chip.

@fran.manez - you are using a Leonardo, which doesn't have a separate USB interface chip. The Direct Wiring to Computer step cannot be done with a Leonardo, since it relies on a trick of the Uno (and earlier) hardware design.

Just skip this step and go on to the next one.

adafruit_support_rick
 
Posts: 12938
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: MTK3339 GPS with Arduino Leonardo

by dennisma on Sat Feb 02, 2013 4:17 pm

driverblock wrote:We're all wrong!! :shock: :roll: :oops:


Ha! You are correct. I should have looked at what the Tutorial was doing. It was all empty code.

Dang Leonardo's and their wacky serial. Sorry fran.manez
User avatar
dennisma
 
Posts: 31
Joined: Fri Feb 01, 2013 5:39 pm

Re: MTK3339 GPS with Arduino Leonardo

by adafruit_support_rick on Sat Feb 02, 2013 5:31 pm

@fran.manez - I just went through the tutorial, and the example sketches on GitHub are not compatible with the Leonardo. The GPS library works - it's just an issue with the way the example sketches are written.

I plan to update the sketches for the Leonardo over the weekend. Thanks for your patience.

Meanwhile, I hacked up a quick and dirty fix to the echo sketch, which you are welcome to try (attached).

All you have to do is swap the connections to TX and RX:
GPS Tx -> Leo RX1
GPS Rx -> Leo TX1

Set the serial monitor for 57600.

Leo_echo.zip
(1.52 KiB) Downloaded 88 times

adafruit_support_rick
 
Posts: 12938
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: MTK3339 GPS with Arduino Leonardo

by fran.manez on Sun Feb 03, 2013 6:16 am

@driverblock - great!! is working now!! thank you very much. Your code working perfectly.
Let me know when you update the sketches for the Leonardo

@dennisma - thanks for your help :D
fran.manez
 
Posts: 4
Joined: Fri Feb 01, 2013 11:53 am

Re: MTK3339 GPS with Arduino Leonardo

by adafruit_support_rick on Tue Feb 05, 2013 1:04 pm

Example sketches for Leonardo have been added to the Adafruit GPS LIbrary

adafruit_support_rick
 
Posts: 12938
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: MTK3339 GPS with Arduino Leonardo

by scapec on Mon May 06, 2013 6:34 am

Maybe I can get some help as well.

I'm also currently using this particular GPS. However, I want to format the text I receive from the command

Serial.print(GPS.latitude, 4); Serial.print(GPS.lat);

The output is in this form = 5533.7563N, 1300.2744E.

I would like it to be in this form = 55 33.7563N, 13 00.2744E.

Any suggestions?

//

Best Regards
scapec
 
Posts: 1
Joined: Mon May 06, 2013 6:04 am

Re: MTK3339 GPS with Arduino Leonardo

by adafruit_support_rick on Mon May 06, 2013 8:04 am

Try this:
Code: Select all | TOGGLE FULL SIZE
      Serial.print("Location: ");
      int GPSdegrees = (int)(GPS.latitude/100);
      Serial.print(GPSdegrees); Serial.print(" "); Serial.print(GPS.latitude-GPSdegrees, 4); Serial.print(GPS.lat);
      Serial.print(", ");
      GPSdegrees = (int)(GPS.longitude/100);
      Serial.print(GPSdegrees); Serial.print(" "); Serial.print(GPS.longitude-GPSdegrees, 4); Serial.println(GPS.lon);

adafruit_support_rick
 
Posts: 12938
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY