MicroPython drivers for InvenSense MPU9250, MPU9150, and MPU6050 IMUs, providing calibrated sensor data for motion tracking.
micropython-mpu9x50 is a MicroPython driver library for InvenSense inertial measurement units (IMUs) like the MPU9250, MPU9150, and MPU6050. It provides a clean API to read acceleration, gyroscope, and magnetometer data, with built-in axis alignment and calibration. The library solves the problem of accessing raw sensor data in embedded MicroPython projects by abstracting I2C communication and sensor-specific configurations.
Embedded developers and hobbyists using MicroPython on platforms like the Pyboard who need to integrate motion sensing or orientation tracking with IMU sensors.
Developers choose this library because it offers a unified, calibrated interface for multiple IMU models, includes vehicle-relative coordinate mapping for sensor fusion, and provides tools for real-time data reading even in interrupt contexts, all within the MicroPython ecosystem.
Drivers for InvenSense inertial measurement units MPU9250, MPU9150, MPU6050
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Offers a common base class for MPU9250, MPU9150, and MPU6050, reducing code duplication when switching between sensors, as stated in the introduction and module descriptions.
Corrects magnetometer axes to align with accelerometer and gyroscope coordinates, ensuring consistent 3D data without manual adjustment, detailed in the axis correction feature.
Supports transposition and scaling for sensor mounting alignment, essential for integration with Madgwick fusion algorithms, as explained in the vehicle-relative coordinates section.
Includes methods like mag.calibrate() for magnetometer calibration, demonstrated with pyb.Switch in the README demo, providing practical calibration support.
Provides accel_filter_range and gyro_filter_range properties to set digital low-pass filters, with detailed tables for bandwidth and delay, enabling vibration noise reduction.
Interrupt callbacks using get_accel_irq() are labeled 'somewhat experimental' and cautioned as a 'black art' due to heap usage in MicroPython, limiting reliability for real-time applications.
The driver explicitly assumes I2C connection, despite MPU9250 supporting SPI, restricting hardware configuration options, as noted in the introduction.
Key aspects like vector3d class and interrupt usage are documented in separate files or described minimally, with the README admitting interrupt handling is unclear, offering sparse guidance.
The exception handling section notes that I2C bus lock-ups often require a power cycle to clear, indicating potential stability problems in faulty hardware setups.