Water leak sensor?

I built a leak sensor with this device today. The LS-2600 is not a “contact closure” switch. Rather, it provides a trickle current when wet. So, red cable goes to 3.3v and black to A0 (the ADC) on a nodemcu esp8266 (not a stand-alone 8266). Cut the sensor cables and tin the leads if you want less than 12 feet.

The relative esphome code is:

switch: # controls the LED on the nodemcu8266
  - platform: gpio
    name: "$devicename LED"
    id: ledlight
    pin:
      number: D4 # GPIO2 Blue LED pin
      inverted: yes

sensor:
  - platform: adc
    pin: A0 # Red = 3.3v Black = A0
    name: "LS-2600 Sensor $devicenumber"
    id: adc_sensor
    update_interval: 10s # default is 60

binary_sensor:
  - platform: analog_threshold
    name: "Leak Sensor $devicenumber"
    sensor_id: adc_sensor
    threshold: 0.15
    filters:
      - delayed_on: 50ms
      - delayed_off: 50ms
      - delayed_on_off: 50ms
    on_press:
        - switch.turn_on: ledlight
    on_release:
        - switch.turn_off: ledlight

I put the nodemcu onto a small breadboard, hot-glued the sensor wires to the breadboard, and glued the board into a plastic travel soap box with holes cut for power and sensor wires.

No hubs, apps or batteries needed. Cost under $30 including 5V1A power. Assumes available WiFi.

4 Likes