Reading pulses from a dry contact reed switch?

I’m looking for a high quality water flow sensor to monitor the water used by my irrigation system. I came across this meter. It uses two wires and the pulse output is a “dry contact reed switch”

The pulse output of DAE meters is a dry contact (i.e. no voltage) reed switch with 2 wires. Your counter should not generate electricity more than 0.01A, 24AC/DC, or the reed switch may be damaged. DAE customers report that their DAE water meters are compatible with RainMachine Pro-16 and Hunter Irrigation System.

Can ESPHome, preferably installed on a NodeMCU32 board be used with this type of meter to count the pulses and monitor the flow?

Yes. Connect one end of the reed switch to the ESP ground. Connect the other end of the reed switch to a GPIO. Make sure to enable the software pull-up resistor for the GPIO input.

Pulse counter to give you flow/min

Integral sensor to give you total water used (always increasing). Take care to select the correct method of integration.

Use the Integral sensor with Utility meters in home assistant to give you water used /day/week/month/year

This may help too https://esphome.io/cookbook/power_meter.html

Thanks!

Another thought, if my meter provided by the city has this same two-wire pulse counter, can I just tap an ESP32 into that and count my own pulses without messing up their count?

Yes you could. BUT - first check your local regulations. Some places in the world call that illegal meter tampering.

1 Like

Thanks for your post!
I would like to do something similar. I have a pulsed water meter with two wires (dry contact).

Therefore, as you say, one would go to GND and the other to the GPIO of the ESP.
This meter emits 1 pulse for each1 liter.
But it is not clear to me how to configure the software pull-up resistor for the GPIO input.

Could be something like this?

binary_sensor:
  - platform: pulse_counter
    pin: D1
    name: "Contador de Agua"
    update_interval: 60s
    unit_of_measurement: "L"
    on_click:
      min_length: 50ms
      max_length: 300ms


Thanks in advance!

See: https://esphome.io/guides/configuration-types.html#pin-schema

binary_sensor:
  - platform: pulse_counter
    pin: 
      number: D1
      mode:
        pullup: true
    name: "Contador de Agua"
    update_interval: 60s
    unit_of_measurement: "L"
    on_click:
      min_length: 50ms
      max_length: 300ms

Note that this is only available for the ESP32. If you are using an ESP8266 use a real resistor, any value from 10k to 56k Ohms will do. Connect it from the GPIO to 3.3V.

Also GPI16 (D0) is not a good pin to use. It will fail to boot is this pin is low when powered up. See the table lower down on this page: ESP8266 Pinout Reference: Which GPIO pins should you use? | Random Nerd Tutorials

Hi! , thanks for your message!

Then better with an esp32?
I don’t have real resistors with me.