I’m making a data logger for my son’s sprint training using a Sparkfun Neo-M9N board (chip antenna) and an Arduino board which will eventually send readings back to my phone, hoping to log velocity at a rate of 10Hz. I’m playing with both an ESP32-S3 board and an Artemis Openlog, no difference in the results. Even with a running average of 3 samples, the velocity accuracy doesn’t seem very good, even when just walking the speed is up and down like crazy. It’s supposed to be very good according to the specs but repeat runs at a similar speed will give very different results.
BTW, I’m using groundspeed from the GPS as I figured that would be the best option - is it? It’s not a wrist worn device, it just sits in a small pocket at rear of the running shorts. I did that as I felt it wouldn’t be accurate on a wrist when running and didn’t want to have to use an IMU to filter out wrist motion.
Connected to U-Center it’s getting plenty of satellites but only a 2D fix. I read that at 10Hz it can only use 16 satellites so I reduced rate to 5Hz. The speed shown in U-Center seems to be quite believable. When I pick up my laptop and take it for a walk the speed meter in U-Center increases as expected, stays relatively constant at walking pace, increases quickly when I sort of run (as well as you can holding a laptop & GPS board). It also gets a fix in about 1 minute. However, when I connect it back up to either Arduino board it takes about 5 mins to get a fix and the speed readings whilst walking are all over the place, both thru the I2C and serial monitor.
Is U-Center’s speed meter showing groundspeed or a different speed? Any reason why it would get a fix so much quicker when connected to U-Center?
it just sits in a small pocket at rear of the running shorts.
The GPS module will not have a very clear view of the sky, which is required for the most accurate measurements.
Speed is computed by calculating (distance traveled)/(time between measurements). For walking or running, speed accuracy is strongly affected by errors in the position measurements, which are larger when the sky view is restricted. Some GPS modules compensate by taking a moving average, which may distort the readings in an unwanted fashion.
I suspect that you will not find GPS to be the best tool for this particular application.
The speed is rated at an accuracy of 0.05m/s. I understand GPS calculates speed not based on dist between fixes but it uses a Doppler type calc on the phase of the return signals, which is why it is so much more accurate that the position fixes. If the speed was calculated based on distance between fixes its accuracy couldn’t possibly be spec-ed so high as the positional accuracy is in the order of 2m or so.
I’ve tried it with the unit sitting dead flat and walking around with it - no difference. However, when connected to U-Center and walking around with it it’s much better. There’s clearly something happening with the Arduino board to mess things up. I tried powering the GPS board via USB from my laptop with the Arduino board connected via qwiic and running its program.
The code is pretty simple at this stage:
the GPS is configured with:
#include “SparkFun_Ublox_Arduino_Library.h”
SFE_UBLOX_GPS myGPS;
myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise)
myGPS.setNavigationFrequency(5); //Set output to 5times a second
the the main loop contains:
speed = myGPS.getGroundSpeed()/1000*3.6;
dataString = String(speed) + “kph”;
Serial.println(dataString);
oled.clear(PAGE); // Clear the screen
oled.setCursor(0,0); // Set cursor to top-left
oled.println(String(speed));
oled.display();
Not much can go wrong, code-wise there but somehow something isn’t correct.