Exploring the MPU9250

Background

Inspired by :

Hrisko, J. (2019). Accelerometer, Gyroscope, and Magnetometer Analysis with Raspberry Pi Part I: Basic Readings. Maker Portal.

https://makersportal.com/blog/2019/11/11/raspberry-pi-python-accelerometer-gyroscope-magnetometer#interfacing

I bought a breadboard with the MPU9250 chip to experiment with its accelerometer and gyroscope.

MPU9250 breadboard

The breadboard is used together with a Raspberry Pi and a WiFi adapter:

Setup

First Steps

  1. Enabling communication of I2C devices on the RaspberryPI
  2. testing the communication using Linux tools
  3. installing Python library to access I2C devices from Python
  4. configuring I2C settings on RaspberryPI
  5. getting / modifying a Python utility / library to configure the MPU9250 chip and read accelerometer & gyroscope data

More details are available on GitHub:

https://github.com/michaelbiester/mpu9250

The Readme file on GitHub provides more information how to setup the chip and how to read data of the accelerometer and gyroscope with Python. A Jupyter notebook visualizes two recordings each having 1000 data points. A PDF version of the notebook is available too:

https://github.com/michaelbiester/mpu9250/blob/master/ipython/mpu9250/trace_plot.pdf

Another notebook on GitHub explores the repeatability of static measurements with the MPU9250. Some posts claim that there is a repeatability issue with the gyroscope. However I could not confirm this claim. More of that can be found here:

https://github.com/michaelbiester/mpu9250/blob/master/ipython/mpu9250/repeatability_1.pdf


Resources

Exploring Raspberry Pi / Interfacing to the Real World with Embedded Linux; Author: Derek Molloy; Publisher: John Wiley & Sons, Inc.

Raspberry Pi User Guide, Authors: Eben Upton, Gareth Halfacree; Publisher: John Wiley & Sons, Inc.

https://readthedocs.org/projects/smbus2/downloads/pdf/latest/

https://makersportal.com/blog/2019/11/11/raspberry-pi-python-accelerometer-gyroscope-magnetometer#interfacing