How Stratux AHRS works: sensors, fusion and calibration
Stratux AHRS reads a gyro, an accelerometer and a magnetometer on a small board. The Raspberry Pi combines the gyro and accelerometer with GPS track and vertical speed. It sends pitch, roll and heading to your EFB about 20 times a second. The heading comes from GPS track and the gyro, not the magnetometer. An AHRS (attitude and heading reference system) is the box that tells a display which way the aircraft is pointing. The Stratux software does a lot with those readings. We'll walk through what it does, since that explains why the setup steps matter.

What the AHRS board measures
The board holds three kinds of sensor, and each one covers a weakness of the others. A gyro measures how fast the unit is turning. An accelerometer senses which way gravity pulls, and it helps correct gyro drift. A magnetometer senses the Earth's magnetic field. Stratux passes its readings to the filter, but the heading it sends comes from GPS track and the gyro (FLYING magazine, 2016).
The AHRS board plugs onto the Pi's GPIO header, not USB. The Stratux code recognizes several chips. For motion it looks for a BMX160, an ICM-20948 or an MPU-9250-family part. For air pressure it looks for a BMP-388, BMP-280 or BMP-58x. It checks the I2C bus at two addresses and tries again every 4 seconds if nothing answers (Stratux source, main/sensors.go, read 2026-11-02). Which chip you have depends on the board revision. The GPS/AHRS page in the web interface shows whether the sensor was found. If it wasn't, we'd check the wiring first.
How the software turns readings into attitude
Stratux feeds the sensor readings into an AHRS library called goflying, and it sends the result out about 20 times a second. The attitude loop runs on a 50 ms timer. Besides gyro, accelerometer and magnetometer data, the code also passes in GPS ground track and vertical speed, taken from the barometer or from GPS (Stratux source, main/sensors.go, read 2026-11-02).
We checked the code, and you can check it too. Stratux uses the SimpleAHRS filter from goflying (ahrs.NewSimpleAHRS, main/sensors.go). It fuses GPS track with the gyro and accelerometer. GPS gives the filter a second opinion about where the aircraft is going. That's why the AHRS needs a good GPS fix to work properly. It's also what the "Ground test mode" message is about.
If the unit stops answering, the code closes the sensor after 50 failed reads and tries to reconnect. It also throws out barometer readings that wildly disagree with GPS altitude.
What calibration actually does
Calibration records two things: how the gyro reads when it's still, and which way is level. Each attempt stores its readings, even while the unit moves. The gyro step retries about once a second (Stratux source, main/sensors.go, read 2026-11-02).
- Gyro calibration stores readings as offsets on each attempt, for up to 50 attempts. Keep the unit still for the whole run. Do it parked, not taxiing.
- Level calibration stores readings on each attempt. It stops once the accelerometer is within 0.15 G of 1 G and the gyro is quiet, or after 50 attempts. Then it resets the filter.
Orientation is a separate step. The prompts find which of the unit's axes gravity points along most strongly, then build the mounting rotation from that. If no axis clearly dominates, the step fails. That's why the prompts want the unit held still and flat, with the face that points forward in normal use facing up. We cover the full procedure in AHRS on Stratux.
What this means in the cockpit
AHRS accuracy depends on mounting, calibration and GPS. It's a backup, not a primary instrument. It isn't certified for IFR, and no portable AHRS from any maker is. A few practical consequences follow from how the software works:
- Re-run orientation when you change the mount. The rotation is computed from how the unit sat during the prompts.
- Calibrate on the ground, still and level. We found that calibration doesn't reject movement, so a bump can be stored.
- Expect nothing on the ramp. Without a good GPS fix and some motion, the display can look dead.
- Not for you if you need a certified attitude source. Use your panel instruments.
Frequently asked questions
Which sensors does Stratux support for AHRS? The source recognizes the BMX160, ICM-20948 and MPU-9250-family motion sensors, plus BMP-388, BMP-280 and BMP-58x pressure sensors. The code probes the I2C bus for them.
How often does Stratux update attitude? The attitude loop runs on a 50 ms timer. The code comments call that about 20 Hz.
Why does AHRS calibration ask me to keep the unit still? Calibration stores readings on each attempt and doesn't wait for the unit to be still. Keep it still while it runs.
Can I trust Stratux AHRS as a primary attitude instrument? No. It's a backup for situational awareness. It isn't certified for IFR, and no portable AHRS is.
Next step
Open the web interface at 192.168.10.1 on the ground, go to GPS/AHRS, and confirm the attitude indicator moves when you tilt the unit. If it doesn't, we'd start with AHRS on Stratux.