esphome-docs/esphomeyaml/components/sensor/ads1115.rst

83 lines
2.9 KiB
ReStructuredText
Raw Normal View History

2018-05-13 11:37:02 +02:00
ADS1115 Sensor
==============
2018-06-01 18:10:00 +02:00
.. warning::
This integration currently doesn't seem to work with certain chips and I'm waiting for my own ADS1115 to arrive
to diagnose the issue. If you're experiencing issues too and want to help out, please set the
:ref:`log level <logger-log_levels>` to ``VERY_VERBOSE`` and send me some logs. Thanks!
2018-05-13 11:37:02 +02:00
The ``ads1115`` sensor allows you to use your ADS1115 sigma-delta ADC
2018-06-01 18:10:00 +02:00
sensors (`datasheet <http://www.ti.com/lit/ds/symlink/ads1115.pdf>`__, `Adafruit`_) with esphomelib.
First, setup a :doc:`ADS1115 Hub </esphomeyaml/components/ads1115>` for your ADS1115 sensor and then use this
2018-05-13 11:37:02 +02:00
sensor platform to create individual sensors that will report the
voltage to Home Assistant.
2018-06-01 18:10:00 +02:00
.. figure:: images/ads1115-full.jpg
:align: center
:target: `Adafruit`_
:width: 50.0%
2018-05-13 11:37:02 +02:00
2018-06-01 18:10:00 +02:00
ADS1115 16-Bit ADC. Image by `Adafruit`_.
2018-05-13 11:37:02 +02:00
.. _Adafruit: https://www.adafruit.com/product/1085
2018-06-01 18:10:00 +02:00
.. figure:: images/adc-ui.png
:align: center
:width: 80.0%
2018-05-13 11:37:02 +02:00
.. code:: yaml
ads1115:
- address: 0x48
sensor:
- platform: ads1115
multiplexer: 'A0_A1'
gain: 1.024
name: "Living Room Brightness"
Configuration variables:
~~~~~~~~~~~~~~~~~~~~~~~~
2018-05-14 21:15:49 +02:00
- **multiplexer** (**Required**): The multiplexer channel of this sensor. Effectively means between which pins you
want to measure voltage.
2018-05-13 11:37:02 +02:00
- **gain** (**Required**, float): The gain of this sensor.
- **name** (**Required**, string): The name for this sensor.
2018-06-01 18:10:00 +02:00
- **ads1115_id** (*Optional*, :ref:`config-id`): Manually specify the ID of the
:doc:`ADS1115 Hub </esphomeyaml/components/ads1115>` you want to use this sensor.
2018-06-01 18:44:15 +02:00
- **update_interval** (*Optional*, :ref:`config-time`): The interval
to check the sensor. Defaults to ``15s``. See :ref:`sensor-default_filter`.
2018-06-01 18:10:00 +02:00
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
2018-05-13 11:37:02 +02:00
Multiplexer And Gain
~~~~~~~~~~~~~~~~~~~~
The ADS1115 has a multiplexer that can be configured to measure voltage between several pin configurations. These are:
2018-05-14 21:15:49 +02:00
- ``A0_A1`` (between Pin 0 and Pin 1)
- ``A0_A3`` (between Pin 0 and Pin 3)
- ``A1_A3`` (between Pin 1 and Pin 3)
- ``A2_A3`` (between Pin 2 and Pin 3)
- ``A0_GND`` (between Pin 0 and GND)
- ``A1_GND`` (between Pin 1 and GND)
- ``A2_GND`` (between Pin 2 and GND)
- ``A3_GND`` (between Pin 3 and GND)
2018-05-13 11:37:02 +02:00
Additionally, the ADS1115 has a Programmable Gain Amplifier (PGA) that can help you measure voltages in different ranges, these are:
2018-05-14 21:15:49 +02:00
- ``6.144`` (measures up to 6.144V)
- ``4.096`` (measures up to 4.096V)
- ``2.048`` (measures up to 2.048V)
- ``1.024`` (measures up to 1.024V)
- ``0.512`` (measures up to 0.512V)
- ``0.256`` (measures up to 0.256V)
2018-05-13 11:37:02 +02:00
2018-06-01 18:10:00 +02:00
See Also
^^^^^^^^
- :ref:`sensor-filters`
- :doc:`adc`
- :doc:`max6675`
- :doc:`API Reference </api/sensor/ads1115>`
2018-06-04 08:17:22 +02:00
- `Edit this page on GitHub <https://github.com/OttoWinter/esphomedocs/blob/current/esphomeyaml/components/sensor/ads1115.rst>`__