MPU-9250 sensor driver.

Overview

mpu9250

This library communicates with InvenSense MPU-9250 and MPU-9255 Inertial Measurement Units (IMUs).

Description

The InvenSense MPU-9250 is a System in Package (SiP) that combines two chips: the MPU-6500 three-axis gyroscope and three-axis accelerometer; and the AK8963 three-axis magnetometer. The MPU-9250 supports I2C, up to 400 kHz, and SPI communication, up to 1 MHz for register setup and 20 MHz for data reading. The following selectable full scale sensor ranges are available:

Gyroscope Full Scale Range Accelerometer Full Scale Range Magnetometer Full Scale Range
+/- 250 deg/s +/- 2g +/- 4800 uT
+/- 500 deg/s +/- 4g
+/- 1000 deg/s +/- 8g
+/- 2000 deg/s +/- 16g

The MPU-9250 samples the gyros, accelerometers, and magnetometers with 16 bit analog to digital converters. It also features programmable digital filters, a precision clock, an embedded temperature sensor, and programmable interrupts.

Installation

CMake is used to build this library, which is exported as a library target called mpu9250. The header is added as:

#include "mpu9250/mpu9250.h"

The library can be also be compiled stand-alone using the CMake idiom of creating a build directory and then, from within that directory issuing:

cmake .. -DMCU=MK66FX1M0
make

This will build the library and example executables called i2c_example and spi_example. The example executable source files are located at examples/i2c.cc and examples/spi.cc. Notice that the cmake command includes a define specifying the microcontroller the code is being compiled for. This is required to correctly configure the code, CPU frequency, and compile/linker options. The available MCUs are:

  • MK20DX128
  • MK20DX256
  • MK64FX512
  • MK66FX1M0
  • MKL26Z64
  • IMXRT1062_T40
  • IMXRT1062_T41

These are known to work with the same packages used in Teensy products. Also switching packages is known to work well, as long as it's only a package change.

The i2c_example and spi_example targets create executables for communicating with the sensor using I2C or SPI communication, respectively. Each target also has a _hex for creating the hex file to upload to the microcontroller.

Namespace

This library is within the namespace sensors.

Methods

Mpu9250(i2c_t3 *bus, uint8_t addr) Creates a Mpu9250 object. This constructor is used for the I2C communication interface. A pointer to the I2C bus object is passed along with the I2C address of the sensor. The address will be 0x68 if the AD0 pin is grounded and 0x69 if the AD0 pin is pulled high.

sensors::Mpu9250 mpu9250(&Wire, 0x68);

Mpu9250(SPIClass *bus, uint8_t cs) Creates a Mpu9250 object. This constructor is used for the SPI communication interface. A pointer to the SPI bus object is passed along with the chip select pin of the sensor. Any pin capable of digital I/O can be used as a chip select pin.

sensors::Mpu9250 mpu9250(&SPI, 2);

bool Begin() Initializes communication with the sensor and configures the default sensor ranges, sampling rates, and low pass filter settings. The default accelerometer range is +/- 16g and the default gyro range is +/- 2,000 deg/s. The default sampling rate is 1000 Hz and the low-pass filter is set to a cutoff frequency of 184 Hz. True is returned if communication is able to be established with the sensor and configuration completes successfully, otherwise, false is returned.

bool status = mpu9250.Begin();
if (!status) {
  // ERROR
}

bool EnableDrdyInt() Enables the data ready interrupt. A 50 us interrupt will be triggered on the MPU-9250 INT pin when IMU data is ready. This interrupt is active high. This method returns true if the interrupt is successfully enabled, otherwise, false is returned.

bool status = mpu9250.EnableDrdyInt();
if (!status) {
  // ERROR
}

bool DisableDrdyInt() Disables the data ready interrupt. This method returns true if the interrupt is successfully disabled, otherwise, false is returned.

bool status = mpu9250.DisableDrdyInt();
if (!status) {
  // ERROR
}

void ApplyRotation(const Eigen::Matrix3f &c) Applies a rotation matrix to the sensor measurements. The default value for c is the identity matrix and the default sensor reference frame is shown below:

MPU-9250 Reference Frame

Outputs are defined as:

Xu = c * Xb

Where Xu is the output, c is the rotation matrix, and Xb are the measurements in the sensor reference frame.

/*
* c =   0 1 0
*       1 0 0
*       0 0 1
*/
Eigen::Matrix3f c = Eigen::Matrix3f::Zero();
c(0, 1) = 1.0f;
c(1, 0) = 1.0f;
c(2, 2) = 1.0f;
mpu9250.ApplyRotation(c);

Eigen::Matrix3f rotation() Returns the current rotation matrix.

Eigen::Matrix3f c = mpu9250.rotation();

bool ConfigAccelRange(const AccelRange range) Sets the accelerometer full scale range. Options are:

Range Enum Value
+/- 2g ACCEL_RANGE_2G
+/- 4g ACCEL_RANGE_4G
+/- 8g ACCEL_RANGE_8G
+/- 16g ACCEL_RANGE_16G

True is returned on succesfully setting the accelerometer range, otherwise, false is returned. The default range is +/-16g.

bool status = mpu9250.ConfigAccelRange(Mpu9250::ACCEL_RANGE_4G);
if (!status) {
  // ERROR
}

AccelRange accel_range() Returns the current accelerometer range.

AccelRange range = mpu9250.accel_range();

bool ConfigGyroRange(const GyroRange range) Sets the gyro full scale range. Options are:

Range Enum Value
+/- 250 deg/s GYRO_RANGE_250DPS
+/- 500 deg/s GYRO_RANGE_500DPS
+/- 1000 deg/s GYRO_RANGE_1000DPS
+/- 2000 deg/s GYRO_RANGE_2000DPS

True is returned on succesfully setting the gyro range, otherwise, false is returned. The default range is +/-2000 deg/s.

bool status = mpu9250.ConfigGyroRange(Mpu9250::GYRO_RANGE_1000DPS);
if (!status) {
  // ERROR
}

GyroRange gyro_range() Returns the current gyro range.

GyroRange range = mpu9250.gyro_range();

bool ConfigSrd(const uint8_t srd) Sets the sensor sample rate divider. The MPU-9250 samples the accelerometer and gyro at a rate, in Hz, defined by:

rate = 1000 / (srd + 1)

A srd setting of 0 means the MPU-9250 samples the accelerometer and gyro at 1000 Hz. A srd setting of 4 would set the sampling at 200 Hz. The IMU data ready interrupt is tied to the rate defined by the sample rate divider. The magnetometer is sampled at 100 Hz for sample rate divider values corresponding to 100 Hz or greater. Otherwise, the magnetometer is sampled at 8 Hz.

True is returned on succesfully setting the sample rate divider, otherwise, false is returned. The default sample rate divider value is 0, resulting in a 1000 Hz sample rate.

/* Set sample rate divider for 50 Hz */
bool status = mpu9250.sample_rate_divider(19);
if (!status) {
  // ERROR
}

uint8_t srd() Returns the current sample rate divider value.

uint8_t srd = mpu9250.srd();

bool ConfigDlpf(const DlpfBandwidth dlpf) Sets the cutoff frequency of the digital low pass filter for the accelerometer, gyro, and temperature sensor. Available bandwidths are:

DLPF Bandwidth Enum Value
184 Hz DLPF_BANDWIDTH_184HZ
92 Hz DLPF_BANDWIDTH_92HZ
41 Hz DLPF_BANDWIDTH_41HZ
20 Hz DLPF_BANDWIDTH_20HZ
10 Hz DLPF_BANDWIDTH_10HZ
5 Hz DLPF_BANDWIDTH_5HZ

True is returned on succesfully setting the digital low pass filters, otherwise, false is returned. The default bandwidth is 184 Hz.

bool status = mpu9250.ConfigDlpf(Mpu9250::DLPF_BANDWIDTH_20HZ);
if (!status) {
  // ERROR
}

DlpfBandwidth dlpf() Returns the current digital low pass filter bandwidth setting.

DlpfBandwidth dlpf = mpu9250.dlpf();

void DrdyCallback(uint8_t int_pin, void (*function)()) Assigns a callback function to be called on the MPU-9250 data ready interrupt. Input parameters are the microcontroller pin number connected to the MPU-9250 interrupt pin and the function name.

void imu_isr() {
  /* Read the IMU data */
  if (mpu9250.Read()) {
  }
}

void main() {
  /* Setup callback for data ready interrupt */
  mpu9250.DrdyCallback(MPU9250_I2C_INT, imu_isr);
}

bool Read() Reads data from the MPU-9250 and stores the data in the Mpu9250 object. Returns true if data is successfully read, otherwise, returns false.

/* Read the IMU data */
if (mpu9250.Read()) {
}

float accel_x_mps2() Returns the x accelerometer data from the Mpu9250 object in units of m/s/s. Similar methods exist for the y and z axis data.

/* Read the IMU data */
if (mpu9250.Read()) {
  float ax = mpu9250.accel_x_mps2();
  float ay = mpu9250.accel_y_mps2();
  float az = mpu9250.accel_z_mps2();
}

Eigen::Vector3f accel_mps2() Returns the accelerometer data from the Mpu9250 objects as a 3-dimensional vector in units of m/s/s.

/* Read the IMU data */
if (mpu9250.Read()) {
  Eigen::Vector3f accel = mpu9250.accel_mps2();
}

float gyro_x_radps() Returns the x gyro data from the Mpu9250 object in units of rad/s. Similar methods exist for the y and z axis data.

/* Read the IMU data */
if (mpu9250.Read()) {
  float gx = mpu9250.gyro_x_radps();
  float gy = mpu9250.gyro_y_radps();
  float gz = mpu9250.gyro_z_radps();
}

Eigen::Vector3f gyro_radps() Returns the gyro data from the Mpu9250 objects as a 3-dimensional vector in units of rad/s.

/* Read the IMU data */
if (mpu9250.Read()) {
  Eigen::Vector3f gyro = mpu9250.gyro_radps();
}

float mag_x_ut() Returns the x magnetometer data from the Mpu9250 object in units of uT. Similar methods exist for the y and z axis data.

/* Read the IMU data */
if (mpu9250.Read()) {
  float hx = mpu9250.mag_x_ut();
  float hy = mpu9250.mag_y_ut();
  float hz = mpu9250.mag_z_ut();
}

Eigen::Vector3f mag_ut() Returns the magnetometer data from the Mpu9250 objects as a 3-dimensional vector in units of uT.

/* Read the IMU data */
if (mpu9250.Read()) {
  Eigen::Vector3f mag = mpu9250.mag_ut();
}

float die_temperature_c() Returns the die temperature of the sensor in units of C.

/* Read the IMU data */
if (mpu9250.Read()) {
  float temp = mpu9250.die_temperature_c();
}
Issues
  • Not working at all for me I2C

    Not working at all for me I2C

    Arduino --> MPU9250 5V --> VCC GND --> GND A4 --> SDA A5 --> SCL

    IMU initialization unsuccessful Check IMU wiring or try cycling power Status: -1

    Sensor recognized in the I2C scanner

    opened by iFrostizz 20
  • calibrateAccel() not calculating bias/scale?

    calibrateAccel() not calculating bias/scale?

    I've been trying to run the calibration code for the MPU9250, and the calibrateMag() method seems to work, but the calibrateAccel() method simply returns bias 0 and scale 1. I am running the function 6 times, changing the orientation of the imu with +z, -z, +y, -y, +x, -x pointing up in that order, switching whenever the "switch" serial print appears and holding position until the next. Any ideas?

    Hardware running the code: ESP8266 WeMos D1 mini with MPU9250 Code I'm running:

    /*
    CalibrateMPU9250.ino
    Brian R Taylor
    [email protected]
    Copyright (c) 2017 Bolder Flight Systems
    Permission is hereby granted, free of charge, to any person obtaining a copy of this software 
    and associated documentation files (the "Software"), to deal in the Software without restriction, 
    including without limitation the rights to use, copy, modify, merge, publish, distribute, 
    sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 
    furnished to do so, subject to the following conditions:
    The above copyright notice and this permission notice shall be included in all copies or 
    substantial portions of the Software.
    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 
    BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 
    NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 
    DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
    */
    
    #include "MPU9250.h"
    #include "EEPROM.h"
    
    // an MPU-9250 object on SPI bus 0 with chip select 10
    MPU9250 Imu(Wire, 0x68);
    int status;
    
    // EEPROM buffer and variable to save accel and mag bias 
    // and scale factors
    uint8_t EepromBuffer[48];
    float value;
    
    void setup() {
      // serial to display instructions
      Serial.begin(57600);
      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) {}
      }
      // calibrating accelerometer
      Serial.println("Starting Accelerometer Calibration");
      Imu.calibrateAccel();
      Serial.println("Switch");
      delay(5000);
      Imu.calibrateAccel();
      Serial.println("Switch");
      delay(5000);
      Imu.calibrateAccel();
      Serial.println("Switch");
      delay(5000);
      Imu.calibrateAccel();
      Serial.println("Switch");
      delay(5000);
      Imu.calibrateAccel();
      Serial.println("Switch");
      delay(5000);
      Imu.calibrateAccel();
      Serial.println("Done");
      Serial.println("Starting Magnetometer Calibration");
      delay(5000);
      // calibrating magnetometer
      Imu.calibrateMag();
      // saving to EEPROM
      value = Imu.getAccelBiasX_mss();
      memcpy(EepromBuffer,&value,4);
      Serial.print(value);
      Serial.println(": abx");
      value = Imu.getAccelScaleFactorX();
      memcpy(EepromBuffer+4,&value,4);
      Serial.print(value);
      Serial.println(": asx");
      value = Imu.getAccelBiasY_mss();
      memcpy(EepromBuffer+8,&value,4);
      Serial.print(value);
      Serial.println(": aby");
      value = Imu.getAccelScaleFactorY();
      memcpy(EepromBuffer+12,&value,4);
      Serial.print(value);
      Serial.println(": asy");
      value = Imu.getAccelBiasZ_mss();
      memcpy(EepromBuffer+16,&value,4);
      Serial.print(value);
      Serial.println(": abz");
      value = Imu.getAccelScaleFactorZ();
      memcpy(EepromBuffer+20,&value,4);
      Serial.print(value);
      Serial.println(": asz");
      value = Imu.getMagBiasX_uT();
      memcpy(EepromBuffer+24,&value,4);
      Serial.print(value);
      Serial.println(": mbx");
      value = Imu.getMagScaleFactorX();
      memcpy(EepromBuffer+28,&value,4);
      Serial.print(value);
      Serial.println(": msx");
      value = Imu.getMagBiasY_uT();
      memcpy(EepromBuffer+32,&value,4);
      Serial.print(value);
      Serial.println(": mby");
      value = Imu.getMagScaleFactorY();
      memcpy(EepromBuffer+36,&value,4);
      Serial.print(value);
      Serial.println(": msy");
      value = Imu.getMagBiasZ_uT();
      memcpy(EepromBuffer+40,&value,4);
      Serial.print(value);
      Serial.println(": mbz");
      value = Imu.getMagScaleFactorZ();
      memcpy(EepromBuffer+44,&value,4);
      Serial.print(value);
      Serial.println(": msz");
      for (size_t i=0; i < sizeof(EepromBuffer); i++) {
        EEPROM.write(i,EepromBuffer[i]);
      }
      Serial.println("Done");
    }
    
    void loop() {}
    
    opened by Sean-Katagiri 12
  • ESP32 and SPI connection: corrupt accelerometer and magnetometer values

    ESP32 and SPI connection: corrupt accelerometer and magnetometer values

    Hi,

    Issue: when using the library with an ESP32 connected via SPI, accelerometer and magnetometer values are corrupt. Example: Serial.print(IMU->getAccelX_mss(),6) prints "ovf".

    Reason: When not performing a calibration, numerous values for accelerometer biases such as "_axb" etc. defined in MPU9250.h are not initialized.

    opened by jtec 9
  • Basic_I2C Example with ESP32

    Basic_I2C Example with ESP32

    Hey, I'm trying to use the MPU9250 in combination with an ESP32 Dev Board instead of an Arduino. I already tested the connection with an I2C Scanner and it shows that there is a device connected with address 0x68 (SDA and SCL are Pins 21 and 22 on the ESP32). But when I start the Basic_I2C Example, I always get status = -1 from IMU.begin(). My wiring should be correct. Do you have any idea what the problem is and how I can get this working?

    opened by kitteltom 9
  • I am unable to begin communicating with my mpu9250

    I am unable to begin communicating with my mpu9250

    _s_e_sen-03-005-1 My MPU9250 looks exactly like this.

    First I check i2c connections using the following code (I copied it from somewhere else):

    uint8_t addrs[7] = {0};
    uint8_t device_count = 0;
    
    template <typename WireType = TwoWire>
    void scan_mpu(WireType& wire = Wire) {
        Serial.println("Searching for i2c devices...");
        device_count = 0;
        for (uint8_t i = 0x68; i < 0x70; ++i) {
            wire.beginTransmission(i);
            if (wire.endTransmission() == 0) {
                addrs[device_count++] = i;
                delay(10);
            }
        }
        Serial.print("Found ");
        Serial.print(device_count, DEC);
        Serial.println(" I2C devices");
    
        Serial.print("I2C addresses are: ");
        for (uint8_t i = 0; i < device_count; ++i) {
            Serial.print("0x");
            Serial.print(addrs[i], HEX);
            Serial.print(" ");
        }
        Serial.println();
    }
    
    template <typename WireType = TwoWire>
    uint8_t readByte(uint8_t address, uint8_t subAddress, WireType& wire = Wire) {
        uint8_t data = 0;
        wire.beginTransmission(address);
        wire.write(subAddress);
        wire.endTransmission(false);
        wire.requestFrom(address, (size_t)1);
        if (wire.available()) data = wire.read();
        return data;
    }
    
    
    
    void setup() {
        Serial.begin(115200);
        Serial.flush();
        Wire.begin();
        delay(2000);
    
        scan_mpu();
    
        if (device_count == 0) {
            Serial.println("No device found on I2C bus. Please check your hardware connection");
            while (1)
                ;
        }
    
        // check WHO_AM_I address of MPU
        for (uint8_t i = 0; i < device_count; ++i) {
            Serial.print("I2C address 0x");
            Serial.print(addrs[i], HEX);
            byte ca = readByte(addrs[i], WHO_AM_I_MPU9250);
            if (ca == MPU9250_WHOAMI_DEFAULT_VALUE) {
                Serial.println(" is MPU9250 and ready to use");
            } else if (ca == MPU9255_WHOAMI_DEFAULT_VALUE) {
                Serial.println(" is MPU9255 and ready to use");
            } else if (ca == MPU6500_WHOAMI_DEFAULT_VALUE) {
                Serial.println(" is MPU6500 and ready to use");
            } else {
                Serial.println(" is not MPU series");
                Serial.print("WHO_AM_I is ");
                Serial.println(ca, HEX);
                Serial.println("Please use correct device");
            }
            static constexpr uint8_t AK8963_ADDRESS {0x0C};  //  Address of magnetometer
            static constexpr uint8_t AK8963_WHOAMI_DEFAULT_VALUE {0x48};
            byte cb = readByte(AK8963_ADDRESS, AK8963_WHO_AM_I);
            if (cb == AK8963_WHOAMI_DEFAULT_VALUE) {
                Serial.print("AK8963 (Magnetometer) is ready to use");
            } else {
                Serial.print("AK8963 (Magnetometer) was not found");
            }
        }
    }
    
    void loop() {
    }
    

    I get the following output image

    Now here I am only able to detect 0x68 . But magnetormeter is not detected.

    Then I uploaded i2c example from your library.

    Error initializing communication with IMU
    

    If there is any information missing please tell me so that I can properly frame the question.

    Thanking you.

    opened by frozenmafia 8
  • Reading erros

    Reading erros

    Hello sir, thank you for your help, however, unfortunately when I try to test the I2C code given in the example, I get the following readings which I believe are wrong: image

    opened by TahaMoncef 8
  • Values from FIFO not correct

    Values from FIFO not correct

    Im trying to change my code to use the FIFO. The mpu9250 is connected to an esp32 over SPI and the example sketch works fine but if i enable the gyro and magnetometer some numbers are totally out of range and extremely noisy. Is there something im missing or is this an issue?

    opened by yo90bosses 8
  • Accelometer Z axis

    Accelometer Z axis

    The Z axis is not changing its value but I turn it at the right position and it is only changing if I turn it at the X or the Y axis then its the opposit of the x/y value. Do you know something about this problem? (The gyroscop and the magnetometer are working correctly)

    Sorry for my bad english but I hope you will understand my problem.

    opened by Myykami 8
  • Add calibration functions

    Add calibration functions

    It would be quite useful to have them I think you should add something to calibrate while running the sketch, a function to read the calibration data and a function to write calibration data

    opened by aster94 8
  • MPU9265 Gyro always Zero.

    MPU9265 Gyro always Zero.

    Hi Folks,

    got the new MPU9265, i2c_scanner device is there, .begin() .calibration() of all Gyro, Accel, Mag, is working, values look good, besides the Gyro-values:

    `

    0

    0,01 0,03 0 0,01 0,03 0 0,02 0,03 -0,01 0,02 -0,11 -0,01 -0,03 0,01 0,02 -0,02 0,02 -0,02

    ` The values are always around zero. Anything that i have forgotten, what i need to set manually to get gyro-sensor working?

    opened by lkaupp 7
  • Support for Teensy 4.0

    Support for Teensy 4.0

    I just tried to get the library working with the new Teensy 4.0 board over SPI (SPI bus 0) with an MPU9250. I've been getting errors (-1 on .begin()) when running the example sketches. Has it been tested on the new Teensy board? Would be great if it worked because of the small form factor and very powerful processor.

    opened by yo90bosses 7
  • SPI communication with teensy 4.1 is not working

    SPI communication with teensy 4.1 is not working

    my i2c program works correctly but spi communication is showing "Error initializing communication with IMU" on serial monitor.i have used example program "spi".my connections are as follows

    • VDD: 3.3V
    • GND: ground.
    • FSYNC: grounded.
    • INT:pin 9
    • SDA / SDI:MOSI.pin 11
    • SCL / SCLK: SCK ie pin 13.
    • AD0 / SDO: MISO.pin 12
    • nCS: Pin 10
    • AUXDA: not used.
    • AUXCL: not used.
    opened by asinghnu 12
  • Glitches on Gyro data

    Glitches on Gyro data

    I ran your i2c example, but I added Serial print statements for Arduino Serial Plotter labels, adding offsets so the traces don't overlap.

    if (imu.Read()) {

            Serial.print("Max:250,");    
            Serial.print("NewIMU:");    
            Serial.print(imu.new_imu_data()*150);
            Serial.print(",");
            
            Serial.print("NewMAG:");    
            Serial.print(imu.new_mag_data()*100);
            Serial.print(",");
    
            Serial.print("AccX:");    
            Serial.print(imu.accel_x_mps2());
            Serial.print(",");
            
            Serial.print("AccY:");    
            Serial.print(imu.accel_y_mps2()-20);
            Serial.print(",");
            
            Serial.print("AccZ:");    
            Serial.print(imu.accel_z_mps2()-40);
            Serial.print(",");
            
            Serial.print("GyrX:");    
            Serial.print(imu.gyro_x_radps()-20);
            Serial.print(",");
            
            Serial.print("GyrY:");    
            Serial.print(imu.gyro_y_radps()-40);
            Serial.print(",");
            
            Serial.print("GyrZ:");    
            Serial.print(imu.gyro_z_radps()-60);
            Serial.print(",");
            
            Serial.print("MagX:");    
            Serial.print(imu.mag_x_ut());
            Serial.print(",");
            
            Serial.print("MagY:");    
            Serial.print(imu.mag_y_ut()-20);
            Serial.print(",");
            
            Serial.print("MagZ:");    
            Serial.print(imu.mag_z_ut());
            Serial.println("Min:-250");    
                        
            //Serial.print(imu.die_temp_c());
            //Serial.print("\n");
    

    when I run this example with my ESP32 Dev Board and MPU9250 board, I use Arduino Serial Plotter and get the following plot:

    Gyro glitches

    Searching the web - I found this post about gyro glitches: https://forums.adafruit.com/viewtopic.php?f=19&p=531590

    I wonder if the issue is similar - the code is getting interrupted between individual MPU register reads, and should read whole blocks of MPU i2c registers to prevent this kind of issue.

    opened by mmcgraw74 8
Releases(v1.0.2)
Owner
Bolder Flight Systems
We make flight control and data acquisition systems with unparalleled data quality and robustness.
Bolder Flight Systems
DIY Zigbee CC2530 Motion sensor (AM312/ AM412/ BS312/ BS412), Temperature /Humidity /Pressure sensor (BME280), Ambient Light sensor (BH1750), 2.9/2.13/1.54 inch e-Paper Module

How to join: If device in FN(factory new) state: Press and hold button (1) for 2-3 seconds, until device start flashing led Wait, in case of successfu

Sergey Koptyakov 28 Jul 27, 2022
A simple example for 'Arduino' compatible boards to interface with I2C to the MPU-6050, a 6-axis micro-electromechanical IC

Arduino-MPU-6050 A simple example for 'Arduino' compatible boards to interface with I2C to the MPU-6050, a 6-axis micro-electromechanical IC ==About==

Ivan 1 Oct 19, 2021
Amiga 1200 keyboard MPU drop-in replacement pcb

A1200_keyb_MPU Amiga 1200 keyboard MPU drop-in replacement pcb As the 68HC05 (p/n 391508-01) used in the Amiga 1200 is getting to be very expensive, I

Oleg Mishin 16 Jun 22, 2022
Loads a signed kernel driver which allows you to map any driver to kernel mode without any traces of the signed / mapped driver.

CosMapper Loads a signed kernel driver (signed with leaked cert) which allows you to map any driver to kernel mode without any traces of the signed /

null 118 Jul 26, 2022
multispectral monitoring of a sourdough starter; esp32 eink module, scd30 co2 sensor, vl6180 distance sensor

EINK STARTER MONITOR See full blogpost here Tracks height of starter with a VL6180 i2c distance sensor, and CO2/temperature/humidity with an SCD30. A

AKA 15 Feb 16, 2022
Sensirion Mass Flow Sensor Arduino library, modified from MyElectrons and Nabilphysics Arduino repositories for SFM3300 Digital Mass Flow Sensor

Sensirion Mass Flow Sensor Arduino library, modified from MyElectrons and Nabilphysics Arduino repositories for SFM3300 Digital Mass Flow Sensor. When the sensor data gets stuck, the library has a hard reset function to ensure that it is read continuously.

Paul Ryan Santiago 3 Apr 11, 2022
Tasmota-Berry Tank Sensor for fuel-oil usind VL53L1X or SR04 sensor

Tasmota-Tank-Sensor Tasmota-Berry Tank Sensor for fuel-oil volume measurement using an VL53L1X or SR04 sensor The Sensor body The sensor was prepared

Tom Lafleur 2 Feb 10, 2022
Driver for the TI TMP102 I2C temperature sensor. For use with TI TM4C123X MCUs.

TI TMP102 Driver Simple driver for the TI TMP102 I2C temperature sensor. For use with TI TM4C123X MCUs and TI's TivaWare™ Peripheral Driver Library. D

Dan Maher 4 Jun 27, 2021
Linux HWMON sensors driver for ASUS motherboards to get sensor readings from the embedded controller

asus-wmi-ec-sensors Linux HWMON sensors driver for ASUS motherboards to read sensors from the embedded controller Many ASUS motherboards do not publis

Eugene Shalygin 5 Aug 6, 2022
Veml7700-esp-idf - VEML7700 Light Sensor driver for ESP-IDF

VEML7700 Light Sensor driver for ESP-IDF Overview This project aims to provide a very simple interface for configuring and reading data from the VEML7

Kristijan Grozdanovski 3 Jul 29, 2022
Generic embedded C driver to work with Sensirion's SEN5x environmental sensor modules via I2C

Sensirion Embedded I2C SEN5x Driver This is a generic embedded driver for the Sensirion SEN5x sensor modules. It enables developers to communicate wit

Sensirion AG 4 Jul 11, 2022
x64 Windows kernel driver mapper, inject unsigned driver using anycall

anymapper x64 Windows kernel driver mapper, inject unsigned driver using anycall This project is WIP. Todo Fix: Can't make API calls from IAT nor func

Kento Oki 68 Jun 22, 2022
Driver leap - Self-sustainable fork of SteamVR driver for Leap Motion controller with updated vendor libraries

Driver Leap Self-sustainable fork of SteamVR driver for Leap Motion controller with updated vendor libraries Installation (for users) Install Ultralea

null 46 Jul 28, 2022
Hygieia, a vulnerable driver traces scanner written in C++ as an x64 Windows kernel driver.

Hygieia The Greek goddess of health, her name is the source for the word "hygiene". Hygieia is a windows driver that works similarly to how pagewalkr

Deputation 69 Jul 27, 2022
SinMapper - usermode driver mapper that forcefully loads any signed kernel driver

usermode driver mapper that forcefully loads any signed kernel driver (legit cert) with a big enough section (example: .data, .rdata) to map your driver over. the main focus of this project is to prevent modern anti-cheats (BattlEye, EAC) from finding your driver and having the power to hook anything due to being inside of legit memory (signed legit driver).

null 107 Jul 28, 2022
This is a tool for software engineers to view,record and analyse data(sensor data and module data) In the process of software development.

![Contributors][Huang Jianyu] Statement 由于工具源码在网上公开,除使用部分开源项目代码外,其余代码均来自我个人,工具本身不包含公司的知识产权,所有与公司有关的内容均从软件包中移除,软件发布遵循Apache协议,任何人均可下载进行修改使用,如使用过程中出现任何问

HuangJianyu 34 May 5, 2022
Allows for multiple SwitchBot buttons and curtains to be controlled via MQTT sent to ESP32. ESP32 will send BLE commands to switchbots and return MQTT responses to the broker. Also supports Meter/Temp Sensor

SwitchBot-MQTT-BLE-ESP32 Switchbot local control using ESP32. no switchbot hub used/required. works with any smarthub that supports MQTT https://githu

null 270 Jul 31, 2022
🪴💧 A Bluetooth Low Energy (BLE) soil moisture sensor.

b-parasite b-parasite is an open source Bluetooth Low Energy (BLE) soil moisture and ambient temperature/humidity sensor. Features Soil moisture senso

null 520 Aug 7, 2022
Arduino based bicycle movement sensor and GPS tracker

Bike Tracker Background There are actually plenty of bicycle trackers around, so why make your own? Well, so that it works the way you want it… And it

null 21 Jul 2, 2022