The Project

Use a GPS module with a microcontroller and an OLED display to control 4 relays based on speed. Use a switch to arm\disarm the relays and a rotary encoder to set the speed at which each relay is activated.

Getting Started

I used an LG8F328P Arduino Nano clone and a Neo-7M GPS module and TinyGPS, along with a small 128x64 pixel OLED display and using the Adafruit_SSD1306 library to show the speed and latitude and longitude using the example code for TinyGPS. Everything worked fine however, it was a bit slow to update the speed on the display.

20240117 173214

After a bit of internet searching, I found the Ublox U-Center application that could update the baud rate from the default of 9600 to 115200 and also the frequency (Measurement Period) of updates from the GPS module from 1 second to 100ms. This worked great but after the module was powered off for 15 minutes or so it would lose its configuration settings.

UbxGPS

UbxGPS seemed to be what I needed. The UbxGPS project has UbxGpsConfig.h. It had everything I needed to configure the module from an Arduino. It is a class template which is uses too much flash, so I removed the class stuff and had it output data from the GPS module to the serial port.

Finally, it seemed I could reliably configure the module. I added the UbxGPS example code and nope. I’m not sure what the problem is so back to TinyGPS but using UbxGPS to configure the Neo-7M module at start up…
Neo7m 01

Working...

After much frustration of freezing and reboots, switching to an ESP8266, then an STM32 Blackpill and finally an ESP32 that could actually run the GPS code and output it to the OLED display, things seem to be working. It sometimes seems a little laggy and I suspect it is because of data overload, the code grabs every serial packet and there are a lot!! The next step is to try and find the issue with the UbxGPS example code running with the UbxGPSConfig code.