BME280
Measure barometric air pressure, relative humidity, and temperature from BME280 sensor
Since R2022b
Add-On Required: This feature requires the MATLAB Coder Support Package for NVIDIA Jetson and NVIDIA DRIVE Platforms add-on.
Libraries:
NVIDIA Jetson and NVIDIA DRIVE /
Sensors /
Environmental sensors
Description
The BME280 block outputs the values of barometric air pressure and relative humidity as measured by the BME280 sensor connected to an NVIDIA® embedded board. The block also outputs the temperature as read by the BME280 sensor.
Ports
Output
Pressure — Barometric air pressure measured by BME280 sensor
scalar
Barometric air pressure (in Pascal (Pa)) measured by a BME280 sensor that is connected to an NVIDIA embedded board.
Dependencies
This output port appears only if you select the Pressure (Pa) parameter.
Data Types: double
Temperature — Temperature measured by BME280 sensor
scalar
Temperature (in ℃) measured by BME280 sensor connected to an NVIDIA embedded board.
Dependencies
This output port appears only if you select the Temperature (℃) parameter.
Data Types: double
Humidity — Relative humidity measured by BME280 sensor
scalar
Relative humidity (in %) measured by BME280 sensor connected to an NVIDIA embedded board.
Dependencies
This output port appears only if you select the Humidity (%) parameter.
Data Types: double
Status — Status of read values
0
| 1
Status of read values from the BME280 sensor, to indicate if the data read is the
new value or not. The Status value of 0
indicates that the data read is new and 1
indicates that the data
read is not new.
Dependencies
This output port appears only if you select the Status parameter.
Data Types: uint8
Parameters
I2C module — Module for communication
empty
(default)
The I2C module to be used for communication to the BME280 sensor. The number of I2C modules supported varies across different NVIDIA embedded boards.
Programmatic Use
Block Parameter:
I2CModule
|
Type: character vector |
Values:
'' |positive integer |
Default:
'' |
I2C address — I2C address of BME280 sensor
0x77
(default) | 0x76
The I2C address used by BME280 sensor communicating with the NVIDIA embedded board. The default parameter value (0x77
)
corresponds to the I2C address used by the BOOSTXL-SENSORS
BoosterPack™ Plug-in Module.
Programmatic Use
Block Parameter:
I2CAddress
|
Type: character vector |
Values:
'0x76' |'0x77' |
Default:
'0x76' |
Pressure (Pa) — Set output port for reading pressure
on
(default) | off
Select this parameter to set Pressure as one of the output ports.
Programmatic Use
Block Parameter:
isActivePressure |
Type: character vector |
Values: 'on' |
'off' |
Default: 'on' |
Temperature (℃) — Set output port for reading temperature
on
(default) | off
Select this parameter to set Temperature as one of the output ports.
Programmatic Use
Block Parameter:
isActiveTemperature |
Type: character vector |
Values: 'on' |
'off' |
Default: 'on' |
Humidity (%) — Set output port for reading humidity
on
(default) | off
Select this parameter to set Humidity as one of the output ports.
Programmatic Use
Block Parameter:
isActiveHumidity |
Type: character vector |
Values: 'on' |
'off' |
Default: 'on' |
Status — Set output port for obtaining status of values read
off
(default) | on
Select this parameter to set Status as one of the output ports.
Programmatic Use
Block Parameter:
isStatus |
Type: character vector |
Values: 'on' |
'off' |
Default: 'on' |
Filter coefficient — Filter coefficient for IIR filter
0
(default) | 2
| 4
| 8
| 16
Specify filter coefficient for the IIR filter while reading pressure and temperature values from BME280 sensor. Selecting a non-zero value for filter coefficient helps to improve the step response and remove short-term fluctuations in the measured values.
Programmatic Use
Block Parameter:
FilterMode |
Type: character vector |
Values: '0' |
'2' | '4' | '8' |
'16' |
Default: '0' |
Stand by time — Standby time to read values
0.5 ms
(default) | 10 ms
| 20 ms
| 62.5 ms
| 125 ms
| 250 ms
| 500 ms
| 1000 ms
Specify the standby time (in ms) when the processor stays idle (inactive duration) while reading values from BME280 sensor. The selection of this value affects the total cycle time.
Programmatic Use
Block Parameter:
StandbyTime |
Type: character vector |
Values: '0.5 ms' |
'10 ms' | '20 ms' | '62.5
ms' | '125 ms' | '250 ms' |
'500 ms' |'1000 ms' |
Default: '0.5 ms' |
Pressure oversampling factor — Oversampling factor for the measured pressure value
1
(default) | 2
| 4
| 8
| 16
Specify the oversampling factor to reduce the noise for the pressure value read from BME280 sensor. This value is a multiplication factor that affects measurement rate and current consumption.
Programmatic Use
Block Parameter:
PressureOverSampling |
Type: character vector |
Values: '1' |
'2' | '4' | '8' |
'16' |
Default: '1' |
Humidity oversampling factor — Oversampling factor for the measured humidity value
1
(default) | 2
| 4
| 8
| 16
Specify the oversampling factor to reduce the noise for the humidity value read from BME280 sensor. This value is a multiplication factor that affects measurement rate and current consumption.
Programmatic Use
Block Parameter:
HumidityOverSampling |
Type: character vector |
Values: '1' |
'2' | '4' | '8' |
'16' |
Default: '1' |
Temperature oversampling factor — Oversampling factor for the measured humidity value
1
(default) | 2
| 4
| 8
| 16
Specify the oversampling factor to reduce the noise for the temperature value read from BME280 sensor. This value is a multiplication factor that affects measurement rate and current consumption.
Programmatic Use
Block Parameter:
TemperatureOverSampling |
Type: character vector |
Values: '1' |
'2' | '4' | '8' |
'16' |
Default: '1' |
Data type — Output data type for values from BME280 sensor
single
(default) | double
Specify the output data type for the values read from BME280 sensor. The default
data type is single
. Use this parameter to change the values to
double
, if required.
Programmatic Use
Block Parameter:
DataType |
Type: character vector |
Values: 'single' |
'double' |
Default: 'single' |
Sample time — Time interval to read data
-1
(default) | scalar | vector
Specify how often this block reads the data from the BME280 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.
Programmatic Use
Block Parameter:
SampleTime
|
Type: character vector |
Values: scalar | vector |
Default:
'0.1'
|
Version History
Introduced in R2022b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)