Calculate slope of sensor graph

I have a water level sensor in my water tank. Every time the tank fills up there is a distinct uptick as shown in the image below. Is there any way to calculate the slope of a graph (see red line below) every time it goes up?

Something to consider is that during summer the recharge rate from my well drops so the time it takes to refill the tank will take longer.

Using the values below I would want it to calculate the slope in inches/min based upon the max & min values taken at 4:54 PM and 5:32 PM. So around 0.308 inches/min in the example below.

So not sure if Derivative or trend would work best?

image

Have a look at the Deritative Integration, I have not used it but it may do what you want and provide a rate of change in level e.g. inches per min or inches per hour.

I created a Derivative Sensor and we’ll see how it goes. I’ll create a Trend one too to tinker with.

A separate approach could be a CT sensor on the well pump as this would give you the on / off times exactly. Also allow for diagnostic monitoring of the pump for low water conditions.

I was thinking of that too once I get something to monitor the power usage of the well and pressure tank pumps.

How would I then go about using the on/off times to calculate the slope? Just have it track the on/off times and correlate the height of the water at those times?

You’d have some templates setup. First a pump on / off boolean derived from the current sensor. When that goes on capture the tank level (template trigger), when that goes off you can then calculate the slope. The time to fill depends on groundwater level and how much is being used from the tank. For example someone taking a long shower or watering the garden will cause a longer fill time. You may need a flow meter….

What I’ve found is that as the well level decreases the pump current goes down (counter intuitive), hence I capture the last current sample before the well turns off and use this as a trend of groundwater level. High pump current on the other hand can be a sign of a pump starting to fail.

1 Like