walid abdelazeem
Published © GPL3+

MPU9250 & MPU9265 calibration 9-DOF

MPU9250 & MPU9265 calibration 9-DOF Gyro Accelerator Magnetometer Module with Arduino on Unity 3d

IntermediateFull instructions provided1 hour5,977
MPU9250 & MPU9265 calibration 9-DOF

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
SparkFun IMU Breakout - MPU-9250
SparkFun IMU Breakout - MPU-9250
MPU9250 or MPU9265
×1
Solderless Breadboard Half Size
Solderless Breadboard Half Size
×1

Software apps and online services

Arduino IDE
Arduino IDE
Unity
Unity

Hand tools and fabrication machines

Premium Female/Female Jumper Wires, 40 x 3" (75mm)
Premium Female/Female Jumper Wires, 40 x 3" (75mm)

Story

Read more

Schematics

The MPU-9250 is a 9-axis motion tracking

The MPU-9250 is a 9-axis motion tracking device that combines a 3-axis gyroscope, 3-axis accelerometer, 3-axis magnetometer, and a Digital Motion Processor

Code

The MPU-9250 is a 9-axis motion tracking (arduino ide code)

Arduino
The MPU-9250 is a 9-axis motion tracking device that combines a 3-axis gyroscope, 3-axis accelerometer, 3-axis magnetometer, and a Digital Motion Processordevice that combines a 3-axis gyroscope, 3-axis accelerometer, 3-axis magnetometer, and a Digital Motion Processor with unity3d
#include "MPU9250.h"
// an MPU9250 object with the MPU-9250 sensor on I2C bus 0 with address 0x68


MPU9250 IMU(Wire,0x68);


int status; void setup()
{

  // serial to display data

  Serial.begin(115200);
  while(!Serial) {}   // start communication with IMU 
  status = IMU.begin();
  if (status < 0) {
    Serial.println("IMU initialization unsuccessful");
    Serial.println("Check IMU wiring or try cycling power");
    Serial.print("Status: ");
    Serial.println(status);
    while(1) {}
  }
}

void loop()
{
  // read the sensor
  IMU.readSensor();
  // display the data
  Serial.print(IMU.getAccelX_mss(),0);
  Serial.print("|");
  Serial.print(IMU.getAccelY_mss(),0);
  Serial.print("|");
  Serial.print(IMU.getAccelZ_mss(),0);
  Serial.print("|");
  Serial.print(IMU.getGyroX_rads(),1);
  Serial.print("|");
 Serial.print(IMU.getGyroY_rads(),1);
 Serial.print("|");
  Serial.print(IMU.getGyroZ_rads(),1);
Serial.print("|");
  Serial.print(IMU.getMagX_uT(),0);
   Serial.print("|");
 Serial.print(IMU.getMagY_uT(),0);
   Serial.print("|");
 Serial.print(IMU.getMagZ_uT(),0);
   Serial.print("|");
  Serial.println(IMU.getTemperature_C(),2);
  delay(1000);
}

Credits

walid abdelazeem

walid abdelazeem

6 projects • 6 followers

Comments