Go Down

Topic: GPS UP501 Connected to an Arduino, No Data Stream (Read 3265 times) previous topic - next topic


Nov 18, 2012, 11:17 pm Last Edit: Nov 19, 2012, 01:52 am by unh2013 Reason: 1
I connected my GPS UP501 from Fastrax to my Arduino Leonardo and used the following code:
// Test code for Adafruit GPS modules using MTK driver
// such as www.adafruit.com/products/660
// Pick one up today at the Adafruit electronics shop
// and help support open source hardware & software! -ada
//  #if (ARDUINO >= 100)
#define rxPin 2
#define txPin 3
#include <SoftwareSerial.h>
SoftwareSerial mySerial(rxPin, txPin);
//  #else
// If you're using Arduino IDE v23 or earlier, you'll
// need to install NewSoftSerial
//#include <NewSoftSerial.h>
//NewSoftSerial mySerial(2, 3);
//  #endif

// Connect the GPS Power pin to 3.3V
// Connect the GPS Ground pin to ground
// Connect the GPS VBAT pin to 3.3V if no battery is used
// Connect the GPS TX (transmit) pin to Digital 2
// Connect the GPS RX (receive) pin to Digital 3
// For 3.3V only modules such as the UP501, connect a 10K
// resistor between digital 3 and GPS RX and a 10K resistor
// from GPS RX to ground.

// different commands to set the update rate from once a second (1 Hz) to 10 times a second (10Hz)
#define PMTK_SET_NMEA_UPDATE_1HZ  "$PMTK220,1000*1F"
#define PMTK_SET_NMEA_UPDATE_5HZ  "$PMTK220,200*2C"
#define PMTK_SET_NMEA_UPDATE_10HZ "$PMTK220,100*2F"

// turn on only the second sentence (GPRMC)
#define PMTK_SET_NMEA_OUTPUT_RMCONLY "$PMTK314,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*29"
// turn on ALL THE DATA
#define PMTK_SET_NMEA_OUTPUT_ALLDATA "$PMTK314,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0*28"

// to generate your own sentences, check out the MTK command datasheet and use a checksum calculator
// such as the awesome http://www.hhhh.org/wiml/proj/nmeaxor.html

void setup()  
 {//This waits for the serial port of the Leonardo to connect.
 Serial.println("Test for Leonardo and Computer Communication\n");

 // 9600 NMEA is the default baud rate
 // uncomment this line to turn on only the "minimum recommended" data for high update rates!

 // uncomment this line to turn on all the available data - for 9600 baud you'll want 1 Hz rate
 // Set the update rate
 // 1 Hz update rate
 // 5 Hz update rate- for 9600 baud you'll have to set the output to RMC only (see above)
 // 10 Hz update rate - for 9600 baud you'll have to set the output to RMC only (see above)


void loop()                     // run over and over again
 if (mySerial.available()) {
 if (Serial.available()) {


Unfortunately all I see is the Test for Leonardo and Computer Communication message and then it stops transmitting and the transmit light does not appear. I was wondering if anyone had any advice. (Some additional information I am using an Arduino Leonardo us the Mac OS X and used the wiring diagram from adafruit.)


I connected my GPS UP501 from Fastrax to my GPS

How did you connect your GPS to your GPS?

Which GPS (aka Arduino) do you have?
The art of getting good answers lies in asking good questions.


Sorry, my mistake I connected my GPS receiver to my Arduino Leonardo.  I have a Fastrax UP501 GPS module and I followed the connection diagram from www.adafruit.com/products/660.


Separation of USB and serial communication.

On the Leonardo, the main Serial class refers to the virtual serial driver on the Leonardo for connection to your computer over USB. It's not connected to the physical pins 0 and 1 as it is on the Uno and earlier boards. To use the hardware serial port (pins 0 and 1, RX and TX), use Serial1. (See the Serial reference pages for more information.)

I'd suggest changing the connection to the hardware serial pins, and using Serial1 to read from the GPS, not SoftwareSerial.
The art of getting good answers lies in asking good questions.


I might have come up with an answer to this one:


It's about using hardware serial on the Mega, uses a wiring example like Adafruit does in their tutorial.
There was an error in the example parsing code. Same in the 'echo' and leo_echo' examples.

Go Up