Water Level Detector

Anyone successfully used this type of sensor with ESPHome? Two uses I have is 1, water leak detector and 2 rain guage…there may be better sensors for either, but this one seemed so cheap and basic but I’m not seeing anyone using it with ESPHome and I can’t even find a model number for it. Here’s a link to one on banggood.

Thanks.

1 Like

Just a gpio binary_sensor should work.

1 Like

Used it with the A0 pin. Works great.

thanks folks. @gencure – does the sensor report water/no water or how much water / depth of water / resistance level? (i.e. digital 1/0 or analog between 0 and x)?

The sensor reports the voltage. I use a template sensor to translate it to the water amount in ml.

sensor:
  - platform: adc
    pin: A0
    id: esp_wassernapf_volt
    name: "Esp Wassernapf Volt"
    update_interval: 3s
    accuracy_decimals: 5    
    unit_of_measurement: 'V'
  

  - platform: template
    name: "Esp Wassernapf Wasser"
    id: water1
    unit_of_measurement: "ml"
    
    filters:
      - calibrate_linear:
          # 0.1v = 0ml
          # 1v = 1700ml
          - 0.00098 -> 0.0
          - 1 -> 1700   
    icon: "mdi:water-percent"
    update_interval: 1s
    accuracy_decimals: 1
    lambda: |-
      return id(esp_wassernapf_volt).state;   
1 Like

This is exactly what I needed! Thank you.

I am using the Sensor with a D1 mini and with the above template. The Sensor is basically working but he shows continually a value of 6.6 ml without any water contact.

Bildschirmfoto 2022-05-31 um 08.29.10

I expect 0 when no water is detected. After each intervall it shows a very short time 0 and switches then back to 6.6 ml

Is this a normal behavior?

You probably need to set your filters to calibrate it. There will be a static voltage when there is no water present from humidity in the air etc. What I did to calibrate mine was get a 0 level, a full level, and a mid level inside the container.

Example:
If i have a 20ml container there will be a voltage reading at 0, 20, and 10 and the voltages should be between 0 an 1 v. Something like

    filters:
      - calibrate_linear:
          # 0.1v = 0ml
          # 1v = 1700ml
          - 0.00098 -> 0.0 # empty
          - 0.5523 -> 10.0 # half full  or 10 mL of water
          - 0.978 -> 20.0 # 20 ml -- full will be when the entire pad is covered
1 Like