Note: The HC-SR04 did not end up giving me consistent results. I ended up switching to using the time-of-flight vl53l0x sensor. Here is the new project.
An ESP32 based water softener salt level sensor
Uses the HC-SR04 ultrasonic distance sensor to measure the salt level in the brine tank.
The level is published to an MQTT broker configured in the menuconfig.
To get accurate measurements of the echo signal from the HC-SR04, the ESP32's RMT peripheral is used.
- Run
make menuconfig
to configure Wifi and MQTT. - Run
make flash && make monitor
to flash then tail the ESP32 logs.