Added Documentation for QMC5883L + HMC5883L Doc improvements (#301)

* QMC5883L docs + HMC5883L improvments

* clean up docs

* update docs

* Fix Default value
This commit is contained in:
Tim P 2019-11-27 04:43:06 +11:00 committed by Otto Winter
parent 35d0401965
commit 3ece925ed0
4 changed files with 124 additions and 5 deletions

View File

@ -1,3 +1,5 @@
.. _hmc5883l:
HMC5883L Magnetometer
=====================
@ -8,9 +10,14 @@ HMC5883L Magnetometer
The ``hmc5883l`` allows you to use your HMC5883L triple-axis magnetometers
(`datasheet <https://cdn-shop.adafruit.com/datasheets/HMC5883L_3-Axis_Digital_Compass_IC.pdf>`__,
`Adafruit`_) with
ESPHome. The :ref:`I²C Bus <i2c>` is
required to be set up in your configuration for this sensor to work.
`Adafruit`_) with ESPHome. The :ref:`I²C Bus <i2c>` is required to be set up in your configuration
for this sensor to work.
.. figure:: ../../images/hmc5883l.jpg
:align: center
:width: 30.0%
HMC5883L Magnetometer.
.. _Adafruit: https://www.adafruit.com/product/1746
@ -28,13 +35,14 @@ required to be set up in your configuration for this sensor to work.
name: "HMC5883L Field Strength Z"
heading:
name: "HMC5883L Heading"
oversampling: 1x
range: 130uT
update_interval: 60s
Configuration variables:
------------------------
- **address** (*Optional*, int): Manually specify the i^2c address of the sensor. Defaults to ``0x1E``.
- **address** (*Optional*, int): Manually specify the c address of the sensor. Defaults to ``0x1E``.
- **field_strength_x** (*Optional*): The field strength in microtesla along the X-Axis. All options from
:ref:`Sensor <config-sensor>`.
- **field_strength_y** (*Optional*): The field strength in microtesla along the Y-Axis. All options from
@ -43,10 +51,37 @@ Configuration variables:
:ref:`Sensor <config-sensor>`.
- **heading** (*Optional*): The heading of the sensor in degrees. All options from
:ref:`Sensor <config-sensor>`.
- **oversampling** (*Optional*): The oversampling parameter for the sensor.
- **range** (*Optional*): The range parameter for the sensor.
- **update_interval** (*Optional*, :ref:`config-time`): The interval to check the sensor. Defaults to ``60s``.
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
Oversampling Options
--------------------
By default, the HMC5883L sensor measures each value 1 times when requesting a new value. You can, however,
configure this amount. The result is the sensor will take the adverage of the x samples. Possible oversampling values:
- ``1x`` (default)
- ``2x``
- ``4x``
- ``8x``
Range Options
-------------
By default, the HMC5883L sensor measurement range is 130uT. You can, however,
configure this amount. Possible values:
- ``88uT``
- ``130uT`` (default)
- ``190uT``
- ``250uT``
- ``400uT``
- ``470uT``
- ``560uT``
- ``810uT``
See Also
--------

View File

@ -0,0 +1,83 @@
QMC5883L Magnetometer
=====================
.. seo::
:description: Instructions for setting up QMC5883L IMU compass sensors.
:image: qmc5883l.jpg
:keywords: QMC5883L
The ``qmc5883l`` allows you to use your QMC5883L triple-axis magnetometers
(`datasheet <http://wiki.sunfounder.cc/images/7/72/QMC5883L-Datasheet-1.0.pdf>`__) with
ESPHome. This sensor is very simular to the :ref:`HMC5883L <hmc5883l>` sensor and is oftern found
as a knock off replacement. The QMC5883L sensor preforms on par to the HMC5883L sensor,
though the congiuration differs. The :ref:`I²C Bus <i2c>` is required to be set up in your
configuration for this sensor to work.
.. figure:: ../../images/qmc5883l.jpg
:align: center
:width: 30.0%
QMC5883L Magnetometer.
.. code-block:: yaml
# Example configuration entry
sensor:
- platform: qmc5883l
address: 0x0D
field_strength_x:
name: "QMC5883L Field Strength X"
field_strength_y:
name: "QMC5883L Field Strength Y"
field_strength_z:
name: "QMC5883L Field Strength Z"
heading:
name: "QMC5883L Heading"
range: 200uT
oversampling: 512x
update_interval: 60s
Configuration variables:
------------------------
- **address** (*Optional*, int): Manually specify the I²c address of the sensor. Defaults to ``0x1E``.
- **field_strength_x** (*Optional*): The field strength in microtesla along the X-Axis. All options from
:ref:`Sensor <config-sensor>`.
- **field_strength_y** (*Optional*): The field strength in microtesla along the Y-Axis. All options from
:ref:`Sensor <config-sensor>`.
- **field_strength_z** (*Optional*): The field strength in microtesla along the Z-Axis. All options from
:ref:`Sensor <config-sensor>`.
- **heading** (*Optional*): The heading of the sensor in degrees. All options from
:ref:`Sensor <config-sensor>`.
- **range** (*Optional*): The range parameter for the sensor.
- **oversampling** (*Optional*): The oversampling parameter for the sensor.
- **update_interval** (*Optional*, :ref:`config-time`): The interval to check the sensor. Defaults to ``60s``.
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
Range Options
-------------
By default, the QMC5883L sensor measurement range is 200µT. You can, however,
configure this amount. Possible values:
- ``200µT`` (default)
- ``800µT``
Oversampling Options
--------------------
By default, the QMC5883L sensor measures each value 512 times when requesting a new value. You can, however,
configure this amount. The result is the sensor will take the adverage of the x samples. Possible sampling values:
- ``512x`` (default)
- ``256x``
- ``128x``
- ``64x``
See Also
--------
- :ref:`sensor-filters`
- :doc:`template`
- :apiref:`qmc5883l/qmc5883l.h`
- :ghedit:`Edit`

BIN
images/qmc5883l.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -113,6 +113,7 @@ Sensor Components
HDC1080, components/sensor/hdc1080, hdc1080.jpg
HLW8012, components/sensor/hlw8012, hlw8012.svg
HMC5883L, components/sensor/hmc5883l, hmc5883l.jpg
QMC5883L, components/sensor/qmc5883l, qmc5883l.jpg
Home Assistant, components/sensor/homeassistant, home-assistant.svg
HX711, components/sensor/hx711, hx711.jpg
INA219, components/sensor/ina219, ina219.jpg