Wifi Water Leak Detector

Well… stepped it down one at a time, way down to 100K Ohms resistor…

OH BOY!

So anyone that want to do it with a D1 mini or I guess any other esp8266 based board that isn’t very fancy, as far as I can tell, should use a ~100K resistor

Thank you so much for your dedication to help others and give so much of your time, it’s very much appreciated!

** I will solder the components onto a demo pcb and will print a 3d case for it, I will post here the results :wink:

1 Like

I’m really surprised there is such a difference between the ESP32 and ESP8266 I/O. Great that you got it working though :+1:

tom_I, thank you for sharing this project and being so responsive with help. I’m entirely new to stuff like this, so forgive me if this post isn’t helpful, but is there any reason not to just stick two bare wires into a sponge for the sensor? I have two like that right now on my ESP32 that seem to be working fine. I was unable to detect water using stainless steel probes (maybe my config is wrong) so that’s why I’m using this method instead.

Here is my config:

esp32_touch:
  iir_filter: 10ms

binary_sensor:
  - platform: status
    name: "Kitchen Sink Sensor Status"
  - platform: gpio
    pin:
      number: GPIO27
      mode: INPUT_PULLUP
      inverted: True
    name: "Water Bowl"
    id: water_bowl
  - platform: gpio
    pin:
      number: GPIO32
      mode: INPUT_PULLUP
      inverted: True
    name: "Kitchen Sink Leak"
    id: kitchen_sink_leak
  - platform: gpio
    pin:
      number: GPIO33
      mode: INPUT_PULLUP
      inverted: True
    name: "Dishwasher Leak"
    id: dishwasher_leak

I originally wanted to detect when the dog’s water bowl got below a certain level using the stainless steel probes. Since that didn’t work I was able to instead use a reed float switch I’ll include the link for if anyone else is interested. The kitchen sink and dishwasher leak sensors were just a bonus since I already had an ESP32 in the same area.
https://www.amazon.com/gp/product/B07PZBK5T9/ref=ppx_yo_dt_b_asin_title_o08_s01?ie=UTF8&psc=1

Minus the sponge that’s exactly what I am doing. Using the touch sensor instead of just relying on water to short the probes should be a bit more sensitive for pure water. Using dosed town water or well water with dissolved solids should work either way.

Did you watch the values reported in the logger and set an appropriate threshold for the touch sensors?

Also for more than one touch sensor you need to remove this:

  iir_filter: 10ms

Sorry, I’m not exactly sure what you mean by setting the threshold for the touch sensors or the values reported in the logger. The ESPHome logs only show whether the sensor state was ON or OFF.

Maybe I’m not configuring them properly as touch sensors? Because I have three of them on the same ESP32 board that are working without removing the iir_filter: 10ms line.

And thanks for the incredibly quick reply!

1 Like

I’ve played around a little and found out that the analog pin can be used too :slight_smile:
So here is what I’ve ended up doing:

Thank’s for all the help @tom_l!

Nice write up, thank’s a lot for this!

Just build a leak detector based on a d1 mini and I’m having trouble to detect water. Using a 100k resistor like mentioned let’s the probes react on metal but no luck for me with tap water :potable_water:.

Guess I now need to increase the resistor value again till I can detect water - is that right @tom_l?

Thanks so much for this. I built one and installed it in the basement, by the bulkhead door, where we have had leaks in the past. It works great!

1 Like

I had this same question about logging the threshold and found this info on ESPHome.

Did any of you guys tried to do this with a leakage sensor rope like this one?
https://a.aliexpress.com/_mPIozBi

a good idea, but the picture showsthey have used insulated wire for the sence pair? how would water conduct ?
looking at other sellers it might be the yellow absorbs water and shorts the internal coductors.

To be honest I have no idea, it is used with other products like this https://a.aliexpress.com/_mq1bPwo

I have a big area to cover and using just one cable like in the initial post doest really help that much

ive just gone and ordered a meter to see what its like.

Cool! Let us know if it works please!

the tracking is saying its in my country so should be with me soon

If using a 5V supply (not 3.3V), what are the resistance and capacitance values ​​to use?

ive just gone and ordered a meter to see what its like.

Were you able to set this up?

I looked at it and could not get anything from it. The resistace did not change when a small section was placed into water. Perhaps a larger amount of cable neaded to be submerged for a long time? but it would not work in my use case.

Came across this topic while trying to get some water leak detector cable working and figured I’d share my findings. Initially I was using a multimeter and couldn’t make any sense of it, but after setting up a touch sensor on an ESP32 I got it working PERFECTLY!

Here’s a helpful diagram clarifying which wires are the sensing ones:

And here’s the relevant ESPHome docs for setting things up:

Connect one of the sensing wires to ground and the other to the touch pin. In my case I got a reading of ~41 when dry and it consistently went all the way to 0 when wet. I was pleasantly surprised how quickly it switched between wet/dry readings, quite a bit better than an old commercial device I’m planning to replace with it! Hopefully this helps someone out!

glad you got to the bottom of it, I will buy some more and try again. Thanks.