Water filter quality and water softener status

I checked and the air pressure in Montreal is currently only 1-2% higher than the value used above (14.7 psi). The air pressure changes when you travel to altitudes close to a kilometer.

I suspect your psi reading is too high.

my question is more what do i need to change in my lambda and or code to actually get the right psi and calculations?

I dont understand what those numbers represent, i copy pasted from someone with similar model who was saying this was the formula he used, he didnā€™t give no breakdown or explanationā€¦ i just tried it.

doesnā€™t seem to be right.

i would really appreciate it if someone could rapidly maybe explain what the numbers in the equation represent.

I donā€™t see that equation in this thread.

If you donā€™t have an equation from the spec of the sensor you are using, I would recommend calibrating it instead. I do see examples of that in this thread. The idea is you collect a set of readings over a wide range of fill volumes, then that empirical data generates its own curve in esphome.

As you can probably notice, I am not that good with this type of equations yet, i still have a lot to learn.
I do not know how to calibrate this sensor at all, I wouldnā€™t know where to begin.

I collect should readings from whatever numbers i get from it right nowƉ i dont see how that could actually help me?

do you know how to calibrate these things? could you share that knowledge with me, i would be really gratefull for tghat.

thanks

I would do it like this. If I had access to filling it by hand, I would drain it first. Then fill it to 5L and take a voltage reading. Then to 10L and again take a voltage reading. To take a voltage reading, you use it like this:

  - platform: adc
    pin: A0
    name: "water pressure"
    update_interval: 2s
    unit_of_measurement: "V"

This will give you the raw voltage reading. Write the values corresponding to each fill on a piece of paper. You will have say 5-10 data points, the more the better.

For simplicity letā€™s say you have the following data:

0L is 0.1V
25L is 0.5V
70L is 0.9V

Then you would calibrate the voltage signal to volume based on your data like this (see calibrate-linear):

  - platform: adc
    pin: A0
    name: "water volume"
    update_interval: 2s
    unit_of_measurement: "liter"
    icon: "mdi:gauge"
    accuracy_decimals: 1
    filters:
      - calibrate_linear:
        - 0.1 -> 0
        - 0.5 -> 25
        - 0.9 -> 70

The examples up the thread use a 4th degree polynomial fit (using calibrate_polynomial) but I would not recommend anything higher than a 2d order polynomial unless you are capable of evaluating whether it is fitting well.

I will do just that tonight, or at least when itā€™s empty next. now thereā€™s like 30l in it or something.
Thanks for your time, I first need to solder the 1118 then connect it, then ill take the measures!~

Thank you so much for your time, this really helps me understand the workings of HA/Sensors and some coding as well.

talk to you soon

So I have done like youā€™ve asked and collected voltages at different quantities of water in my small tank
here they are:
10l: 0.621v
15l: 0.634v
20l: 0.649v
22l: 0.663v
32l: 0.689v
40l: 0.7v
50l: 0.715v
52l: 0.720v
65l: 0.718v
70l: 0.730v

some of the readings seem odd to me but maybe you can help me make more sense of all this. unfortunately the zero reading i took is obviously wrong since itā€™s : 0.711v I also took another with 2l which is also probably wrong: 0.635v I guess the sensor needed time to stabilize or something.

I do not know anything about your particular sensor, so maybe others can help there . There is nothing wrong that at 0L it has a nonzero voltage, but it is obviously wrong that it is closer to 50L. As I said, Im not familiar with this sensor, it is very possible though that it will get different readings if it gets in unsubmerged.

I would throw out your outliers and use the list you have. It is encouraging that you have a nice predictable trend here.

You can consider keeping the voltage only sensor for future recalibrations in addition to adding a sensor with the calibrate_linear filter.

yeah itā€™s encouraging in deed!

thanks

hi. iā€™m trying to accomplish something very similar - detect water pressure when my well is on. Iā€™ve done a mock up by getting the ESP8266 up and running, creating a sensor, and so far itā€™s detecting something (i dont have the transducer yet). Did you connect the transducer directly into the ESP8266 without resistors? thanks

Hey @larry-glz, in my setup I did not have any resistors. Check out my pics from Sep 2020 above. Hope this helps.

1 Like

hey @cmerritt82 - i got it to work using your setup. after several tries, i was able to nail down the lambda formula. thanks!

1 Like

Hello, Can you tell me how you wired up the wemos to the ads and the water sensors? This is my first project like this never worked with breadboards or anything before and was about to start then I noticed a couple of little things in-line that I wasnā€™t aware were being used so I donā€™t wanna wire this up until Iā€™m sure!

Hi Adam, this is a pretty advanced ESPHome implementation of water pressure and salt container monitoring system. If this is your first attempt into ESPHome you should probably start with something simpler.

If you really want to start here, you need to read through the thread, there are some wiring diagrams already posted. If you have specific questions ask those questions. Iā€™d just be guessing at what you donā€™t knowā€¦

I have read through it but Iā€™m missing something. I undertstand everything mostly, I got caught up on the pcb pic that you said was not the one being used so maybe iā€™m hung up on a non issue. do you have anything wired in between the sensor and the ADS1115? I see where you say it wires directly to the A0/A1ā€¦ pin on the ADS. I guess the post I got hung up on isnā€™t this one directly but the one talking about how to wire the sensor and regulate voltage. Iā€™m just making sure there is nothing added beyond the wemos board the ads1115 and the sensor before I start hooking everything up I donā€™t want to fry anything iā€™m on a constrained budget

Nope, if you look at this post and read the first sentence youā€™ll see how itā€™s wired. The yellow wires coming into the PCB are shorted directly to the A0,A1,A2,A3 pins. The red and black are power and ground.

Donā€™t be afraid to test it out and try thingsā€¦ thatā€™s what I did from the git-go and I still havenā€™t fried anything (and Iā€™ve built and tested a lot of stuff!! I currently have 24 ESPHome devices on my network). I felt the same way as you when I started and was afraid to burn something but these devices are surprisingly resilient.

Thank you very much. Everything is good. Now I have to find a way to calibrate but atm have no way to get an initial reading to calibrate each one against but I know how I can do that in time. And I choose to split up my filters because for now my well is drawing a lot of sediment so I have the sediment at the beginning with a prefilter even before that so I was going to use the prefilter on ADS0

How would I use a single sensor wired into the wemos? I looked over that code that was posted for a max of 100 psi; however I am dreadfully sick with Covid and wanted to make sure before I put it in service and fry it.

Did you read the 1st post? Because I explain it there.

I found a different post with this for adc which I guess is accurate enough and what I was wanting.

  • platform: adc
    pin: A0
    name: ā€œIncoming Water Pressureā€
    update_interval: 10s
    unit_of_measurement: ā€œpsiā€
    icon: ā€œmdi:gaugeā€
    accuracy_decimals: 1
    filters:
    - multiply: 5.0
    - lambda: return x*43.75-21.875;

For your 4th degree polynomials how do you arrive at the data points? and yes Iā€™ve read the posts over and over and over and over again. I do not understand that part

I used the hardware pressure gauge I installed to get the ā€œrealā€ pressure. I used the shut off valves to isolate the sensors from the rest of the house. Then I used the debug data from ESPHome to capture about a minuteā€™s worth of raw voltage data and I manually plugged the data into Google Sheets. Iā€™d let a little pressure from the closed system, and do the measurements again. I did that for about every 10 psi and Iā€™d have all the data. Then itā€™s just a matter of averaging the datapoints and voila! you have a near perfect fit.