GPS module for Photon?

The advantage of the new Asset Tracker v2 is it has a great GPS receiver and amplifier.

I ended up using this GPS sensor because it operates over I2C.

The Adafruit GPS modules based on the PA6H chips are compatible with the AssetTracker v1, as well. You can even use the same libraries.

If you put a MOSFET on pin D6 to control the power to the breakout board and added a LIS3DH accelerometer, it would functionally identical.

I have mangaged to get the Neo 6 module working with the TinyGPS libary (It is cheep). However the the Neo 8 modules DO NOT work with the TinyGPS libary, as there is an extremely small phrasing issue. I have mananged to fix it and getting working on a local build, but I don’t know how to edit libarys to be able to ‘share the love’ so to speek.

Infact I find quite a few libarys don’t compile at all, but thats another issue.

I managed to build my own tracker, and even got a rasppery PI to data log it remotely, and from that produce maps from goggle maps, without using a third party data convertor or logger.

If you want to use the Neo 6 module it will work…

Liam

Hey @VideoLiam can you give me some guidance about how to use tinyGPS library with neo 6m because I also have same GPS module. Hope for a positive replay

Hi Pranav,

Yes I will just give me a day or so to pull the details out…

Liam

1 Like

Hii Liam

I have just able to start up the GPS but it will take lot of time to get a GPS Lock ,is it often take so much time to get Lock .?
And if possible give me a Circuit diagram to…

And one last question does we can connect two device with RX and TX pin of photon.?

And last thing to mention Thank you for your reply Liam…!!! :slight_smile:

With my Asset Tracker it can take 1-2 minutes to get the GPS lock, and the GPS signal can also be further affected by surrounding objects (e.g. indoor). Not sure how long ‘‘a lot of time’’ is for you, but lengthy lock-on times aren’t unusual.

The M8n ublox gps units are lower cost and can output 10hz.

Beware having the GPS within a few inches of the particle can degrade performance of the gps. Also, beware many of these do not remember their baud rate and update rate settings if their backup battery dies. I recommend sending the config messages at the default baud rate every startup to kick it back into the desired mode. If already in the desired mode the messages are ignored and cause no harm.

This has some code you can start with.

2 Likes

His Macsboost ,
The GPS module will lost it’s lock even if I slight move the module I have lost the lock is it possible that it is sensitive to the little movement.?

His Vitesze
It takes round about 02-03 hours to get lock is it possible.?

If inside any structure or if there is no clear view of the sky this is possible. You may also never get a lock.

Fast startup requires a recent lock and unobstructed sky view.

You can use the ublox program to tweak the startup settings and possibly improve poor signal startup issues. You can force a startup location as well. I recommend not doing this unless you know what you are doing.

His Macsboost

Thank you for your help ,

I have put it in a place where I can found a clear view of sky but still it get so much time as well as some time it will lost the lock without reason such a not finding a clear view of sky or anything
It has place in a same place where it get a lock and after some time at same place it will not get any lock does it possible.?

keep the photon at least 12" away from the GPS. I have found that they interfere when close.

OK Macsboost ,
I will also try this out… :grinning:

Can any one guide me how to use Serial2 in photon with a diagram.?

I refer above link but didn't get any idea..

Using Serial2 on the Photon is not an easy task to do. It requires some hardware alterations that may not be worth it just to connect a GPS module.
I suspect you are not really running the GPS module any higher than 28800 baudrate, are you?
If not, you can instead try out ParticleSoftSerial - or use that for the device you currently have attached to Serial1 and connect your GPS to Serial1 instead.

1 Like

Yes we are using baud rate equal to 9600. I need two COM port for my system(i.e one is for gas sensor and another device is for GPS)and both requires Rx and Tx pins for it. So how could I do that? Thanks in advance

As suggested give the library a spin.
The sample provided with the lib uses D2/D3 as RX/TX.

@pranav292,

I worked on this same issue and published my results here. Hope it might be of some help.

Simple Sight Survey Tool. Used with Electron but would work with Photon as well.

Chip

1 Like

Hi pranav,

OK, got a wee bit more time.

First can I ask you to put a link to the exact module you have, for example were you bought it. If not a pic would be good.

There are lots of moudules out there, so knowing exactly which one you have would be nice. There have been lots of copys of Neo gps modules, the 8 in particular, got a knock off Neo8, myself. It took while getting the Neo8 working, as my main experiance had been with a genuine Neo6. So just bear in mind cheep can be nasty…

Do you have a serial to USB adaptor? There is an excellent Ublox utility for directly interfacing with the module directly from a PC/Laptop.

Were in the world are you? Typically I’d expect ot get a gps fix after about 10min, with a clear line of sight to the sky. Preferably with a good view to a large part of the sky. The lower floors of a tower block, surrounded by tower blocks is not a good location.

Below is my code I used to test my modules. You will need to include a legacy libary, TINYGPS.

It worked on both the core the photon and an electron. The Tx and Rx pins are in the written on the devices. Do not forget SERAIL pins go GPS TX to Core RX, GPS RX to Core TX. (Some times called a cross over connection).

Personally I’ve never actually ran two serial devices at the same time. Also I’ve had not problems using the modules 1 or 2 inch away from the core/photon/electron. But thats not to say they work better further apart. Just in not been a problem for me.

Liam

#include "TinyGPS/TinyGPS.h"


TinyGPS gps;
char szInfo[64];
// Every 15 minutes 
int sleep = 1 * 30 * 1000;

void setup(){
    Serial1.begin(9600);
    //Particle.variable("Counter", &count, INT);
    Particle.variable("GPS", szInfo);
}

void loop(){
    bool isValidGPS = false;
    
    for (unsigned long start = millis(); millis() - start < 1000;){
        // Check GPS data is available
        while (Serial1.available()){
            char c = Serial1.read();
            
            // parse GPS data
            if (gps.encode(c))
                isValidGPS = true;
        }
    }

    // If we have a valid GPS location then publish it
    if (isValidGPS){
        float lat, lon;
        unsigned long age;
    
        gps.f_get_position(&lat, &lon, &age);
        
        sprintf(szInfo, "%.6f,%.6f", (lat == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : lat), (lon == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : lon));
        Particle.publish("gpsloc", szInfo);
    }
    else{
        // Not a vlid GPS location, jsut pass 0.0,0.0
        // This is not correct because 0.0,0.0 is a valid GPS location, we have to pass a invalid GPS location
        // and check it at the client side
        sprintf(szInfo, "0.0,0.0");
    }
    
    //Particle.publish("gpsloc", szInfo);
    Serial.println(szInfo);
    //Serial.println(string(c);
    
    // Sleep for some time
    delay(sleep);
}