Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. MicroPython
  3. micropython-fusion

micropython-fusion

MITPython

A MicroPython library implementing the Madgwick algorithm for sensor fusion, calculating heading, pitch, and roll from motion tracking devices.

GitHubGitHub
346 stars71 forks0 contributors

What is micropython-fusion?

micropython-fusion is a MicroPython library that calculates 3D orientation (heading, pitch, roll) from motion sensor data using the Madgwick sensor fusion algorithm. It processes inputs from accelerometers, gyroscopes, and optionally magnetometers to determine a device's attitude relative to Earth, solving the problem of deriving accurate orientation from noisy raw sensor readings.

Target Audience

Developers working on MicroPython-based embedded systems, drones, robotics, or motion-tracking projects that require real-time orientation estimation from IMU sensors.

Value Proposition

It provides a lightweight, efficient implementation of a proven sensor fusion algorithm optimized for MicroPython's constraints, with both synchronous and asynchronous interfaces for flexible integration into time-sensitive applications.

Overview

Sensor fusion calculating yaw, pitch and roll from the outputs of motion tracking devices

Use Cases

Best For

  • Building flight controllers for drones or multicopters
  • Implementing orientation tracking in robotics projects
  • Adding motion sensing to MicroPython-based IoT devices
  • Developing tilt-compensated compass applications
  • Creating real-time attitude estimation for embedded systems
  • Educational projects involving sensor fusion and IMU data processing

Not Ideal For

  • Projects running on MicroPython platforms with less than 4KB of free RAM, where floating-point allocations could cause memory issues
  • Applications requiring sensor fusion algorithms beyond Madgwick, such as Kalman filters for high-dynamic motion
  • Teams needing out-of-the-box hardware support with pre-integrated sensor drivers and minimal setup
  • Real-time systems demanding update rates significantly above 50Hz or sub-millisecond latency guarantees

Pros & Cons

Pros

Proven Algorithm Efficiency

Implements the Madgwick algorithm with updates under 2ms on a Pyboard, suitable for real-time applications like drone flight controllers as noted in the README.

Dual Integration Modes

Offers both synchronous and asynchronous (uasyncio-based) versions, allowing flexible use in blocking or non-blocking code, with async mode enabling low-latency access to orientation data.

Hardware Independence

Designed to work with any IMU sensor by accepting raw data tuples, making it portable across different hardware without dependency on specific drivers.

Comprehensive Output Formats

Provides Euler angles (heading, pitch, roll) for easy interpretation and quaternions for efficient 3D rotation calculations, as highlighted in the bound variables section.

Cons

RAM Intensive on Low-End Hardware

Extensive use of floating-point maths leads to RAM allocation issues on memory-constrained platforms like ESP8266, requiring manual garbage collection and optimization, as warned in the MicroPython issues section.

Firmware Version Lock-in

Asynchronous mode depends on MicroPython firmware V1.12 or later for uasyncio V3 support, limiting compatibility with older or custom firmware builds.

No Built-in Sensor Drivers

Users must separately source and integrate sensor drivers (e.g., from external repositories), adding complexity to initial setup and configuration.

Frequently Asked Questions

Quick Stats

Stars346
Forks71
Contributors0
Open Issues5
Last commit5 years ago
CreatedSince 2015

Tags

#robotics#sensor-fusion#sensor#micropython#quaternions#embedded#imu#orientation#fusion

Built With

M
MicroPython
P
Python

Included in

MicroPython1.8k
Auto-fetched 1 day ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub