Merge pull request #2419 from colinleroy/current

Explicit wiring a bit
This commit is contained in:
H. Árkosi Róbert 2022-11-09 16:55:23 +01:00 committed by GitHub
commit 27b4b3138f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 37 additions and 0 deletions

View File

@ -129,6 +129,43 @@ trying to match.
This value is the raw count of pulses, and not the value you see after the filters
are applied.
Wiring
------
If you want to count pulses from a simple reed switch, the simplest way is to make
use of the internal pull-up/pull-down resistors.
You can wire the switch between a GPIO pin and GND; in this case set the pin to input, pullup and inverted:
.. code-block:: yaml
# Reed switch between GPIO and GND
sensor:
- platform: pulse_counter
pin:
number: 12
inverted: true
mode:
input: true
pullup: true
name: "Pulse Counter"
If you wire it between a GPIO pin and +3.3V, set the pin to input, pulldown:
.. code-block:: yaml
# Reed switch between GPIO and +3.3V
sensor:
- platform: pulse_counter
pin:
number: 12
mode:
input: true
pulldown: true
name: "Pulse Counter"
The safest way is to use GPIO + GND, as this avoids the possibility of short
circuiting the wire by mistake.
See Also
--------