Using Arduino to Calibrate the MPU6050 Accelerometers

In this video lesson we show you how to calibrate the accelerometers on the MPU6050. You will have to find the min and max accelerometer numbers for your particular board, but I show you how in the video. Below, we show the schematic of how our circuit is connected.

MPU6050
Schematic for connecting the GY-87 module to the Arduino

In the lesson we developed the following code. Measure your min and max values of the three accelerometers according to the instructions in the video. Then enter those numbers in the code below, and un-comment out the commented lines. If you run the code as-is below, it should work, but the results will be uncalibrated and not as accurate as possible.