I building a Odometer using Arduino Mega 2560, GPS module Ublox NEO 7M, 6 digit 7 seg display, the GPS is configurated to NAV-PVT, I calculate 10 times per second, I'm having precision problems, below the formula I use to calculate distance.
Thanks for your help
//Odometro Acumulado
Serial.print (" a =");
a =dist_calcupdown + a;
Serial.print (a);
Serial.print (" ab =");
ab = a/1000;
Serial.println (ab);
lat1 = (lat2);
long1 = (long2);
}}}
d1=ab/10000;
d2=ab/1000-d110;
d3=ab/100-d210-d1100;
d4=ab/10-d310-d2100-d11000;
d5=ab/1-d410-d3100-d21000-d1*10000;
tm1637_6D.set(5);//BRIGHT_DARKEST = 0,BRIGHTEST = 7;
int8_t ListDisp[5] = {d5,d4,d3,d2,d1}; //first number will be displayed on the right
// The first point in the array will be displayed on the right
int8_t ListDispPoint[6] = {POINT_OFF,POINT_OFF,POINT_ON,POINT_OFF,POINT_OFF,POINT_OFF};
{
tm1637_6D.display(ListDisp, ListDispPoint);
Hello, do yourself a favour and please read How to get the best out of this forum and modify your post accordingly (including code tags and necessary documentation for your ask).
Precision problems means traveling with my car, the 2 odometers ( car and arduino GPS) I have a diference betwen -12% up to +7%, them I assembly 2 GPS Odometer with Arduino, with diferent modules and antenas, the two Arduinos 100% the same distance, I test in 2 diferent cars and I have the same problem. How can I solve "AVR Arduinos do not support double precision floats" problem ?
I have noticed that the speed indicated by my car is higher than the reading from a GPS. I suspect that this is done deliberately by the car manufacturer so that I can't blame them if I get a minor speeding ticket.
If speed is off, I would expect the odometer to be similarly affected.
I'd be inclined to drive a few miles on a highway with mile markers and compare.
My guess is that the faster you go the larger the difference between actual speed and Displayed speed.
Probably not, they can obvershoot a bit on the speed display for the reason you mentioned but still compute the right distance. Otherwise the car would report very wrong information accumulated over time
Last weekend I traveled to the south about 1,150 miles (1900 Km) , every 100 kilometers ( in the GPS's odometers) I compare the car odometer and the other 2 GPS odometers, The 2 GPS stay in the same number, but the car odometer came from 88km to 107km, I read 13 times the 3 odometers. I don't expect the same distance but, I don't understand why the proportion changes. I will buy a Arduino Due and try, in this case what I need to change in the programm to get the best results ?
Thanks everybody for your informations,
If this is a GPS odometer in a car, then if the car is travelling at circa 50mph and the GPS position update is at 10hz, you are taking position updates every 2.5m or so.
So if the distance between two position fixes is circa 2.5m for that calculated distance to be to acurate to say 1% what position accuracy would you need from the GPS ?
In France (Europe?) the rule is that the meter cannot show a speed that is inferior to the real speed and a tolerance is acceptable and this varies by type of vehicle (car, truck, motorbike, quad,…) and actual speed.
1% will be perfect, now I have up to 19%, I calculate the distance 10 times per second , I save the last position and wait for de next readind ( if its different to the memory) then I don't loose points . Sometime in a tunnel for example I save the last reading from GPS and when GPS is running again I have the next point to calculate, even loosing 200 points for example, if the tunnel is straight route. The odometer will be correct