SparkFun GPS Dead Reckoning NEO-M8U Hookup Guide

Pages
Contributors: bboyho, Elias The Sparkiest
Favorited Favorite 2

Example 1 - Calibrate Sensor

Now that the SparkFun Dead Reckoning is mounted and oriented correctly with regards to the vehicle, it's time to calibrate the sensor. To do this, a few movements with the vehicle must be done all while maintaining good GNSS reception.

  • First, the car needs to be stopped with the engine turned on.
  • Secondly, the car must do left and right hand turns.
  • Lastly, the car must reach a speed over 30 km/h.

For the first example (located in File Examples > SparkFun u-blox GNSS Arduino Library > Dead Reckoning > Example1_calibrateSensor), the calibration status will be printed to the Arduino's serial monitor to indicate when calibration is ongoing and when it has completed.

In the first code block, there's a call to myGNSS.setI2COUtput(COM_TYPE_UBX) towards the bottom which turns off NMEA noise.

language:c
void setup()
{
  Serial.begin(115200);
  while (!Serial); //Wait for user to open terminal
  Serial.println("SparkFun Ublox Example");

  Wire.begin();

  if (myGNSS.begin() == false) //Connect to the Ublox module using Wire port
  {
    Serial.println(F("Ublox GPS not detected at default I2C address. Please check wiring. Freezing."));
    while (1);
  }

  myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise)
}

The second code block below is where the heart of the sketch lives. The code pings the module to get its "ESF Info" (External Sensor Fusion Info), to see what Fusion Mode has been achieved. A zero indicates calibration while a one indicates calibrated.

language:c
void loop()
{

  if (myGNSS.getEsfInfo()){
    Serial.print("Fusion Mode: ");  
    Serial.println(myGNSS.imuMeas.fusionMode);  
    if (myGNSS.imuMeas.fusionMode == 1)
      Serial.println("Sensor is calibrated!");  
  }

  delay(250);
}

If you have not already, select your Board (in this case the Arduino Uno), and associated COM port. Upload the code to the board and and set the serial monitor to 115200 baud. Perform those fancy maneuvers (while obeying the traffic laws) before parking your car in a safe location. Then turn your engine off before checking the status! You should see a message indicating that the NEO-M8U is calibrated. If you do not, try driving around with the board once again!