2018-08-22 22:05:28 +02:00
|
|
|
INA219 DC Current Sensor
|
|
|
|
========================
|
|
|
|
|
2018-11-14 22:12:27 +01:00
|
|
|
.. seo::
|
|
|
|
:description: Instructions for setting up INA219 DC current sensors
|
|
|
|
:image: ina219.jpg
|
|
|
|
:keywords: ina219
|
|
|
|
|
2018-08-22 22:05:28 +02:00
|
|
|
The ``ina219`` sensor platform allows you to use your INA219 High Side DC Current Sensor
|
|
|
|
(`datasheet <https://cdn-learn.adafruit.com/downloads/pdf/adafruit-ina219-current-sensor-breakout.pdf>`__,
|
|
|
|
`Adafruit`_) sensors with
|
2019-02-16 23:25:23 +01:00
|
|
|
ESPHome. The :ref:`I²C Bus <i2c>` is
|
2018-08-22 22:05:28 +02:00
|
|
|
required to be set up in your configuration for this sensor to work.
|
|
|
|
|
|
|
|
|
|
|
|
.. figure:: images/ina219-full.jpg
|
|
|
|
:align: center
|
|
|
|
:width: 50.0%
|
|
|
|
|
|
|
|
INA219 DC Current Sensor.
|
|
|
|
|
|
|
|
.. _Adafruit: https://www.adafruit.com/product/904
|
|
|
|
|
|
|
|
.. figure:: images/ina219-ui.png
|
|
|
|
:align: center
|
|
|
|
:width: 80.0%
|
|
|
|
|
2018-11-19 18:32:16 +01:00
|
|
|
.. code-block:: yaml
|
2018-08-22 22:05:28 +02:00
|
|
|
|
|
|
|
# Example configuration entry
|
|
|
|
sensor:
|
|
|
|
- platform: ina219
|
|
|
|
address: 0x40
|
|
|
|
shunt_resistance: 0.1 ohm
|
|
|
|
current:
|
|
|
|
name: "INA219 Current"
|
|
|
|
power:
|
|
|
|
name: "INA219 Power"
|
|
|
|
bus_voltage:
|
|
|
|
name: "INA219 Bus Voltage"
|
|
|
|
shunt_voltage:
|
|
|
|
name: "INA219 Shunt Voltage"
|
|
|
|
max_voltage: 32.0V
|
|
|
|
max_current: 3.2A
|
2019-01-06 18:56:14 +01:00
|
|
|
update_interval: 60s
|
2018-08-22 22:05:28 +02:00
|
|
|
|
|
|
|
Configuration variables:
|
2018-08-24 22:44:01 +02:00
|
|
|
------------------------
|
2018-08-22 22:05:28 +02:00
|
|
|
|
2020-11-09 02:22:55 +01:00
|
|
|
- **address** (*Optional*, int): Manually specify the I²C address of the sensor. Defaults to ``0x40``.
|
2018-08-22 22:05:28 +02:00
|
|
|
- **shunt_resistance** (*Optional*, float): The value of the shunt resistor on the board for current calculation.
|
|
|
|
Defaults to ``0.1 ohm``.
|
2019-02-16 23:25:23 +01:00
|
|
|
- **max_voltage** (*Optional*, float): The maximum bus voltage you are expecting. ESPHome will use this to
|
2018-08-22 22:05:28 +02:00
|
|
|
configure the sensor optimally. Defaults to ``32V`` (the max).
|
2019-02-16 23:25:23 +01:00
|
|
|
- **max_current** (*Optional*, float): The maximum current you are expecting. ESPHome will use this to
|
2018-08-22 22:05:28 +02:00
|
|
|
configure the sensor optimally. Defaults to ``3.2A``.
|
|
|
|
- **current** (*Optional*): Use the current value of the sensor in amperes. All options from
|
2019-02-17 12:28:17 +01:00
|
|
|
:ref:`Sensor <config-sensor>`.
|
2018-08-22 22:05:28 +02:00
|
|
|
- **power** (*Optional*): Use the power value of the sensor in watts. All options from
|
2019-02-17 12:28:17 +01:00
|
|
|
:ref:`Sensor <config-sensor>`.
|
2018-08-22 22:05:28 +02:00
|
|
|
- **bus_voltage** (*Optional*): Use the bus voltage (voltage of the high side contact) value of the sensor in V.
|
2019-02-17 12:28:17 +01:00
|
|
|
All options from :ref:`Sensor <config-sensor>`.
|
2018-08-22 22:05:28 +02:00
|
|
|
- **shunt_voltage** (*Optional*): Use the shunt voltage (voltage across the shunt resistor) value of the sensor in V.
|
2019-02-17 12:28:17 +01:00
|
|
|
All options from :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-08-22 22:05:28 +02:00
|
|
|
|
|
|
|
See Also
|
2018-08-24 22:44:01 +02:00
|
|
|
--------
|
2018-08-22 22:05:28 +02:00
|
|
|
|
|
|
|
- :ref:`sensor-filters`
|
|
|
|
- :doc:`ina3221`
|
2019-05-12 22:44:59 +02:00
|
|
|
- :apiref:`ina219/ina219.h`
|
2024-03-20 15:53:54 +01:00
|
|
|
- `INA219 Arduino Library <https://github.com/adafruit/Adafruit_INA219>`__ by `Adafruit <https://www.adafruit.com/>`__
|
2019-02-07 13:54:45 +01:00
|
|
|
- :ghedit:`Edit`
|