About a month and a half ago I learned how to sweat plumbing for the purpose of installing a whole house filtration system. I opted to go with this setup because it has clear housings and brass threads.
I spent some time planning the route and where I was going to break into my water line. Just before I got started, I realized that many of the whole house filter systems come with pressure gauges before and after the filters; I thought about this and it makes sense as a way to determine how “plugged” the filter is if there’s a large pressure drop during water demand. So, I decided to put a couple of places to put the pressure sensors.
You can see the hook-ups in both pictures (with plugs installed). The first picture at the top left and the second picture on the top right. The top line is the return (filtered) and the bottom is supply (unfiltered). I installed a hardware gauge so I’d have some absolute value to calibrate the sensors to and some way to just visually see what the pressure is, if I’m curious. Once I had the system installed, it was time to design the electrical stuff.
I realized quickly that I can use just a standard issue pressure transducer sensors with the analog input on the esp8266, works great!:
… but there’s only one adc input on the esp8266, so I looked closer at ESPHome and found the ads1115 which uses i2c to enable four (more precise) ADC inputs.
I also wanted to find some way to measure how much salt there was in our water softener bin because it very slowly washes away over time and having an automation in home assistant tell me that it needs more salt would be very helpful. I realized quickly that the bin is almost completely independent of the system and HEAVY. Each bag of salt weighs 40lbs. So, a scale would be pretty accurate. So, I found this article and bought the stuff to build the same kind of thing.
I used a couple of pieces of plywood and had a friend 3D print the load cell holders from a model I found on thiniverse.com. I mocked up the whole thing and tested it out:
Then, I installed it and configured the software:
I’m still trying to figure out how best to use the Incoming and Outgoing pressure to indicate “Filter Health” but with Pat’s help, I am VERY close now.
Here is the ESPHome file I used to create this system:
i2c:
sda: D2
scl: D3
scan: True
ads1115:
- address: 0x48
sensor:
- platform: wifi_signal
name: ${friendly_name} WiFi Signal Strength
update_interval: 600s
- platform: ads1115
multiplexer: 'A0_GND'
gain: 6.144
name: "Incoming Water Pressure"
id: incoming_water_pressure
update_interval: never
unit_of_measurement: "psi"
icon: "mdi:gauge"
accuracy_decimals: 1
filters:
- calibrate_polynomial:
degree: 4
datapoints:
- 0.455 -> 0.0
- 0.722 -> 10.0
- 0.824 -> 15.0
- 0.948 -> 20.0
- 1.061 -> 25.0
- 1.178 -> 30.0
- 1.280 -> 35.0
- 1.398 -> 40.0
- 1.501 -> 45.0
- 1.622 -> 50.0
- 1.738 -> 55.0
- 1.859 -> 60.0
- 1.977 -> 65.0
- 2.097 -> 70.0
- 2.209 -> 75.0
- platform: ads1115
multiplexer: 'A1_GND'
gain: 6.144
name: "Outgoing Water Pressure"
id: outgoing_water_pressure
update_interval: 5s
unit_of_measurement: "psi"
icon: "mdi:gauge-low"
accuracy_decimals: 1
on_value:
then:
- component.update: incoming_water_pressure
filters:
- calibrate_polynomial:
degree: 4
datapoints:
- 0.539 -> 0.0
- 0.775 -> 10.0
- 0.854 -> 15.0
- 0.963 -> 20.0
- 1.051 -> 25.0
- 1.148 -> 30.0
- 1.232 -> 35.0
- 1.348 -> 40.0
- 1.432 -> 45.0
- 1.530 -> 50.0
- 1.637 -> 55.0
- 1.743 -> 60.0
- 1.854 -> 65.0
- 1.971 -> 70.0
- 2.078 -> 75.0
- throttle: 10s
- or:
- heartbeat: 300s
- delta: 0.04
- platform: ads1115
multiplexer: 'A3_GND'
gain: 6.144
name: "${friendly_name} Illuminance"
update_interval: 5s
unit_of_measurement: lx
accuracy_decimals: 0
filters:
- or:
- heartbeat: 600s
- delta: 0.05
- lambda: |-
return (x / 10000.0) * 2000000.0;
- platform: hx711
dout_pin: D0
clk_pin: D1
gain: 128
name: "Salt Bin Weight"
update_interval: 10s
unit_of_measurement: lbs
icon: "mdi:shaker"
accuracy_decimals: 1
filters:
- median:
window_size: 61
send_every: 60
send_first_at: 6
- lambda: return x * -0.0000911 + 23.3;