Odd behaviours

For some reason I have issues with my GPS tracking system I’m working on. It works well but sometimes it drops GPS signal and sometimes it takes ages to get a position lock. If you think this has to do with cold/warm boot you are wrong. As is my rig is connected to my computer, Arduino powered from an FTDI adapter that is connected to my computer with regular USB cable. This way I can open a serial monitor and read what the status is.

When I boot my computer USB gets initialized  by Windows. This causes Arduino to reboot and when that happens (or a power cycle) the GPS loses its position (LED stopped blinking)

Yes the battery is charged, yes it had position lock just before reboot. I can do this many times and the result is the same.

This is a behaviour I do not want to have when it is mounted to my motorcycle.

A comparison…

I have the same chip (NEO 6M) connected to a NodeMCU with a small 0.96 OLED screen and it is currently being powered in my garage by solar-cells charging some 12V batteries.

This works 100% all the time, even if I reboot it is very quick to get position lock again.

To make things worse…

If for some reason the GPS module should be defect I of course swapped them over a few times and the result is the same.
I also replaced Arduino with another one and it is still the same result, as well as replacing wires. I’m running out of ideas to solve this one…

A 2nd option is of course to use the NODEMCU instead of Arduino. Storage can still be done on the SD card but then I need to compile a new NODEMCU kernel with FAT and SPI support I think.

A 3rd option is to use my old Raspberry PI…

Arduino GPS GPX SD

My current project is to make a DIY GPS tracking device.

Part list:

Arduino Pro Mini (5V)
GPS-NEO-6M
MH-SD CARD Module

All this will be neatly connected with soldered wires or headers when it is done, but for now I’m using jumper wires as all parts have soldered pins.

As many of you know an Arduino-file is called a “sketch” and that is exactly what it is – sketchy 🙂

My results from the code is not consistent.

The GPS chip works directly when I connect it to a NodeMCU-chip and a 0.96″ OLED. This little machine is generating 7 lines of output on the OLED every second – and it works 100%

 

Same chip connected to the Arduino does not work all the time so I assume it is the code (Sketch) that has some bugs in it as I merged various codes (SD card and GPS )

Troubleshooting is ongoing and I will rewrite the entire code.

The goal of the project is to generate a valid GPX-file. A track of GPS points saved into a file on the SD-card. Same sort of files can then be imported into Google Earth or a Garmin GPS (or any compatible GPS device)

Here you can now follow the track that has been generated by the GPS tracker.

 

I want to use this on my Motorcycle to log where I have been riding so I want it more or less always on.  Well, tracking must not be always on (generating the file) but the GPS-chip must be “HOT” i.e no cold boot, waiting for GPS fix signal.
That would not be user friendly having to wait 10 minutes before every ride.

In order to solve that I assume the GPS-chip must be always powered on even if the Arduino is not, well technically they can…but the logging should start when I insert a SD card into the Card holder right?

I have had this SD-card holder for a long time but I have only tested so it works i.e read/wright to and from SD-card.

Pseudo thinking:
When I go out for a ride and I want to track my ride I insert the SD-card.
IT automatically generates the log and when I’m back home I need to safely remove the card. The file is open until closed safely by Arduino (dataFile.close(); ) and how does it know that its done?

I assume I need to either use a switch to run file-ending code when pressed or using a delay where it is not open. I can use a status LED to tell me when it is open or not and I think it is enough to log GPS data every 5 or 10 seconds)
This could give me a 5 seconds window where program loops and a 5 second delay where it is paused (dataFile closed) to safely be ejected.

 

Decisions, decisions, decisions…