Ultimate GPS debugging

Hey all, I’ve seen the other topics on using the spark core with the Adafruit ultimate GPS but I’m having some problems that I’ve done different debugging for. It involves getting a fix with the GPS.

When I was having problems getting a fix with the spark, I hooked it up to an Arduino and it was able to get a fix within a minute. My setup for testing this looks like this (just so you know it’s not an issue of me trying in different locations

When I have it plugged into the Arduino, I just use a blank program and read it directly from the serial like this: https://learn.adafruit.com/adafruit-ultimate-gps/direct-computer-wiring

My spark equivalent for testing is this https://gist.github.com/dmiddlecamp/6460ea2109826141948c
(from here https://community.spark.io/t/adafruit-gps-with-spark-core/6020/12) but it will not make a fix. I am inside, but with an external antenna by a window and like I said, the Arduino-GPS had a fix within a minute.

The odd thing for me is it seems like the GPS should operate independently from wiring or anything - as long as it has power, it tries to fix to satellites and not really care about what its plugged into. Is this not the case? Is it a voltage problem? Maybe my wiring is wrong and I should look into that?

Any advice on further debugging this is appreciated!! Thank you!

1 Like

My immedate guess would be a voltage problem, but it's a bit hard to say without actually knowing your setup/wiring.

But to rule out some software issues you could just write a very simple Serial1 (RX/TX 3.3V) or Serial2 (D0/D1 5V) to USB-Serial pass through program to (sort of) do the same thing as with your Arduino test.

Voltage is always good to check–you might also have 3.3V vs 5V problem.

If it is not that, another thing to consider is that Spark is a radio transmitter so there could be radio interference between the Spark and the GPS.

You can arrange the Spark and GPS to be as far apart as practical as a first step.

You can try connecting the GPS to the UNO but also power up the Spark to see if it interferes then too.

@gelicia
The first possibility is that the voltages are different. The Arduino Uno operates at +5V. The Spark Core at +3.3V. I reviewed the Adafruit product description page and was not able to find a schematic of their breakout. The GPS module (lFGPMMOPA6H) has an Vcc operating range of +3v - +4.3v so I assume the Adafruit people may have an onboard regulator - it looks like a 3.3v regulator on the picture. I suspect that you need to drive the Adafruit breakout GPS at +5v. Regulators typically need to have supply voltages above their output voltages.

As long as you are not using pin2 the spark the digital pins can support +5v on the inputs http://community.spark.io/t/5v-input-voltage-on-digital-pins/4761

How are you powering the Spark Core? Do you have 5V available?

Folks, the Adafruit description clearly says “ultra-low dropout 3.3V regulator so you can power it with 3.3-5VDC in, 5V level safe inputs”. So voltage is not the issue and it should be powered via the Core’s 3.3v pin. The problem with the “serial” Arduino sketch is that it just won’t work with the Core. As @ScruffR pointed out, a small sketch that reads Serial1 (or 2) and copies out to Serial will do the same. :smiley:

4 Likes

Thank you all for your help.

I unplugged the spark and everything from the rest of the project so I know there’s nothing else interfering. I’m powering everything off a battery that goes through a voltage regulator set at 5V and have the gps going off that instead of off the Spark’s 3.3v. This may or may not matter but more closely mirrors the uno setup.

The time to fix now seems to be more like what the Uno is so it’s gotta be something else in the project.

For anyone’s future reference, here is the code that mirrors the adafruit direct computer wiring example.

void setup() {
    Serial.begin(9600);
    Serial1.begin(9600);
}

void loop() {
    while (Serial1.available()){
        Serial.print(char(Serial1.read()));    
    }
}

Thanks again you guys!

Despite the fact that I’ve not checked the datasheet and the careless use (taking over of) the OP’s term voltage, instead of the more appropriate term power (product of voltage x current) it might not be a voltage problem, but if the new power setup actually should work better, it might have been a power (more precisely said current) issue after all :wink:

As for the serial passthrough sketch, I’d rather use Serial.write() like this

//#include "Serial2.h"   // replace Serial1 for use of D0/D1 for 5V toletance

void setup()
{
  Serial.begin(115200);  // USB serial is always that fast
  Serial1.begin(9600);   // this needs to fit to the other side
}

void loop()
{
  while (Serial1.available())  
    Serial.write(Serial1.read());  // pass RX data to USB serial

  while (Serial.available())
    Serial1.write(Serial.read());  // pass USB serial to TX pin 
}

When using Serial.print(), non-printable bytes would get converted to their integer number representation, which might be confusing (e.g. carriage return would print 13 and line feed 10, instead of producing a new line).


Edit: I just looked at the Adafruit specs, and 25mA (tracking) doesn’t seem excessive for the Core, unless you use a really wimpy power source, or you’ve got a lot of current going somewhere else.

4 Likes

did you ever figure this out i had same thing and it was because of my wifi module txing causing to much interference for gps rf

Yep that was it exactly. I had it on a half breadboard, and that is too close to have the Photon and the GPS module. When I put it on a full breadboard, everything worked fine. A lot of headaches for a simple spacing issue!

1 Like