BMI160 IMU Sensor
Measure linear acceleration, angular rate, and temperature from BMI160 sensor
- Library:
Simulink Support Package for Raspberry Pi Hardware / Sensors / IMU Sensors
Description
The BMI160 block outputs the values of linear acceleration and angular rate along x-, y- and z- axes as measured by the BMI160 sensor connected to Raspberry Pi™ board. The block also outputs the temperature as read by the BMI160 sensor. If you connect the BMM150 as a secondary sensor to BMI160, the BMI160 block also outputs magnetic field along x-, y- and z- axes as measured by the BMM150 sensor.
Ports
Output
Acceleration
— Linear acceleration measured by BMI160 sensor
row vector
Linear acceleration (in m/s2) measured by BMI160 sensor connected to Raspberry Pi board, along the x-, y- and z- axes, specified as a row vector [x,y,z].
Dependencies
This output port appears only if you select the Acceleration (m/s2) parameter.
Data Types: double
Angular Rate
— Angular rate measured by BMI160 sensor
row vector
Angular rate (in rad/s) measured by BMI160 sensor connected to Raspberry Pi board, along the x-, y- and z- axes, specified as a row vector [x,y,z].
Dependencies
This output port appears only if you select the Angular rate (rad/s) parameter.
Data Types: double
Magnetic Field
— Magnetic field strength measured by a secondary BMM150 sensor
row vector
Magnetic field strength (in µT) measured by a BMM150 sensor that is connected as a secondary sensor to BMI160 sensor, along the x-, y- and z- axes, specified as a row vector [x,y,z].
Dependencies
This output port appears only if you select the Enable secondary magnetometer and Magnetic Field (µT) parameters.
Data Types: double
Temperature
— Temperature measured by BMI160 sensor
scalar
Temperature (in ℃) measured by BMI160 sensor connected to Raspberry Pi board.
Dependencies
This output port appears only if you select the Temperature (℃) parameter.
Data Types: double
Acceleration Status
— Status of acceleration value
0
| 1
Status of acceleration 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 Acceleration Status parameter.
Data Types: int8
Angular Rate Status
— Status of angular rate value
0
| 1
Status of angular rate 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 Angular Rate Status parameter.
Data Types: int8
Magnetic Field Status
— Status of magnetic field value
0
| 1
Status of magnetic field 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 Magnetic Field Status parameter.
Data Types: int8
Parameters
I2C module
— Module for communication
1
(default)
The I2C module to be used for communication to the BMI160 sensor.
BMI160 I2C address
— I2C address of BMI160 sensor
0x69
(default) | 0x68
The I2C address used by BMI160 sensor communicating with the Raspberry Pi board.
Enable data ready interrupt
— Enable interrupt when data is ready
off
(default) | on
If this option is selected, an interrupt is generated on pin INT1 or INT2 of the sensor when data is ready, allowing you to trigger other subsystems to perform any action.
Note
Selecting this parameter (Enable data ready interrupt)
overrides the availability of other status values at the output. The selection of
parameters for other status outputs (Acceleration status
,
Angular rate status
, and Magnetic field
status
) is also disabled.
Interrupt receive pin
— Pin to receive data ready interrupt
INT1
(default) | INT2
Select the pin on which the data ready interrupt, which can be used by the Raspberry Pi board, gets generated on the sensor.
Dependencies
This parameter appears only if you select the Enable data ready interrupt parameter.
Enable secondary magnetometer
— Enable read data from BMM150 connected as a secondary sensor to BMI160
on
(default) | off
If this option is selected, the block can read magnetometer data from a BMM150 sensor that is connected as a secondary sensor to BMI160.
BMM150 I2C address
— I2C address of BMM150 sensor
0x10
(default) | 0x11
| 0x12
| 0x13
The I2C address used by BMM150 sensor connected as a secondary sensor to BMI160 sensor.
Dependencies
This parameter appears only if you select the Enable secondary magnetometer parameter.
Acceleration (m/s2)
— Set output port for reading acceleration
on
(default) | off
Select this parameter to set Acceleration as one of the output ports.
Angular rate (rad/s)
— Set output port for reading angular rate
on
(default) | off
Select this parameter to set Angular Rate as one of the output ports.
Magnetic Field (µT)
— Set output port for reading magnetic field
on
(default) | off
Select this parameter to set Magnetic Field as one of the output ports.
Temperature (℃)
— Set output port for reading temperature
off
(default) | on
Select this parameter to set Temperature as one of the output ports.
Acceleration status
— Set output port for obtaining acceleration status
off
(default) | on
Select this parameter to set Acceleration Status as one of the output ports.
Angular rate status
— Set output port for obtaining angular rate status
off
(default) | on
Select this parameter to set Angular Rate Status as one of the output ports.
Magnetic Field Status
— Set output port for obtaining magnetic field status
off
(default) | on
Select this parameter to set Magnetic Field Status as one of the output ports.
Data type
— Output data type for values from BMI160 sensor
single
(default) | double
Specify the output data type for the values read from BMI160 sensor. The default
data type for Raspberry Pi board is single
. Use this parameter to change the
values to double
, if required.
Sample time
— Time interval to read data
-1
(default) | positive integer
Specify how often this block reads the data from the BMI160 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.
Accelerometer range
— Full scale for measuring linear acceleration
±2g
(default) | ±4g
| ±8g
| ±16g
Select the full scale for measuring linear acceleration (the range of acceleration that the sensor needs to measure).
Accelerometer output data rate
— Rate at which accelerometer data is sampled
12.5 Hz
(default) | 25 Hz
| 50 Hz
| 100 Hz
| 200 Hz
| 400 Hz
| 800 Hz
| 1600 Hz
Select the output data rate at which accelerometer data is sampled, which also determines the bandwidth.
Enable low pass filter
— Enable low pass filter to read accelerometer data from BMI160 sensor
off
(default) | on
Select this option to enable the low-pass filter for the acceleration values read from BMI160 sensor.
Accelerometer filter mode
— Select the filter mode for low pass filter for accelerometer values
Normal
(default) | OSR2
| OSR4
Select the filter mode for low pass filter for accelerometer values. The 3dB Cutoff frequency of the accelerometer depends on the value of this parameter and the ODR that you selected using the Accelerometer output data rate parameter.
Gyroscope range
— Full scale for measuring angular rate
125 dps
(default) | 250 dps
| 500 dps
| 1000 dps
| 2000 dps
Select the full scale for measuring angular rate (the range of angular rate that the sensor needs to measure).
Gyroscope output data rate
— Rate at which accelerometer data is sampled
25 Hz
(default) | 50 Hz
| 100 Hz
| 200 Hz
| 400 Hz
| 800 Hz
| 1600 Hz
| 3200 Hz
Select the output data rate at which gyroscope data is sampled, which also determines the bandwidth.
Enable low pass filter
— Enable low pass filter to read gyroscope data from BMI160 sensor
off
(default) | on
Select this option to enable the low-pass filter for the angular rate values read from BMI160 sensor.
Gyroscope filter mode
— Select the filter mode for low pass filter for gyroscope values
Normal
(default) | OSR2
| OSR4
Select the filter mode for low pass filter for gyroscope values. The 3dB Cutoff frequency of the gyroscope depends on the value of this parameter and the ODR that you selected using the Gyroscope output data rate parameter.
Magnetometer output data rate
— Rate at which accelerometer data is sampled
25 Hz
(default) | 0.78125 Hz
| 1.5625 Hz
| 3.125 Hz
| 6.25 Hz
| 12.5 Hz
| 50 Hz
| 100 Hz
| 200 Hz
| 400 Hz
| 800 Hz
Select the output data rate at which magnetometer data is sampled.
Version History
Introduced in R2021b
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
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)