cancel
Showing results for 
Search instead for 
Did you mean: 

use STM32 with lps331 pressure sensor in altimeter application

lowpowermcu
Associate II
Posted on December 21, 2012 at 15:23

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.
1 REPLY 1
raptorhal2
Lead
Posted on December 21, 2012 at 16:23

LPS331 sensor can be used as altiemeter only if I do some median fillter :(

Not true. ST response says that simple moving averaging over a time interval can be used.

Which algorithm is best depends on your accuracy requirement and how fast the sensor altitude is changing. If the application is mountain climbing, the averaging time can be long. If the application is a acrobatic aircraft, you probably need a more complicated algorithm that includes airspeed and pitch angle.

A Google search on median filtering should provide good insight.

Cheers, Hal