MPU6050 showing ~3.5g instead of 1g

Hello.

I want to use the MPU6050 to measure g-forces on a kart.
I installed the sensor and made it work with arduino nano but using library written by Korneliusz Jarzebski i can not get the correct values.

I use this code:

/*
    MPU6050 Triple Axis Gyroscope & Accelerometer. Simple Accelerometer Example.
    Read more: http://www.jarzebski.pl/arduino/czujniki-i-sensory/3-osiowy-zyroskop-i-akcelerometr-mpu6050.html
    GIT: https://github.com/jarzebski/Arduino-MPU6050
    Web: http://www.jarzebski.pl
    (c) 2014 by Korneliusz Jarzebski
*/

#include <Wire.h>
#include <MPU6050.h>

MPU6050 mpu;

void setup() 
{
  Serial.begin(115200);

  Serial.println("Initialize MPU6050");

  while(!mpu.begin(MPU6050_SCALE_2000DPS, MPU6050_RANGE_16G))
  {
    Serial.println("Could not find a valid MPU6050 sensor, check wiring!");
    delay(500);
  }

  // If you want, you can set accelerometer offsets
  // mpu.setAccelOffsetX();
  // mpu.setAccelOffsetY();
  // mpu.setAccelOffsetZ();
  
  checkSettings();
}

void checkSettings()
{
  Serial.println();
  
  Serial.print(" * Sleep Mode:            ");
  Serial.println(mpu.getSleepEnabled() ? "Enabled" : "Disabled");
  
  Serial.print(" * Clock Source:          ");
  switch(mpu.getClockSource())
  {
    case MPU6050_CLOCK_KEEP_RESET:     Serial.println("Stops the clock and keeps the timing generator in reset"); break;
    case MPU6050_CLOCK_EXTERNAL_19MHZ: Serial.println("PLL with external 19.2MHz reference"); break;
    case MPU6050_CLOCK_EXTERNAL_32KHZ: Serial.println("PLL with external 32.768kHz reference"); break;
    case MPU6050_CLOCK_PLL_ZGYRO:      Serial.println("PLL with Z axis gyroscope reference"); break;
    case MPU6050_CLOCK_PLL_YGYRO:      Serial.println("PLL with Y axis gyroscope reference"); break;
    case MPU6050_CLOCK_PLL_XGYRO:      Serial.println("PLL with X axis gyroscope reference"); break;
    case MPU6050_CLOCK_INTERNAL_8MHZ:  Serial.println("Internal 8MHz oscillator"); break;
  }
  
  Serial.print(" * Accelerometer:         ");
  switch(mpu.getRange())
  {
    case MPU6050_RANGE_16G:            Serial.println("+/- 16 g"); break;
    case MPU6050_RANGE_8G:             Serial.println("+/- 8 g"); break;
    case MPU6050_RANGE_4G:             Serial.println("+/- 4 g"); break;
    case MPU6050_RANGE_2G:             Serial.println("+/- 2 g"); break;
  }  

  Serial.print(" * Accelerometer offsets: ");
  Serial.print(mpu.getAccelOffsetX());
  Serial.print(" / ");
  Serial.print(mpu.getAccelOffsetY());
  Serial.print(" / ");
  Serial.println(mpu.getAccelOffsetZ());
  
  Serial.println();
}

void loop()
{
  Vector rawAccel = mpu.readRawAccel();
  Vector normAccel = mpu.readNormalizeAccel();
  Vector scaleAccel = mpu.readScaledAccel();

  Serial.print(" Xraw = ");
  Serial.print(rawAccel.XAxis);
  Serial.print(" Yraw = ");
  Serial.print(rawAccel.YAxis);
  Serial.print(" Zraw = ");

  Serial.println(rawAccel.ZAxis);
  Serial.print(" Xnorm = ");
  Serial.print(normAccel.XAxis);
  Serial.print(" Ynorm = ");
  Serial.print(normAccel.YAxis);
  Serial.print(" Znorm = ");
  Serial.println(normAccel.ZAxis);

  Serial.print(" Xscale = ");
  Serial.print(scaleAccel.XAxis);
  Serial.print(" Yscale = ");
  Serial.print(scaleAccel.YAxis);
  Serial.print(" Zscale = ");
  Serial.println(scaleAccel.ZAxis);
  
  delay(10);
}

And with the sensor more or less flat and not moving I get these results:

Xraw = 584.00 Yraw = -3044.00 Zraw = 13532.00
Xnorm = 1.49 Ynorm = -7.18 Znorm = 32.30
Xscale = 0.15 Ynorm = -0.73 Znorm = 3.27
Xraw = 276.00 Yraw = -2720.00 Zraw = 14128.00
Xnorm = 0.96 Ynorm = -6.41 Znorm = 33.17
Xscale = 0.08 Ynorm = -0.64 Znorm = 3.38
Xraw = -280.00 Yraw = -2364.00 Zraw = 15472.00
Xnorm = 1.03 Ynorm = -5.50 Znorm = 36.11
Xscale = -0.10 Ynorm = -0.47 Znorm = 3.87

What can I do to have it measure up to 16 G and if the sensor is sitting still to measure 1G on the Z axes?

Thank you in advance.

So after some testing it turns out that at 19200 baud rate the G-forces are displayed correctly.
If I change the baud rate to 57600 the G-forces are not correct.

I will try to test other baud rates too.

Does anyone have any idea as to why this happens?
Do I need to introduce a bigger delay somewhere?

Thank you.

The MPU6050 data sheet has lots of important details, such as the maximum data rate.

It is by far your best source of information.

jremington:
The MPU6050 data sheet has lots of important details, such as the maximum data rate.

It is by far your best source of information.

Thank you.
All that I found about the data rate is this line in a table:
OUTPUT DATA RATE Programmable Range 4(min) 1,000 (max) Hz

I think it means that I can read the value 1000 times a second. It is far more than I need.

So what data rate have you programmed?

jremington:
So what data rate have you programmed?

I have tried with different baud rates and so far I can get it to work if I select 115200 baud rate.
I have not changed the data rate of the sensor. Just the baud rate at which I transmit the data. And this seems to have worked.

I still don't understand what the issue is, but it works.

P.S. Is there a way to filter/average the G-forces? Because I use it on a Kart and there are a lot of vibrations.

Thank you.

Is there a way to filter/average the G-forces?

Add several measurements and divide by the number of measurements.

jremington:
Add several measurements and divide by the number of measurements.

Thank you. I was thinking that maybe there was a way to get the MPU to do the averegeing.

But I will implement this.

Thanks.