AN4159
Software
Doc ID 023639 Rev 3
15/27
●
The serial bus power consumption can be reduced by reducing the data traffic:
–
Using built-in H/W averaging instead of S/W averaging
–
Reduce the polling rate when waiting for the one shot measurement completion
(2.1.1 #9)
–
The INT pin can be used as event to minimize serial bus polling
–
Always set the PD bit to zero before changing the register settings
6.2.1
One shot mode conversion time estimation
●
Typical conversion time
≈
62.5*(Pavg+Tavg) + 1545 µs
–
ex: Tavg = 128; Pavg = 512; Typ. conversation time
≈
41545 µs (or 24 Hz => this
configuration is not compatible with 25 Hz)
–
ex: Tavg = 128; Pavg = 384; Typ. conversation time
≈
33545 µs
–
The formula is accurate /- 3% at room temperature
6.2.2
Reference S/W to get started with LPS331AP
There is a list of C source files that provide the baseline in initializing, configuring and
performing measurements with the pressure sensor.
6.2.3
Pressure to altitude conversion
The simplest and widely used barometer (altitude) formula used in most watches come from
the US Standard Atmosphere, for example the 1976 edition.
Example of the source code is shown below:
void From_Pressure_mb_To_Altitude_US_Std_Atmosphere_1976_ft(double*
Pressure_mb, double* Altitude_ft) {
//=(1-(A18/1013.25)^0.190284)*145366.45
*Altitude_ft = (1-pow(*Pressure_mb/1013.25,0.190284))*145366.45;
}
void From_ft_To_m(double* ft, double* m) {
//=D18/3.280839895
*m = *ft/3.280839895;
}
Terminology is very delicate for altitude. There is not one altitude, there are many.
For example, the GPS altitude is different than the pressure altitude or density altitude.
Aircraft flying between airports are using the ISA altitude which is based on yearly/earth
wide sea level pressure average value (as shown above) to avoid plane collision: it is the
altimeter reference.
When aircraft get near the airport, local equivalent sea level and airfield temperature are
wirelessly shared from airport to plane to compute local instant airfield altitude. This is
known as QNH, using METAR data.