AnsweredAssumed Answered

use STM32 with lps331 pressure sensor in altimeter application

Question asked by lowpowermcu on Dec 21, 2012
Latest reply on Dec 21, 2012 by baird.hal.001

Hi all,

I want to build an altimeter using stm32f1xx device. I ordered an LPS331 sensor to build my product but...
After having bought the sensor I realized that LPS331 sensor can be used as altiemeter only if I do some median fillter :-(
I asked ST support if they have such filter but they, probavly have it but do not want to give it for me so if there somebody who implemented or know how to implement such filter (median filter) on STM32 ?
You find below the response of ST support....
Dear User,
Please find here below latest information concerning the request R12470059

The altitude precision depends on the number of averaged measurement over a certain time. LPS331AP hold steady will have an altitude within 70cm if performing a running average over a <2seconds window. For a running average over 6seconds, the altitude precision should become much better probably in the 20-30s range (not evaluated in details)
Running average is a simple yet effective S/W filter which can be used with little side effect. Other filter that might be useful is the running median filter which would remove pressure peaks from the averaging.
If measuring over longer period of time, probably the ODR can be reduced accordingly to keep the average power consumption constant. This is application dependent.