MPU6050 Accelerometer/Gyroscope Sensor

The mpu6050 sensor platform allows you to use your MPU6050 Accelerometer/Gyroscope (datasheet, SparkFun) sensors with ESPHome. The I²C Bus is required to be set up in your configuration for this sensor to work.

This component only does some basic filtering and no calibration. Due to the complexity of this sensor and the amount of possible configuration options, you should probably create an external component by copying and modifying the existing code if you want a specific new feature. Supporting all possible use cases would be quite hard.

../../_images/mpu6050-full.jpg

MPU6050 Accelerometer/Gyroscope Sensor.

../../_images/mpu6050-ui.png
# Example configuration entry
sensor:
  - platform: mpu6050
    address: 0x68
    accel_x:
      name: "MPU6050 Accel X"
    accel_y:
      name: "MPU6050 Accel Y"
    accel_z:
      name: "MPU6050 Accel z"
    gyro_x:
      name: "MPU6050 Gyro X"
    gyro_y:
      name: "MPU6050 Gyro Y"
    gyro_z:
      name: "MPU6050 Gyro z"
    temperature:
      name: "MPU6050 Temperature"

Configuration variables:

  • address (Optional, int): Manually specify the I²C address of the sensor. Defaults to 0x68.

  • accel_x (Optional): Use the X-Axis of the Accelerometer. All options from Sensor.

  • accel_y (Optional): Use the Y-Axis of the Accelerometer. All options from Sensor.

  • accel_z (Optional): Use the Z-Axis of the Accelerometer. All options from Sensor.

  • gyro_x (Optional): Use the X-Axis of the Gyroscope. All options from Sensor.

  • gyro_y (Optional): Use the Y-Axis of the Gyroscope. All options from Sensor.

  • gyro_z (Optional): Use the Z-Axis of the Gyroscope. All options from Sensor.

  • temperature (Optional): Use the internal temperature of the sensor. All options from Sensor.

  • update_interval (Optional, Time): The interval to check the sensor. Defaults to 60s.

  • id (Optional, ID): Manually specify the ID used for code generation.

See Also