Water Softener - Salt Level Sensor

:wrench: Wiring Diagram

Wiring diagram:

To simplify the setup, I used a “Terminal Adapter for ESP32 30pin”:

:point_right: Link in my GitHub project

Connections remain the same but are simply extended.

To avoid leaving the board exposed to dust, I printed a protective case:

:point_right: Link in my GitHub project

I also printed a case for the HC-SR04:

:point_right: Link in my GitHub project

:gear: Configuration

The code is designed to be easy to understand and configure.
You only need to change 2 values (excluding standard settings like api, ota, and ap) to adapt it to your water softener:

:point_right: Link in my GitHub project

Link to my project

Sorry for the multiple “link in my GitHub project” but I’m limited because I’m a new user …

One tip. Use the water tight version of the ultrasonic sensor. It will extened the lifetime of the sensor

1 Like

thx for the tip :slight_smile:

I’m using weight sensors for similar project, but the issue is that usually half of them have some drift - reporting the weight going up over time, when in reality there is no change at all. So I’m thinking about switching to those ultrasonic sensors. Did you experience any drift in them, or do they report the distance reliably?

I currently find them relatively reliable. There is obviously a small margin of error, but it remains minimal.

CleanShot 2025-03-09 at 11.57.27

1 Like

Btw, I monitor my water softener salt level with a golfball, a plastic stick and a magnet. :thinking:
Yes, this sound weird but I do.
I drilled a small hole in the golfball an pressed the stick into the hole. The ball is placed on the salt. The stick guide through a small hole in the cover. A magnet is placed at the top of the stick at such height that at low salt level the nagnet will closes a (zigbee) magnetic door sensor.

It’s a much more sophisticated solution. In the end, the main thing is that it works! :wink:

Yes you are right.
Thank you for sharing your solution.

1 Like

Great solution.

Here I use a more Off the shelf type of deal with m5stack and grove cables:


Bit more expensive but works great :slight_smile:

1 Like

Can I ask what happens if you don’t treat your hard water? Where I live there is very hard water but I have never heard anybody talk about treating their water. I have had a shower in soft water and I can feel that it is soft. But what next , heating the water I shower in ?
I hear drinking hard water may have some cardiovascular benefit. I myself mix a little with my whiskey. I may have to increase my intake of the whiskey considerably to get this benefit.

The water in my home is also very hard. We decided to install a water softener after renovating our bathroom. Why? Because of limescale, which leaves terrible marks everywhere, whether on the faucets or the shower tray. Additionally, I find that the water tastes much better, but that’s subjective. Overall, a water softener mainly helps prevent limescale buildup in pipes, the heating system, etc.

1 Like

For sure. Just bear in mind that a traditional softener is adding dietary sodium, the harder the water the more the sodium. I’m not sure how much that really matters. In our case we also have a reverse osmosis water filter for drinking water and cooking, so it’s irrelevant.