Main Content

Sensors

Read data from sensors

Acquire real-time data from sensors connected to Raspberry Pi® hardware. After installing MATLAB® Support Package for Raspberry Pi Hardware, you can connect to these sensors either from MATLAB desktop or from MATLAB Online™.

Functions

expand all

lsm9ds1Connect LSM9DS1 sensor on Raspberry Pi hardware I2C bus (Since R2021a)
readAccelerationRead one sample of acceleration from sensor (Since R2021a)
readAngularVelocityRead one sample of angular velocity from sensor (Since R2021a)
readMagneticFieldRead one sample of magnetic field from sensor (Since R2021a)
lsm6dslConnect LSM6DSL sensor on Raspberry Pi hardware I2C bus (Since R2021a)
readAccelerationRead one sample of acceleration from sensor (Since R2021a)
readAngularVelocityRead one sample of angular velocity from sensor (Since R2021a)
readTemperatureRead one sample of temperature from sensor (Since R2021a)
lsm303cConnect LSM303C sensor on Raspberry Pi hardware I2C bus (Since R2021a)
readAccelerationRead one sample of acceleration from sensor (Since R2021a)
readTemperatureRead one sample of temperature from sensor (Since R2021a)
readMagneticFieldRead one sample of magnetic field from sensor (Since R2021a)
mpu6050Connect MPU-6050 sensor on Raspberry Pi hardware I2C bus (Since R2021a)
readAccelerationRead one sample of acceleration from sensor (Since R2021a)
readAngularVelocityRead one sample of angular velocity from sensor (Since R2021a)
mpu9250Connect MPU-9250 sensor on Raspberry Pi hardware I2C bus (Since R2021a)
readAccelerationRead one sample of acceleration from sensor (Since R2021a)
readAngularVelocityRead one sample of angular velocity from sensor (Since R2021a)
readMagneticFieldRead one sample of magnetic field from sensor (Since R2021a)
hts221Connect HTS221 sensor on Raspberry Pi hardware I2C bus (Since R2021a)
readTemperatureRead one sample of temperature from sensor (Since R2021a)
readHumidityRead one relative humidity data sample from HTS221 sensor (Since R2021a)
lps22hbConnect LPS22HB sensor on Raspberry Pi hardware I2C bus (Since R2021a)
readTemperatureRead one sample of temperature from sensor (Since R2021a)
readPressureRead one absolute pressure data sample from sensor (Since R2021a)
bmi160Connect BMI160 sensor on Raspberry Pi hardware I2C bus (Since R2023a)
readAccelerationRead one sample of acceleration from sensor (Since R2021a)
readAngularVelocityRead one sample of angular velocity from sensor (Since R2021a)
readTemperatureRead one sample of temperature from sensor (Since R2021a)
readMagneticFieldRead one sample of magnetic field from sensor (Since R2021a)
lsm6ds3Connect LSM6DS3 sensor on Raspberry Pi hardware I2C bus (Since R2023a)
readAccelerationRead one sample of acceleration from sensor (Since R2021a)
readAngularVelocityRead one sample of angular velocity from sensor (Since R2021a)
readTemperatureRead one sample of temperature from sensor (Since R2021a)
lsm6ds3hConnect LSM6DS3H sensor on Raspberry Pi hardware I2C bus (Since R2023a)
readAccelerationRead one sample of acceleration from sensor (Since R2021a)
readAngularVelocityRead one sample of angular velocity from sensor (Since R2021a)
readTemperatureRead one sample of temperature from sensor (Since R2021a)
lsm6dsmConnect LSM6DSM sensor on Raspberry Pi hardware I2C bus (Since R2023a)
readAccelerationRead one sample of acceleration from sensor (Since R2021a)
readAngularVelocityRead one sample of angular velocity from sensor (Since R2021a)
readTemperatureRead one sample of temperature from sensor (Since R2021a)
lsm6dsrConnect LSM6DSR sensor on Raspberry Pi hardware I2C bus (Since R2023a)
readAccelerationRead one sample of acceleration from sensor (Since R2021a)
readAngularVelocityRead one sample of angular velocity from sensor (Since R2021a)
readTemperatureRead one sample of temperature from sensor (Since R2021a)
lsm6dsoConnect LSM6DSO sensor on Raspberry Pi hardware I2C bus (Since R2023a)
readAccelerationRead one sample of acceleration from sensor (Since R2021a)
readAngularVelocityRead one sample of angular velocity from sensor (Since R2021a)
readTemperatureRead one sample of temperature from sensor (Since R2021a)
adxl345Connect ADXL345, ADXL343, ADXL344, or ADXL346 sensor on Raspberry Pi hardware I2C bus (Since R2023a)
readAccelerationRead one sample of acceleration from sensor (Since R2021a)
icm20948Connect ICM-20948 sensor on Raspberry Pi hardware I2C bus (Since R2023a)
readAccelerationRead one sample of acceleration from sensor (Since R2021a)
readAngularVelocityRead one sample of angular velocity from sensor (Since R2021a)
readTemperatureRead one sample of temperature from sensor (Since R2021a)
readMagneticFieldRead one sample of magnetic field from sensor (Since R2021a)
bmp280Connect BMP280 sensor on Raspberry Pi hardware I2C bus (Since R2023a)
readTemperatureRead one sample of temperature from sensor (Since R2021a)
readPressureRead one absolute pressure data sample from sensor (Since R2021a)