Ultrasonic (HC-SR04) showing suddenly wrong values

Hi all,

does someone else having problems with the ultrasonic sensor? It stopped working 2 weeks ago (maybe I did an update that time, don’t know anymore…).
Until then everything was working correct, but now the distance is totally wrong :frowning:

This is how I measure the water level in my garden tank:

  - platform: ultrasonic
    trigger_pin: D2
    echo_pin: D1
    name: "Ultraschall Sensor Zisterne Abstand"
    update_interval: 10s
    timeout: 4m
    #pulse_time: 20us
    unit_of_measurement: "cm"
    filters:
    - lambda: return x*100; #Meter in cm umrechnen
    - filter_out: nan

Thanks!
Hannes

I seem to be having a similar problem. Have not had the time to look into it yet.

This sensor is by default very… mediocre… often throws random values, like near 0cm, or a few hundred cm… filtering that out succesfully is hard… (i use it for pellets level measuring)

If you’re using it for water measuring it can be dead - water (humidity) is not exactly a good friend of electronics. Could be just humid (need to dry it out), could be dead… a better option for you would be to have sensors on wire, separately from electronics, then put electonic board into sealed box. You can modify HC-SR04 for that. - just desolder both sensors and put then on a cable (coax if possible). Not too long, though…

The strange thing is, that I still get values. Should be around ~20 cm, but I get since 10 days around 104cm… Hmm