esphome-docs/components/power_supply.rst

74 lines
2.5 KiB
ReStructuredText
Raw Normal View History

2018-05-13 11:37:02 +02:00
Power Supply Component
======================
2018-11-14 22:12:27 +01:00
.. seo::
:description: Instructions for setting up power supplies which will automatically turn on together with outputs.
:image: power.png
2018-11-14 22:12:27 +01:00
:keywords: power, ATX
2018-05-13 11:37:02 +02:00
The ``power_supply`` component allows you to have a high power mode for
certain outputs. For example, if youre using an `ATX power
supply <https://en.wikipedia.org/wiki/ATX>`__ to power your LED strips,
you usually dont want to have the power supply on all the time while
the output is not on. The power supply component can be attached to any
2018-06-01 18:10:00 +02:00
:ref:`Output Component <output>` and
2018-05-13 11:37:02 +02:00
will automatically switch on if any of the outputs are on. Furthermore,
it also has a cooldown time that keeps the power supply on for a while
2018-10-20 15:10:26 +02:00
after the last output has been disabled.
2018-05-13 11:37:02 +02:00
.. code-block:: yaml
2018-05-13 11:37:02 +02:00
# Example configuration entry
power_supply:
- id: 'power_supply1'
pin: 13
Configuration variables:
2018-08-24 22:44:01 +02:00
------------------------
2018-05-13 11:37:02 +02:00
2018-06-01 18:10:00 +02:00
- **id** (**Required**, :ref:`config-id`): The id of the
power supply so that it can be used by the outputs.
- **pin** (**Required**, :ref:`Pin Schema <config-pin_schema>`): The
GPIO pin to control the power supply on.
- **enable_time** (*Optional*, :ref:`config-time`): The time to
that the power supply needs for startup. The output component will
wait for this period of time after turning on the PSU and before
switching the output on. Defaults to ``20ms``.
- **keep_on_time** (*Optional*, :ref:`config-time`): The time the
power supply should be kept enabled after the last output that used
it has been switch off. Defaults to ``10s``.
See the :ref:`output component base configuration <config-output>`
2018-05-13 11:37:02 +02:00
for information on how to apply the power supply for a specific output.
ATX Power Supplies
2018-08-24 22:44:01 +02:00
------------------
2018-05-13 11:37:02 +02:00
2018-06-01 18:10:00 +02:00
.. figure:: images/power_supply-atx.jpg
:align: center
:width: 80.0%
2018-05-13 11:37:02 +02:00
The power supply component will default to pulling the specified GPIO
pin up when high power mode is needed. Most ATX power supplies however
operate with an active-low configuration. Therefore their output needs
to be inverted.
.. code-block:: yaml
2018-05-13 11:37:02 +02:00
power_supply:
- id: 'atx_power_supply'
pin:
number: 13
inverted: true
Then simply connect the green control wire from the ATX power supply to
your specified pin. Its recommended to put a small resistor (about 1kΩ)
in between to protect the ESP board.
2018-06-01 18:10:00 +02:00
See Also
--------
- :doc:`output/index`
- :apiref:`power_supply_component.h`
- :ghedit:`Edit`