Water filter quality and water softener status

btw, this is next on my list once I get the water pressure sensor working, I have a salt bin for softening and this will be great so I don’t have to go check the thing once a week to be sure we have enough salt…

It sounds like you’ve got the device hooked into Home Assistant you just need to verify that the sensor is showing up. I can think of two way to check that.

  1. Try going into ESPHome and pulling up the log for the device. You should set the logger: to DEBUG first though because that will tell you when the ESPHome devices sends data to Home Assistant. This is the best way in my mind to verify that the data is getting sent correctly from ESPHome.
logger:
  level: DEBUG
  1. Secondly you can check the ESPHome device in Home Assistant and verify that all the sensors coming from it are the ones you’d expect. Configuration>Integrations then click on the ESPHome device you’re interested in. It will show you how many devices and how many entities it has. The entities should cover your Water Pressure value, if they don’t try removing and re-adding the device.
    image
    Then when I click on entities it brings this up:

That’s what mine looks like.
-Greg

ok, update for the night. After a lot of flashing and setting a static ip on the 8266, I was able to get the sensor to show up in HA, progress! However, the readings are not correct, in fact it seems like whether using the lambda or polynomial formulas, I’m getting 0V reading. After further reviewing the transducer I bought, there is conflicting information on whether the sensor is a 12V input or 5V input. This is after checking my wiring and crimping. I just ordered another 100PSI sensor which states it works with 5V (several use it with rasperry pi). That will be here on Thursday and will report back then. Either way I consider it progress, thanks again for all your assistance @SpikeyGG

ok, so happy to report back, I just had a bad wire connection and was able to get the sensor working tonight, eurka!

image

Still tweaking on the forumla as it seems to be a lot of trial and error to get it dialed in just right, however, I can’t say thank you enough for your help, next up, will try the salt bin weight thing going.

Thanks again @SpikeyGG!!

1 Like

Hey @cmerritt82 and @SpikeyGG!

I recently bought two pressure sensors with the goal of monitoring before / after PSI drops through water filtration. They’re both plumbed in and now I get to wire them into my utility-room esp32. Have either of you made any updates to your pressure-sensor esphome configs?

@carpenike, I had created this thread to understand better how to get two readings at the same time from a single trigger and I’ve implemented it and been using it for a long time. It works very well and that way I am comparing pressure sensor values that are much closer to being measured at the same time. It’s a bit confusing but if you look at how the update_interval, on_raw_value, and on_value keys look you can figure out how it’s working:

sensor:
  - platform: ads1115
    multiplexer: 'A0_GND'
    gain: 6.144
    id: incoming_water_pressure_raw
    update_interval: never
    accuracy_decimals: 1
    internal: True
    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
    id: outgoing_water_pressure_raw
    update_interval: 1s
    accuracy_decimals: 1
    internal: True
    on_value:
      then:
        - component.update: incoming_water_pressure_raw
        - component.update: delta_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
  - platform: template
    name: "Delta Water Pressure"
    id: delta_water_pressure
    update_interval: never
    unit_of_measurement: "psi"
    icon: "mdi:kettle-alert"
    accuracy_decimals: 1
    lambda: |-
      return (id(incoming_water_pressure_raw).state - id(outgoing_water_pressure_raw).state);
    on_raw_value:
      if:
        condition:
          sensor.in_range:
            id: delta_water_pressure
            above: 1.0
        then:
          - lambda: |-
              id(delta_water_pressure).publish_state(x);
    on_value:
      then:
        - component.update: incoming_water_pressure
        - component.update: outgoing_water_pressure
    filters:
      - throttle: 10s
      - or:
        - heartbeat: 300s
        - delta: 0.5
  - platform: template
    name: "Incoming Water Pressure"
    id: incoming_water_pressure
    update_interval: never
    unit_of_measurement: "psi"
    icon: "mdi:gauge"
    accuracy_decimals: 1
    lambda: |-
      return id(incoming_water_pressure_raw).state;
  - platform: template
    name: "Outgoing Water Pressure"
    id: outgoing_water_pressure
    update_interval: never
    unit_of_measurement: "psi"
    icon: "mdi:gauge-low"
    accuracy_decimals: 1
    lambda: |-
      return id(outgoing_water_pressure_raw).state;
  - 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;

Every second the internal outgoing “raw” sensor is measured and that triggers an update of the internal incoming “raw” and delta sensor values. The delta sensor in turn updates the published outgoing and internal values that make their way to home assistant.

I have been toying with a couple of ideas that I haven’t acted on but may in the future:

  1. Installing a flow meter so I can use it to trigger updates and get water throughput. I haven’t done this yet because I’m worried about impacting the total throughput of the system and many of the flow meters are designed for non-potable water systems.
  2. Installing a pressure regulator after the filter system and post pressure sensor and installing a third pressure sensor after the pressure regulator. My water pressure fluctuates quite a bit on the supply 50-75psi, so I’m tempted to try to level it out but again I don’t really want to impact the throughput and I don’t know how much it would be impacted by installing a pressure regulator.

If I do eventually do one or both of these things, it’ll likely be mostly for the data collection aspects. :slight_smile:

Very nice!

I’ve got a whole home meter that I installed awhile back. Works really nicely with a pulse sensor: Amazon.com: DAE MJ-100 1" NSF61 Lead Free Potable Water Meter, Pulse Output + Couplings: Garden & Outdoor

Also had purchased a third transducer to put after my water softener to get a good indication on how the overall filtration impact water throughout the flow. My water comes from a well so I have a pump on the well tank that keeps things between 40-60 PSI.

1 Like

If you’ve got this already, that’s awesome! My plan was to use ESPHome filters to fall back to a heartbeat when the flow rate is effectively zero (like a measurement every 10 minutes) and amp up the sample rate when it’s non-zero (like every 250ms or something). That way you get good resolution to pressure drops when there’s in-house usage and you get a low resolution read at all other times (static pressure state). Thinking of the softener… it’d be really cool if we could somehow measure the softness of the water because I can tell mine fluctuates weekly-ish. I wonder if there’s a sensor for that. :stuck_out_tongue:

Thank you for your project and for the photos. I’m using wemos D1 mini, ads1115 and pressure transductor up to 170psi. Are you connecting also some resistors in your schema? It’s not very clear by the photo for me. Thank you

@malesci, you should read my response or some of the thread. The details you seek are well documented at this point.

Hello, forgive me if I insist. I have read the whole thread. But from the photos I couldn’t figure out if you also used resistors. I understand that ads1115 has 5v, gnd and pins 0 to 4 for the analog signal. But from your photo there is a tangle of wires and resistors and I did not understand the connection diagram.

Did you see my response? I answered your question directly.

Here I’m referring for the connection between ads1115 and wemos d1 mini.
In your message (always thank fro your help), it is described the connection between sensor and wemos, it’s right?

Sorry, it should look just like this:
image

2 Likes

Thanks a lot. Once the ads1115 arrives, I will try it!

hello, I have been trying to make this work for me, but i have a different need, I also would need to know the water volume in a tank in which the sensor is at the bottom of the tank.
I have two questions:
#1: what would the formula be to convert from psi to litres or %
#2 Is my formula for calculating the pressure is ok, I am not sure as I don’t fully understand the math involved.

Using a nodeMCU esp8266 on the analog input directly without resistor
I am using this formula which i got through your post:

  - platform: adc
    pin: A0
    name: "water pressure"
    update_interval: 2s
    unit_of_measurement: "psi"
    icon: "mdi:gauge"
    accuracy_decimals: 1
    filters:
      - multiply: 5.0
      - lambda: return x*43.75-21.875;

I get a reading of 22.1 psi from a half full tank , it seems a lot for a 45x55x35 tank (+/-70L)
here are the specs of the sensor: Output Signal Power Supply 0-10PSI 0.5–4.5V/0–5V

I would really like to get to understand this. and especially to have it work for me.

any help is welcomed!

/fabien

Fabien, your message is confusing. You know that we can’t convert from PSI (which is a pressure) to Liters (which is a volume), right? There is no equation for that. If you want to convert the PSI (imperial) to Bar (metric) that is possible and googling should give you the equation for that conversion. If you want volume of water in the brine tank I still think that weight (using a scale) may be your best approach.

hi thanks for your answer.
I am sure it is possible i’ve actually seen it done in various ways its done in the water towers as well there are multiple formulas which I found on internet but the problem is that i dont understand them, so I cant use them.

basically i guess I need math help regarding this sensor to find the level in % or litres it doesn’t matter. Doesn’t need to be extremely precise either.

We know water that is 0 degree celsius will weigh 1kg per litre. im guessing there would be a way to find out the amount in a tank using all these infos, I just dont know how.

Pressure is defined as the force per unit area. Besides force and area, it is also proportional to the altitude, density, and acceleration due to gravity. Mathematically,

this:

this:

this:
P α ρgh

P = ρgh

where P is the pressure (1 atm = 101325 Pascals, where 1 Pascal = 1Newton/square meter)

ρ is the density of water (1000kg/cubic meter)

h is the altitude or height

g is the acceleration due to gravity (9.8 meters/second square)

Manipulating the equation:

h = P/ρg

h = [(101325)/(1000*9.8)]

h = 10.33928571 meters

h = approx. 10. 339 m

I just suck at math too much to decipher how to do it … if someone could help me I would be eternally gratefull.

again my current mini tank is:
55’x45’x35’ so roughly 70liters

sensor reads 16.2 psi and has 1/4 of the capacity of water

I’m assuming you have two components to your water pressure reading and that it hasn’t been calibrated to return 0 psi in the open air. If so, you need to subtract the air pressure, like this if your air pressure is 14.7 psi:

(16.7-14.7)psi x (101325/14.7)Pa/psi/(1000)kg/m^3/(9.8) m/s^2

= 1.4 m

I’m not sure how you are getting your values as you are mixing units like wildfire. Is it 55 feet wide?

1 Like

If you are measuring a saline tank the density is also much higher.