MTK3339 GPS with Arduino Leonardo

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
fran.manez
 
Posts: 4
Joined: Fri Feb 01, 2013 11:53 am

MTK3339 GPS with Arduino Leonardo

Post by fran.manez »

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 3716 times

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: MTK3339 GPS with Arduino Leonardo

Post by adafruit_support_rick »

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.

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

Re: MTK3339 GPS with Arduino Leonardo

Post by dennisma »

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
fran.manez
 
Posts: 4
Joined: Fri Feb 01, 2013 11:53 am

Re: MTK3339 GPS with Arduino Leonardo

Post by fran.manez »

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

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

Re: MTK3339 GPS with Arduino Leonardo

Post by dennisma »

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
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: MTK3339 GPS with Arduino Leonardo

Post by adafruit_support_rick »

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...

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

Re: MTK3339 GPS with Arduino Leonardo

Post by dennisma »

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
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: MTK3339 GPS with Arduino Leonardo

Post by adafruit_support_rick »

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.

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

Re: MTK3339 GPS with Arduino Leonardo

Post by dennisma »

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
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: MTK3339 GPS with Arduino Leonardo

Post by adafruit_support_rick »

@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 179 times

User avatar
fran.manez
 
Posts: 4
Joined: Fri Feb 01, 2013 11:53 am

Re: MTK3339 GPS with Arduino Leonardo

Post by fran.manez »

@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

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: MTK3339 GPS with Arduino Leonardo

Post by adafruit_support_rick »

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

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

Re: MTK3339 GPS with Arduino Leonardo

Post by scapec »

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

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: MTK3339 GPS with Arduino Leonardo

Post by adafruit_support_rick »

Try this:

Code: Select all

      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);

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Products from Adafruit”