BME280
Measure barometric air pressure, relative humidity, and temperature from BME280 sensor
Since R2021b
Libraries:
C2000 Microcontroller Blockset /
Sensors
Description
The BME280 block outputs the values of barometric air pressure and relative humidity as measured by the BME280 sensor connected to C2000 board. The block also outputs the temperature as read by the BME280 sensor.
Examples
Read Data from IMU and Environmental Sensors
Use C2000™ Microcontroller Blockset to read data from the BMI160 Inertial Measurement Unit (IMU) sensor and BME280 Environmental sensor that are part of the BOOSTXL-SENSORS BoosterPack™ plug-in module.
Ports
Output
Barometric air pressure (in Pascal (Pa)) measured by a BME280 sensor that is connected to C2000 board.
Dependencies
This output port appears only if you select the Pressure (Pa) parameter.
Data Types: double
Temperature (in ℃) measured by BME280 sensor connected to C2000 board.
Dependencies
This output port appears only if you select the Temperature (℃) parameter.
Data Types: double
Relative humidity (in %) measured by BME280 sensor connected to C2000 board.
Dependencies
This output port appears only if you select the Humidity (%) parameter.
Data Types: double
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
The I2C module to be used for communication to the BME280 sensor. The number of I2C modules supported varies across different C2000 processors. You can find the supported I2C modules corresponding to the processor (which you selected for the Hardware Board parameter in the Simulink model) by opening the Configuration Parameters dialog box and checking the I2C specific tabs under Target hardware resources.
The I2C address used by BME280 sensor communicating with the C2000 processor. The
default parameter value (0x77
) corresponds to the value mentioned in
the Schematics
section of the BOOSTXL-SENSORS
BoosterPackTM Plug-in Module User's Guide.
Select this parameter to set Pressure as one of the output ports.
Select this parameter to set Temperature as one of the output ports.
Select this parameter to set Humidity as one of the output ports.
Select this parameter to set Status as one of the output ports.
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.
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.
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.
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.
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.
Specify the output data type for the values read from BME280 sensor. The default
data type for TI’s C2000™ processors is single
. Use this parameter to change the
values to double
, if required.
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.
Version History
Introduced in R2021b
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.
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- 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)