esphome-docs/components/power_supply.rst
Michael b1c36410d4
Update power_supply.rst (#3587)
Added maximum time for enable_time.
A delay() command of longer than 5 seconds triggers the watch dog timer and forces reset.
2024-02-03 11:51:18 +01:00

78 lines
2.9 KiB
ReStructuredText
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Power Supply Component
======================
.. seo::
:description: Instructions for setting up power supplies which will automatically turn on together with outputs.
:image: power.svg
:keywords: power, ATX
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
:ref:`Output Component <output>` and
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
after the last output has been disabled.
.. code-block:: yaml
# Example configuration entry
power_supply:
- id: 'power_supply1'
pin: 13
Configuration variables:
------------------------
- **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
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``. Maximum of less than ``5s``.
- **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``.
- **enable_on_boot** (*Optional*, bool): If the power supply should be enabled when the power supply
component is setup. Defaults to false. The startup delay will be applied (other component setup will be blocked
until the delay has elapsed.) This is useful for power supplies that will never be turned off and avoids the need
to specifically configure the power supply in a different component.
See the :ref:`output component base configuration <config-output>`
for information on how to apply the power supply for a specific output.
ATX Power Supplies
------------------
.. figure:: images/power_supply-atx.jpg
:align: center
:width: 80.0%
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
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.
See Also
--------
- :doc:`output/index`
- :apiref:`power_supply/power_supply.h`
- :ghedit:`Edit`