ukchris
Posts: 11
Joined: Thu Feb 22, 2018 1:34 pm

My First Pi - GPS Logging

Thu Feb 22, 2018 1:44 pm

Hello! While I'm not new to tech I'm far from being a "hard core" programmer, as I embark on my first Pi project I was hoping to verify some of my thinking and invite advice/suggestions from other forum members.

My goal is to build a GPS data logger for my car, ultimately I'd have a nice GUI and so on but I intend to proceed in stages. I'd like to capture and store GPS data (location, time, speed, altitude) and build a 0-60 timer.

For the first part I assume I just need a Pi-friendly GPS and some Python, I have done some Python programming before so I'm not too concerned there but I'd welcome any advice on choosing a GPS, I've been looking at the adafruit ultimate GPS here https://www.adafruit.com/product/746 which looks like a decent option, I'd welcome any comments.

I'd also like to add an accelerometer, my goals would be to add the capture of g-forces but the primary goal would be for a "launch trigger". If I want to time the 0-60 acceleration time my thinking is I'd "prime" the app such that it is waiting for the accelerometer to register movement, when it does the clock starts and when the GPS reports the speed reaching 60 mph it stops. I'm thinking this would be more consistent than relying on pressing a button to start a timer etc.

Down the line I'd like to add a UI to all of this, I've been reading about tkinter but I figure that can wait a while, similarly with a screen I'd like to look in to eInk displays for better readability outdoors but I get the feeling they are notably different to standard displays and would warrant some research.

I'd appreciate and comments and suggestions you folks may have.

Chris.

User avatar
topguy
Posts: 4400
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: My First Pi - GPS Logging

Thu Feb 22, 2018 5:10 pm

ukchris wrote:
Thu Feb 22, 2018 1:44 pm
For the first part I assume I just need a Pi-friendly GPS and some Python, I have done some Python programming before so I'm not too concerned there but I'd welcome any advice on choosing a GPS, I've been looking at the adafruit ultimate GPS here https://www.adafruit.com/product/746 which looks like a decent option, I'd welcome any comments.
Personally I prefer the slightly more "plugandplay" of a USB GPS. Usually better choices of antennas too.

ukchris
Posts: 11
Joined: Thu Feb 22, 2018 1:34 pm

Re: My First Pi - GPS Logging

Thu Feb 22, 2018 5:14 pm

topguy wrote:
Thu Feb 22, 2018 5:10 pm
Personally I prefer the slightly more "plugandplay" of a USB GPS. Usually better choices of antennas too.
I confess I hadn't thought about that, any you happen to recommend that will work easily with Pi/Python?

User avatar
topguy
Posts: 4400
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: My First Pi - GPS Logging

Thu Feb 22, 2018 5:21 pm

Most of these devices is recognized by the Pi as a serialport so the only difference from using one connected to the UART is the device name given by the kernel. ( "ttyUSB0" instead of "ttyACM0" or "serial0" )

The software just need to open the correct device.

scotty101
Posts: 2849
Joined: Fri Jun 08, 2012 6:03 pm

Re: My First Pi - GPS Logging

Thu Feb 22, 2018 5:37 pm

I'd second the USB GPS device suggestion. They tend to be a bit more "robust" in terms of packaging and often have a magnet or suction cup to mount them to your car.

I'd also recommend using GPSD and the python-gpsd library.
GPSD deals with reading data from the GPS device in the background and makes the data available to other programs via sockets.
The python-gpsd library can communicate with GPSD and ask for the current location, speed etc.

As for accuracy, you may find that the speed tends to lag a bit behind your actual speed.
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

ukchris
Posts: 11
Joined: Thu Feb 22, 2018 1:34 pm

Re: My First Pi - GPS Logging

Thu Feb 22, 2018 5:57 pm

Found an article that recommends the BU-353-S4, I think I'll give that a try, thanks!

Now, accelerometer... maybe it's worth looking for a USB one of those too although I'm doubtful!

Thanks for the tips on the Python libraries, I'll look them up as soon as I get the GPS.

scotty101
Posts: 2849
Joined: Fri Jun 08, 2012 6:03 pm

Re: My First Pi - GPS Logging

Fri Feb 23, 2018 9:04 am

ukchris wrote:
Thu Feb 22, 2018 5:57 pm
Now, accelerometer... maybe it's worth looking for a USB one of those too although I'm doubtful!
Just buy a SenseHat. Its accelerometer should serve your purpose well.
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

User avatar
bensimmo
Posts: 2708
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: My First Pi - GPS Logging

Fri Feb 23, 2018 11:05 am

EnviropHAT is another alternative as it also has an easy to use Python module.
Smaller and slightly cheaper.

Other than that you just but a small module and use it via I2C.
The cheapest option, but slightly more faff to program.

ukchris
Posts: 11
Joined: Thu Feb 22, 2018 1:34 pm

Re: My First Pi - GPS Logging

Fri Feb 23, 2018 1:59 pm

I've ordered a BU-353 USB GPS and a Sunfounder ADXL345 as a starting point, very pleased with the GPS plan and figured I'd give the accelerometer a try, if it doesn't work out I'll certainly try one of the HAT boards suggested.

Return to “Beginners”

Who is online

Users browsing this forum: Gabe1972, klricks and 26 guests