P-09 //

tiny vario

A 16 × 16 × 13 mm, 5.51 g flight instrument: custom four-layer PCB, STM32 firmware and a barometer/IMU estimator turn vertical movement into audible climb cues.

Hardware prototype built
  • STM32
  • Sensor fusion
  • Kalman filter
  • PCB design
  • Embedded C
Open repository
tiny vario project

Six years after my first variometer, I challenged myself to shrink a complete audible flight instrument rather than just the sensor board. tiny vario packs a 16 × 16 × 13 mm enclosure, LiPo battery and sound output into 5.51 g. The tiny package is a system-design constraint: the board, battery, charging, sensor placement, buzzer and firmware all have to work together.

Electronics and packaging

I designed a custom four-layer PCB around the low-power STM32L031G6U6 instead of stacking off-the-shelf breakout boards. An SPL06-001 pressure sensor measures altitude changes, while an LSM6DS3 accelerometer/gyroscope supplies inertial data. A PAM8904 drives the piezo buzzer; a single-cell LiPo and USB charging fit inside the 3D-printed case. Placing the cell under the board and designing the enclosure around the assembly kept the instrument compact enough to carry without a large flight-computer housing.

tiny vario hardware video. Play with sound to hear the instrument.

From pressure to an audible climb rate

Barometric altitude alone is noisy when differentiated into vertical speed. The firmware uses the IMU's approximately 26 Hz interrupt to trigger a DMA sensor read, with pressure updates at approximately 8 Hz. A Madgwick attitude filter rotates acceleration into the world frame, and a three-state Kalman filter estimates altitude, vertical velocity and accelerometer bias from the inertial prediction and barometric altitude corrections. A barometer-based complementary-filter path remains in the code for comparison. This structure helps the sound respond to changes in climb rate without simply amplifying pressure noise.

The estimator explicitly checks barometer innovations before accepting them and updates covariance in Joseph form. Since there is no magnetometer, absolute yaw and its gyro bias are not observable; the vertical estimator is designed around that limitation rather than pretending to measure heading.

Validation against a simulated flight

Configuration scope: the plots below use 52 Hz development-model tuning. The deployed C firmware uses approximately 26 Hz and different filter constants. These results do not validate the deployed firmware tuning.

I checked the filters against a synthetic, approximately 20-minute paraglider flight using both a nonlinear 6-DOF Simulink/Simscape simulation and a separate MATLAB reference harness. After excluding the first 10 seconds of warm-up, the Simulink comparison found 0.21 m altitude RMSE for both the barometer-only and IMU-aided filters. Vertical-speed RMSE was 0.11 m/s for barometer-only versus 0.12 m/s for Madgwick plus the three-state Kalman filter. The respective maximum absolute altitude errors were 0.50 and 0.48 m, and maximum vertical-speed errors were 0.72 and 0.78 m/s. These simulation numbers do not establish in-flight accuracy or a longer battery runtime; they show why I assess the IMU path for responsiveness rather than claiming a lower RMSE.

Synthetic paraglider flight: altitude, roll and pitch, acceleration, and ground track
Validation scenario: the simulated flight supplies ground-truth altitude, motion and attitude through changing climb conditions. Click any plot for the full-resolution version.
Altitude estimation error compared with ground truth for barometer-only and IMU-aided filters
Altitude error: both estimators track similarly over the simulated flight; the lower panel zooms in on a tight thermal.
Vertical-speed estimation error compared with ground truth for barometer-only and IMU-aided filters
Vertical-speed error: the inertial path does not produce a lower steady-state RMSE in this simulation; response to changing motion is the key design question.

Native host tests exercise the attitude and vertical-speed filters without the target microcontroller, including convergence, zero-velocity updates and rejected outlier measurements. EEPROM regressions check independent battery/volume records, CRC validation, reloads and interrupted writes. These are software checks, not in-flight accuracy measurements. The embedded project is built with STM32CubeIDE or an ARM GCC toolchain and programmed over ST-Link/SWD.

Operating the instrument

A two-second button hold turns the device on, a short press cycles through three buzzer volume levels, and LEDs communicate battery, charging and volume state. The firmware has off, active and charging states, with standby/wake handling to limit idle power use. An independent watchdog is intended to reset the MCU if firmware stops refreshing it; this is not a safety guarantee. Battery monitoring compensates ADC measurements against the internal voltage reference and retains a consumed-capacity estimate in EEPROM. Capacity is a model-based estimate from assumed operating-state currents, not a measurement of battery current. Battery state and volume now use separate, versioned CRC-protected EEPROM records rather than sharing a storage address.

What I learned

The main engineering trade-off was not just making a smaller PCB: it was balancing update rate, response, measurement noise, power and acoustic feedback with almost no space to spare. The more involved IMU-aided estimator primarily targets faster response; steady-state error is not necessarily better than a barometer-only estimate. That makes testing the perceived timing and usefulness of the audible cues just as important as comparing filter traces.

The open-source firmware and electronics documentation include the STM32 project, schematics, MATLAB validation harness and comparison plots under GPL-3.0. The full nonlinear Simulink model and enclosure CAD are not published there; the photographs below show the built hardware and its packaging.

tiny vario project image
20260628_185102
tiny vario project image
tiny vario project image