smoothing MPU6050 accel data

Hi all,

I’ve been working a project using the MPU6050 gyro + accel and have hit a bit of a wall. I have been working from the example MPU6050 DMP6 code and I have made a few adjustments.

The calibration has been set so my gyro data is calibrates to around 0. My accel data isn’t.

I would like to smooth accelerometer data as it seems to be very noisy. The X and Y axis are calibrated at around 0 but jump from a range of values from -9 to +9. The Z is fluctuating at around 30 but jumps from roughly 20-45.

Does anyone have any suggestions to for data smoothing this accel data? I have attached a .zip of my arduino code, help would be much appreciated!

MPU6050_RPY___ACC.zip (5.41 KB)

That is normal sensor noise.

You can always average a few readings, but why do you think it is important to "smooth" it? What is your goal?

I just want the data to be as constant as possible, otherwise the gesture data will be incorrect and will not map properly.

Obviously, you haven't yet experimented with "gesture data", or you would realize how silly that statement is.

Your biggest problem is dealing with the acceleration due to gravity (the large value associated with any accelerometer axis that is currently pointing up or down).

Google something like "processing accelerometer gesture data" for lots of leads. This is not a trivial undertaking.