Advertisement

Quick Links

AN4159
Application note
Hardware and software guidelines for use of the LPS331AP
Introduction
The LPS331AP is a digital MEMs pressure sensor with small package footprint and
enhanced digital features.
The official reference specification remains the datasheet.
Several demonstration systems supporting the LPS331AP are available.
November 2012
Doc ID 023639 Rev 3
1/27
www.st.com

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the LPS331AP and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for ST LPS331AP

  • Page 1 Application note Hardware and software guidelines for use of the LPS331AP Introduction The LPS331AP is a digital MEMs pressure sensor with small package footprint and enhanced digital features. The official reference specification remains the datasheet. Several demonstration systems supporting the LPS331AP are available.
  • Page 2: Table Of Contents

    One shot mode conversion time estimation ..... . 15 6.2.2 Reference S/W to get started with LPS331AP ....15 6.2.3 Pressure to altitude conversion .
  • Page 3 STEVAL-MKI120V1 LPS331AP adapter ........
  • Page 4: Pressure Sensor Demonstration Boards

    STEVAL-MKI120V1 LPS331AP adapter The STEVAL-MKI120V1 adapter board is designed to facilitate the demonstration of the LPS331AP product. The board offers an effective solution for fast system prototyping and device evaluation directly within the user’s own application. The STEVAL-MKI120V1 can be plugged into a standard DIL 24 socket. The adapter provides the complete LPS331AP pinout and comes ready-to-use with the required decoupling capacitors on the VDD power supply line.
  • Page 5 AN4159 Pressure sensor demonstration boards The pinout of the adapter is fully compatible with all other available adapter boards, making it possible to easily switch from one sensor to another during device evaluation without the need for board redesign. Doc ID 023639 Rev 3 5/27...
  • Page 6: Hardware (Designing Pcb Schematics And Layout)

    Hardware (designing PCB schematics and layout) AN4159 Hardware (designing PCB schematics and layout) LPS331AP device package, interconnect and polarization 2.1.1 Typical application circuit Figure 3. Pin mapping Figure 4. HCLGA-16L 3x3x1 mm 6/27 Doc ID 023639 Rev 3...
  • Page 7: Pin Mapping

    AN4159 Pin mapping Pin mapping Table 1. LPS331AP pin mapping details Pin # Name Class What to do VDD_IO IO supply Power supply for I/Os (1.8 ~ 3.3 V) Don’t connect Don’t connect External pull-up needed SCL (I2C) In (open-drain) (2.2 kΩ...
  • Page 8: Pressure Sensor Pcb Layout And Solder Recommendations

    If there is choice and interface is I2C, use SA0 = VDDIO slave address by default. 3.0.1 Pressure sensor PCB layout and solder recommendations The LPS331AP has an opening on top of the package, sensor performance can be compromised by: ●...
  • Page 9: Pcb Design Rules

    The pressure sensor senses mechanical stress coming from the PCB board, hence it should be kept minimal. PCB land and solder masking general recommendations are shown below. Refer to the LPS331AP datasheet for pad count, size and pitch. ● It is recommended to open a solder mask external to PCB land ●...
  • Page 10: Power Supply And Sequencing, Fail-Safe I/Os

    Solder heat resistance and environmental specification: The second level interconnect category on ST ECOPACK® lead-free package is marked on the inner box label, in compliance with JEDEC Standard JESD97. Soldering conditions maximum ratings are also marked on the same label.
  • Page 11: Using The Device Step-By-Step, From Basic To Advanced

    AN4159 Using the device step-by-step, from basic to advanced Using the device step-by-step, from basic to advanced First time bring-up Start by using the same supply for VDD_IO and VDD to check the device functionality. Make sure of the supply impedances and check all the pins voltages in static condition. The device is a simple slave with 1 byte sub-address which bit 7 should always be '1' (bit 7 = 1 enables I2C sub-address multi-byte auto-increment = use it always!) Use an oscilloscope to check that the device acknowledge its slave address.
  • Page 12: Power Optimization And Estimation

    Using the device step-by-step, from basic to advanced AN4159 100 °C = 0x6BD0, 0 °C = 0xB050 5.1.2 Power optimization and estimation ● Pavg = bit [3..0] of I2C register @0x10 (LPS331AP_RES_ADDR) ● Tavg = bit [6..4] of I2C register @0x10 (LPS331AP_RES_ADDR) Table 2.
  • Page 13 AN4159 Using the device step-by-step, from basic to advanced ● Examples 2: ODRT=ODR Temperature=1 Hz ODRP=ODR Pressure=1 Hz Pavg=Pressure average=512 Tavg=Temperature Average=64 Icc=27.6 µA ● When using one shot mode, the current consumption is equivalent to the current consumption at 1 sample/Hz, during the conversion time. (see conversion time) Doc ID 023639 Rev 3 13/27...
  • Page 14: Software

    Software AN4159 Software Device register list Table 3. Registers address map Register address Name Type Default Comment Binary Reserved (do not modify) 00-07 0D - 0E Reserved REF_P_XL 1000 REF_P_L 1001 REF_P_H 1010 WHO_AM_I 1111 10111011 Dummy register RES_CONF 10000 11111010 Reserved (do not modify) 11-1F...
  • Page 15: One Shot Mode Conversion Time Estimation

    The formula is accurate within +/- 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.
  • Page 16: Auto Mode

    Use a high precision barometer, and store in the application a S/W compensation offset, which could also take into account ageing test results. LPS331AP devices may have higher absolute accuracy by implementing an extra S/W pressure temperature compensation algorithm, which is called “quadratic pressure compensation in temperature”, and is described in this chapter.
  • Page 17: Figure 7. Overview First To Second Order Compensation

    AN4159 Software General presentation of the concept A linear pressure temperature compensation is implemented in the ASIC, using 3 embedded sensor calibration point information. A second order of accuracy can be achieved (less pressure variation when temperature changes) by implementing a quadratic compensation (second order polynomial approximation) on top of the piecewise linear (PWL) one, by S/W, using the same calibration data built-in the sensor registers.
  • Page 18: Figure 8. Comparison First And Second Order Compensation At Fixed Pressure

    Software AN4159 Step 2: linear system resolution for Quadratic law determination Equation 2 Step 3: linear system resolution for pwl compensation Equation 3 Coefficient straight line equation: Equation 4 y1=e1*T+d1; y2=e2*T+d2 Since d1=d2=c, the linear system resolution became: Equation 5 Step 4: output pressure correction Equation 6 Figure 8.
  • Page 19: Self Test

    AN4159 Software All the needed coefficients to compute the quadratic pressure in the microcontroller are available within the sensor registers. A reference C source code (using floating point or non- floating point arithmetic) is available. 6.2.8 Self test Devices can be self tested to a certain degree: ●...
  • Page 20 I place the ground plane in the PCB middle layer that is under the LPS331AP?” ● You can place the ground plane in the PCB middle layer under the LPS331AP, but not in the plane immediately under the LPS331AP. Case 4: “We are going to mount the LPS331AP and the LIS3DH on an accessory.
  • Page 21 The pressure sensor has some free extra rewritable non-volatile memory bytes. This NVM write option is only for ST-chosen users. It also requires that the VDD is 2.8 V or higher. A sample reference source code can be provided under LUA.
  • Page 22 ● 3.5 msec Case 8: What is the offset (variance) of absolute accuracy @ 10 °C (one of ST calibration temperature) or 25 °C temperature? ● LPS331AP absolute accuracy at 25 °C with one point calibration in ST fab is: –...
  • Page 23: Figure 9. High Temperature Lead-Free Soldering Profile 260 °C Max

    AN4159 Software Case 10: “Does the hole in the LPS331AP need to be covered for a post machine solder wash cycle? Does ST ship the parts with taped coverings?” ● No need to use any tape to cover the hole on CAP of LPS331AP during reflow. The cleaning of the PCB is not general (it’s only cleaned when the PCB is contaminated...
  • Page 24 Software AN4159 Case 12: “How is the pressure variation threshold interrupt activated?” ● We assume in the explanation that the registers in RIF_PAS (@3C, 3D, 3E) are not used in the application. Mechanism: First, differential mode must be activated (DIFF_EN=1) Second, program the reference pressure in REF_P register (for example, copy the current P_OUT value to REF_P registers).
  • Page 25 AN4159 Software #ifdef LPS331AP_ENABLE_INT2_PRESSURE_BAND LPS331AP_WriteByte(LPS331AP_CTRL_REG3_ADDR,0x18); // P High/Low on INT2 #endif LPS331AP_ReadByte(LPS331AP_INT_SOURCE_ADDR); // to autoclear it for now return TRUE; Q&A: “To reduce the I2C traffic and reporting using the differential pressure band interrupt, once enabled, when the pressure exceeds the threshold an interrupt will be generated. What is the recommended way of updating the reference pressure?”...
  • Page 26: Revision History

    Revision history AN4159 Revision history Table 4. Document revision history Date Revision Changes 24-Sep-2012 Initial release. – Added Case 12: 30-Oct-2012 – Minor text and formatting changes throughout the document Removed page 11 "Power sequence" 08-Nov-2012 26/27 Doc ID 023639 Rev 3...
  • Page 27 No license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted under this document. If any part of this document refers to any third party products or services it shall not be deemed a license grant by ST for the use of such third party products or services, or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of such third party products or services or any intellectual property contained therein.

Table of Contents