# MPU-6050 Calculating velocity

Hi,
I am trying to build a system which calculate the velocity using MPU6050
can anyone help me

velocity = acceleration*time

But see this explanation for why such simple calculations rarely work.

i dont know how to calculate acceleration in m/s2

i used this example but i don’t understand the results unit
// MPU-6050 Short Example Sketch
// By Arduino User JohnChi
// August 17, 2014
// Public Domain
#include<Wire.h>
int16_t AcX,AcY,AcZ,Tmp,GyX,GyY,GyZ;
void setup(){
Wire.begin();
Wire.write(0x6B); // PWR_MGMT_1 register
Wire.write(0); // set to zero (wakes up the MPU-6050)
Wire.endTransmission(true);
Serial.begin(9600);
}
void loop(){
Wire.write(0x3B); // starting with register 0x3B (ACCEL_XOUT_H)
Wire.endTransmission(false);
Wire.requestFrom(MPU_addr,14,true); // request a total of 14 registers
Serial.print("AcX = “); Serial.print(AcX);
Serial.print(” | AcY = “); Serial.print(AcY);
Serial.print(” | AcZ = “); Serial.print(AcZ);
Serial.print(” | Tmp = “); Serial.print(Tmp/340.00+36.53); //equation for temperature in degrees C from datasheet
Serial.print(” | GyX = “); Serial.print(GyX);
Serial.print(” | GyY = “); Serial.print(GyY);
Serial.print(” | GyZ = "); Serial.println(GyZ);
delay(333);
}

i dont know how to calculate acceleration in m/s2

U dont. The sensor will tell you.

The sensor data sheet gives you a scale factor that converts the output numbers into "g" units (units of 9.8 m/s^2).

It depends on the chosen scale and is called the "sensitivity scale factor", which you divide into the output.

Hint: if you hold the accelerometer still, such that the Z axis is up or down, the reading is +/- "g" along Z.

jremington:
The sensor data sheet gives you a scale factor that converts the output numbers into "g" units (units of 9.8 m/s^2).

It depends on the chosen scale and is called the "sensitivity scale factor", which you divide into the output.

Hint: if you hold the accelerometer still, such that the Z axis is up or down, the reading is +/- "g" along Z.

So it can be the result divided by 9.8 or multiplied by 9.8 ?