I own an automatic cat feeder similar to this one:
I wanted to be able to monitor the level of cat food remaining and receive a notification when it’s running low. So, I installed a D1 Mini and an HC-SR04 ultrasonic sensor, which I attached to the lid of the feeder following this guide.
This is what the sensor displays in Home Assistant:
2 questions:
-
Why is the line a bit squiggly? I believe this is due to the irregular shape of the cat food pieces, which makes it difficult for the sensor to measure accurately.
-
Why does the sensor struggle with objects that are too close? When the feeder is completely full, the sensor tends to report distances much greater than expected, and sometimes it doesn’t report anything at all. Although the sensor’s range should be 2cm to 450cm, in practice, anything closer than 5cm seems to be hit or miss.