Need help with i guess fluxating 2 wire touch sensor up/down

so i have made several boxes to detect floor if it floods using esp32 mini d1s

all it is is gpio to ground 2 wires to 2 screws in a container and when water touchs the screws makes contact just like those peep easter chickens u wet your finger and touch the 2 contacts

well when i do it the sensor on couple dont work or they go on off on off on off

i tried delayed ms up to 250 but then doesnt work and if i need a resistor i not sure what size i need

but here is the code that i use on all my water floor sensors

binary_sensor:
  - platform: gpio
    pin: 
      number: GPIO16 #GPIO13
      mode:
        input: true
        pullup: true
    name: "(Well Pump)"
    on_state:
      then:
        - switch.turn_on: Siren
    filters:
      - delayed_on: 10ms # Prevents short spikes from triggering
      - invert:

so this particiular water sensor sits by my well pump so if there is any leaks on the floor it will let me know

Since you are using an esp32, you might want to get some inspiration from this: ESP32 Water Leak Detector (with notification) - ESPHome - Smart Home Made Simple

That has some stuff that is specific to the m5 esp32 device, but the general idea is to use the touch input instead of GPIO.

I haven’t tried it. I use Zigbee water leak sensors which have been okay so far.

You could use analog_threshold binary sensor instead.

@neel-m sorry delay… i looked at that link and used a little of that code i have a similar setup kinda thats been working 5 years but has been flaky in a while… using the touch pins and the threshold set down to 2… its solved that problem no more flakyiness

1 Like