Real-time orientation display with the MinIMU-9 v2

The MinIMU-9 v2 (catchy, no?) is a tiny inertial measurement unit (IMU). It has has three axes of gyroscope, accelerometer and magnetometer on board, which mean you can use it to sense the precise orientation of the device itself and, by extension, whatever it’s fixed to.

You’ll find IMUs in devices like model aeroplanes and VR headsets. This one talks to I²C, making it an ideal fit for the Raspberry Pi – all that was needed for this project was the IMU, a Pi and a few jumper cables.

IMU with Raspberry Pi

David Grayson has hooked it up to the Pi’s I²C bus and has built some software (available on GitHub) that uses the Raspberry Pi’s powerful 3D graphics to impose a visualisation process on the raw data in real time. This means that you can display on screen exactly what position the IMU is in, on the fly.

David’s software comes with a number of different modes, including gyro only and magnet only, which are useful for understanding how IMUs work, and also for troubleshooting any system you might build using one.

If you’re interested in getting acquainted with manipulating IMUs yourself, David has made a superbly detailed tutorial available alongside the source code itself on GitHub. Thanks David – it’s always a pleasure to see work that’s documented so well, especially when it’s accompanied by such tidy source code.

For those who’d like to see more of David’s work, he has a blog (inventively titled David Grayson’s Blog).