Jump to content
I2Cdevlib Forums

lolizz00

Members
  • Posts

    0
  • Joined

  • Last visited

Reputation Activity

  1. Like
    lolizz00 reacted to luisrodenas in Arduino Sketch to automatically calculate MPU6050 offsets   
    I have made an Arduino sketch that simplifies the task of calibrating the MPU6050's offsets.
     
    Easy steps:
     
    - Wire your MPU6050 to your Arduino.
    - Put the MPU6050 as horizontal as possible and leave it there, don't touch it.
    - Check the sketch in order to configure your MPU's I2C address (0x68 or 0x69).
    - Upload the sketch to your Arduino.
    - Open Arduino serial monitor and send any character to the Arduino.
    - Wait.
    - Write down your offsets for that particular MPU6050 and use them with library's functions "...setoffset..." in your projects.
     
     
    There are also a few options in the code in case you want to fine tune it.
     
    There may be bugs, or maybe it does not converge for everyone, so let me know your experience.
    I use it with an Arduino DUE, configured to 400KHz I2C bus speed, but I think you can use any Arduino and standard bus speed (100KHz).
     
    If people find it useful maybe Jeff can add it to the library once it is bugfree.
     
    Happy new year.
     
    UPDATE 30th January:  New version 1.1 available. It fixes a bug related to variables overflowing in Arduinos other than the DUE.
    MPU6050_calibration_v1.1.zip
×
×
  • Create New...