esphome-docs/components/sensor/mpu6050.rst

84 lines
2.9 KiB
ReStructuredText
Raw Normal View History

2018-05-13 11:37:02 +02:00
MPU6050 Accelerometer/Gyroscope Sensor
======================================
2018-11-14 22:12:27 +01:00
.. seo::
:description: Instructions for setting up MPU6050 Accelerometer and Gyroscope sensors.
:image: mpu6050.jpg
The ``mpu6050`` sensor platform allows you to use your MPU6050 Accelerometer/Gyroscope
2018-05-13 11:37:02 +02:00
(`datasheet <https://www.invensense.com/wp-content/uploads/2015/02/MPU-6000-Datasheet1.pdf>`__,
2020-05-10 21:27:59 +02:00
`SparkFun`_) sensors with
2019-02-16 23:25:23 +01:00
ESPHome. The :ref:`I²C Bus <i2c>` is
2018-05-13 11:37:02 +02:00
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 a custom component by copying and modifying the existing code if you want a specific
new feature. Supporting all possible use-cases would be quite hard.
2018-06-01 18:10:00 +02:00
.. figure:: images/mpu6050-full.jpg
:align: center
:width: 50.0%
2018-05-13 11:37:02 +02:00
2018-06-01 18:10:00 +02:00
MPU6050 Accelerometer/Gyroscope Sensor.
2018-05-13 11:37:02 +02:00
2020-05-10 21:27:59 +02:00
.. _SparkFun: https://www.sparkfun.com/products/11028
2018-05-13 11:37:02 +02:00
2018-06-01 18:10:00 +02:00
.. figure:: images/mpu6050-ui.png
:align: center
:width: 80.0%
2018-05-13 11:37:02 +02:00
.. code-block:: yaml
2018-05-13 11:37:02 +02:00
# 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:
2018-10-12 16:33:22 +02:00
------------------------
2018-05-13 11:37:02 +02:00
- **address** (*Optional*, int): Manually specify the I²C address of the sensor. Defaults to ``0x68``.
2018-06-01 18:10:00 +02:00
- **accel_x** (*Optional*): Use the X-Axis of the Accelerometer. All options from
2019-02-17 12:28:17 +01:00
:ref:`Sensor <config-sensor>`.
2018-06-01 18:10:00 +02:00
- **accel_y** (*Optional*): Use the Y-Axis of the Accelerometer. All options from
2019-02-17 12:28:17 +01:00
:ref:`Sensor <config-sensor>`.
2018-06-01 18:10:00 +02:00
- **accel_z** (*Optional*): Use the Z-Axis of the Accelerometer. All options from
2019-02-17 12:28:17 +01:00
:ref:`Sensor <config-sensor>`.
2018-06-01 18:10:00 +02:00
- **gyro_x** (*Optional*): Use the X-Axis of the Gyroscope. All options from
2019-02-17 12:28:17 +01:00
:ref:`Sensor <config-sensor>`.
2018-06-01 18:10:00 +02:00
- **gyro_y** (*Optional*): Use the Y-Axis of the Gyroscope. All options from
2019-02-17 12:28:17 +01:00
:ref:`Sensor <config-sensor>`.
2018-06-01 18:10:00 +02:00
- **gyro_z** (*Optional*): Use the Z-Axis of the Gyroscope. All options from
2019-02-17 12:28:17 +01:00
:ref:`Sensor <config-sensor>`.
2018-06-01 18:10:00 +02:00
- **temperature** (*Optional*): Use the internal temperature of the sensor. All options from
2019-02-17 12:28:17 +01:00
:ref:`Sensor <config-sensor>`.
2019-01-06 18:56:14 +01:00
- **update_interval** (*Optional*, :ref:`config-time`): The interval to check the sensor. Defaults to ``60s``.
2018-06-01 18:10:00 +02:00
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
See Also
2018-10-12 16:33:22 +02:00
--------
2018-06-01 18:10:00 +02:00
- :ref:`sensor-filters`
- :doc:`template`
- :doc:`ultrasonic`
2019-05-12 22:44:59 +02:00
- :apiref:`mpu6050/mpu6050.h`
2018-08-24 22:44:01 +02:00
- `i2cdevlib <https://github.com/jrowberg/i2cdevlib>`__ by `Jeff Rowberg <https://github.com/jrowberg>`__
- :ghedit:`Edit`