Measure barometric air pressure and temperature from LPS22HB sensor
Simulink Support Package for Arduino Hardware / Sensors
The LPS22HB Pressure Sensor block measures barometric air pressure using the LPS22HB pressure sensor interfaced with the Arduino® hardware. This sensor comprises of a sensing element to measure the absolute pressure. The block also measures the temperature from the embedded temperature sensor in LPS22HB Sensor.
You can also select an output data rate in the block, and use the low pass filter option for filtering the measured pressure values.
If you are using Arduino Nano 33 BLE Sense hardware, which always includes an embedded sensor, reading data from a breakout board containing LPS22HB sensor is not supported.
Pressure— Barometric air pressure as measured by LPS22HB sensor
The block outputs the barometric air pressure in Pascals (Pa).
This output port appears only if you select the Pressure (Pa) parameter.
Temperature— Temperature measured by LPS22HB sensor
Temperature (in ℃) measured by LPS22HB sensor connected to Arduino board.
This output port appears only if you select the Temperature (℃) parameter.
Status— Status of pressure and temperature measurements
Status of pressure and temperature measurements, specified as a 1-by-2 vector.
0 indicates that the data read is new,
indicates that the data read is not new, and
-1 indicates that the
corresponding output is not selected.
This output port appears only if you select the Status parameter.
I2C address— Slave addresses to communicate with sensor peripherals
The slave addresses to communicate with the LPS22HB sensor are decided by the state of the SA0 pin on the hardware board. This table provides the slave addresses corresponding to the pin and their state.
|Pin Name||Pin State||Slave Address|
Pressure (Pa)— Set output port for reading pressure
Select this parameter to set Pressure as one of the output ports.
Temperature (℃)— Set output port for reading temperature
Select this parameter to set Temperature as one of the output ports.
Status— Set output port for obtaining status
Select this parameter to set Status as one of the output ports.
Output data rate (ODR)— Rate at which pressure data is sampled
1 Hz(default) |
Select the output data rate at which pressure data is sampled, which also determines the bandwidth.
Enable low pass filter— Enable low pass filter for pressure data
Enable the low pass filter for reading pressure values.
Select the bandwidth— Bandwidth of low pass filter
Select the required bandwidth of the low pass filter.
This parameter appears only if you select the Enable low pass filter parameter.
Sample time— Time interval to read data
-1(default) | positive integer
Specify how often this block reads the data from the LPS22HB sensor. When you set this parameter to -1, Simulink determines the best sample time for the block based on the block context within the model.