Skip to content

Commit

Permalink
Add docs for H-Bridge Switch
Browse files Browse the repository at this point in the history
  • Loading branch information
dwmw2 committed Sep 7, 2024
1 parent 53b8120 commit 32ce00f
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
43 changes: 43 additions & 0 deletions components/switch/hbridge.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
H-bridge Switch
===============

.. seo::
:description: Instructions for setting up H-Bridge controlled switches (or relays).
:image: hbridge-relay.jpg

The ``hbridge`` switch platform allows you to drive an *h-bridge* controlled latching relay.

.. figure:: images/hbridge-relay.png
:align: center
:width: 50.0%

Omron G6CK-2117P relay module.

.. code-block:: yaml
# Example configuration entry
switch:
- platform: hbridge
id: my_relay
name: "Relay"
on_pin: GPIOXX
off_pin: GPIOXX
pulse_length: 50ms
wait_time: 50ms
Configuration variables:
------------------------

- **on_pin** (**Required**, :ref:`config-pin_schema`): The GPIO pin to pulse to turn on the switch.
- **off_pin** (**Required**, :ref:`config-pin_schema`): The GPIO pin to pulse to turn off the switch.
- **pulse_length** (*Optional*, :ref:`config-time`): The length in milliseconds of the pulse sent on ``on_pin`` and ``off_pin`` to change switch state. Defaults to ``100 ms``.
- **wait_time** (*Optional*, :ref:`config-time`): The time in milliseconds to delay between pulses on ``off_pin`` and ``on_pin``. Defaults to no delay.
- All other options from :ref:`Switch Component <config-switch>`.

See Also
--------

- :doc:`/components/output/index`
- :doc:`/components/switch/index`
- :apiref:`switch/hbridge/hbridge_switch.h`
- :ghedit:`Edit`
Binary file added components/switch/images/hbridge-relay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/hbridge-relay.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,7 @@ Switch Components
Factory Reset Switch, components/switch/factory_reset, restart-alert.svg, dark-invert
Generic Output Switch, components/switch/output, upload.svg, dark-invert
GPIO Switch, components/switch/gpio, pin.svg, dark-invert
H-bridge Switch, components/switch/hbridge, hbridge-relay.jpg
LVGL Widget, components/switch/lvgl, lvgl_c_swi.png
Modbus Switch, components/switch/modbus_controller, modbus.png
Nextion Switch, components/switch/nextion, nextion.jpg
Expand Down

0 comments on commit 32ce00f

Please sign in to comment.