diff --git a/components/sensor/pulse_counter.rst b/components/sensor/pulse_counter.rst index b418d2757..a9ae0a16a 100644 --- a/components/sensor/pulse_counter.rst +++ b/components/sensor/pulse_counter.rst @@ -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 --------