Need help to develop an altitude ascent/descent rate algorithm
12:35 07 Mar 2026

I am using an STM32 microcontroller with a Bosch BME280 pressure sensor to develop a skydiving altimeter.

It works, but I am trying to improve the function to calculate the rate of change.

The altitude is easily calculated using...

Altitude (ft) = 145366.0 * (1.0f - pow(Current Pressure / Reference Pressure,0.1903f))

But I'm finding that calculating the rate of change is much more difficult, as the results are noisey with unrealistic spikes.

ChatGPT has done the usual and led me deep down rabbit holes, but only made things more complicated with poor results.

I am using a 50ms task to read the pressure sensor.

There must be some standard algorithms or even code out there that explain how to do this ?

stm32 rate altitude pressure