Variation of pressure with pressure sensor

MisterBill2

Joined Jan 23, 2018
18,590
The very simple thing will be to apply a known voltage to the input and observe the number of counts that register. I hope that you are able to see actual counts before scaling is applied. One interesting fact is that the reference voltage is NOT the same as the full scale voltage, at least for many A/D converters. While the reference is 2.531 for some devices, the input range is zero to ten volts. At least for those in the reference book from Motorola. So there goes one theory! Certainly there should be some information about the analog input voltage range for the board you are using. ALL of the analog inputs to A/D conversions that I have used have nice inputs like 0 to 10 or zero to 5 volts. So there is another piece of information that is rather important to have.
 

Thread Starter

Guytas

Joined Apr 29, 2021
32
Ok, it’s confirmed... the temperature is to blame. Today, a nice sunny day, the sun was hitting the sensor. The pressure changed quite a lot. I then put a cardboard in front of it and suddenly it start changing in the other direction. So I will protect it from outside temperature as much as I can and that will be sufficient I guess.

and yes by using the reference voltage of 2.5xx I do get 1024 divisions of that 2.5xx volts. So that will also be sufficient. Mainly that in reality I get way more then 1024 because I read the analog port 300 time in less than 100ms, and take the average. It comes out pretty good (better than expected).
 

Reloadron

Joined Jan 15, 2015
7,523
Ok, it’s confirmed... the temperature is to blame. Today, a nice sunny day, the sun was hitting the sensor. The pressure changed quite a lot. I then put a cardboard in front of it and suddenly it start changing in the other direction. So I will protect it from outside temperature as much as I can and that will be sufficient I guess.

and yes by using the reference voltage of 2.5xx I do get 1024 divisions of that 2.5xx volts. So that will also be sufficient. Mainly that in reality I get way more then 1024 because I read the analog port 300 time in less than 100ms, and take the average. It comes out pretty good (better than expected).
Well alrighty then. Again, nice job with the charts, they were very telling.

Ron
 

Tonyr1084

Joined Sep 24, 2015
7,905
They are in the shade but yes in plastic.
You reminded me of a hydrostatic pressure test I was doing one morning on a 100 foot long 12 foot diameter 3 inch steel wall tank. The sun had not yet risen high enough in the sky to strike the tank under test. Pressure monitoring was going nicely. Then the sun reached high enough to begin shining on the tank. Pressure inside the tank began to fall rapidly. I walked all around looking for signs of leaks but found none. The higher the sun rose the more the pressure dropped. The pressure we're talking about (if memory serves) was about 270 PSI. It was the sun causing the tank to expand and create larger volume inside the tank. The larger volume meant a reduction in pressure.

With plastic barrels (or hot sauce bottles) you don't have to be in the sun for them to expand. However, I wouldn't expect a rain barrel which should have an open top inlet to drop pressure. Water has weight. The higher the column of water the higher the pressure. The sun's expansion of a rain barrel might drop the water level by a quarter of an inch. But I must admit I didn't know pressure sensors could be so greatly affected by temperature.
 

MisterBill2

Joined Jan 23, 2018
18,590
UNCOMPENSTED semiconductor strain gages are very much affected by temperature. I learned that the hard way the very first batch of pressure transducers that I specified in my engineering career. After that, I learned that reading and understanding all of the specifications was important.
And while the plastic barrel expanding changes the depth a bit, it does not affect the quantity of water present in the barrel.
And I am still wondering as to how the TS got such great resolution with only a ten-bit A/D converter.
And when monitoring the amount of water in a rain barrel, just how precise does the reading need to be??
To protect from running the pump dry a simple comparator circuit will be adequate, and consume far less power. In fact, a very simple pressure switch, such as used in most top-loaded washing machines, will be accurate enough, and it will consume no standby power at all. That variety of pressure switch can usually be recovered from a discarded washing appliance.
 

Tonyr1084

Joined Sep 24, 2015
7,905
while the plastic barrel expanding changes the depth a bit, it does not affect the quantity of water present in the barrel.
I agree. But we're not measuring quantity we're measuring the height of the water column. A half inch water pipe 10 feet tall full of water has the same pressure as a one inch pipe of the same dimensions. The total volume of water is four times greater in the 1 inch pipe but will still have the same pressure. So if you take that half inch water pipe and pour it into a one inch pipe the height will only be 2.5 feet of water (head pressure) and the measured pressure will correspond. So if you drop the height of water in a rain barrel by just one inch by virtue of flattening and expanding the barrel - you're going to have some level of pressure difference.

However, granted, that change will likely be quite minimal. As I mentioned before, a friend built a thermometer that worked in reverse. As the bottle expanded the water level in the tube could drop a couple inches. But that was a plastic hot sauce bottle. Very thin plastic and likely subject to much more change. Still, heat will affect the diameter of the barrel and change the head pressure.
And when monitoring the amount of water in a rain barrel, just how precise does the reading need to be??
A key question for sure. After all, what's the difference in 25 inches of water column versus 24.9 inches? Is it worth the expense to be able to determine that kind of accuracy?

The weight of the water (8.3 lbs. per gallon) might be a more accurate way of determining how much water is in the barrel. But now you're talking about building a scale designed for a potential weight of (55 gallons times 8.3 PPG) (pounds per gallon = ) 456.5 pounds. Plus the weight of the rain barrel itself.

KISS! Keep It Stupidly Simple! If you don't want to run your pump dry then add a float and a switch. Any time the float is above a minimum level the pump can run. But if the water level falls so low that the float triggers the OFF switch then the pump shuts off. I have to agree with Mister Bill - do you really need all that complication to monitor how much rain water you've captured? Perhaps a Re-Think may be in order. But we're not here to tell you what you should do. You should do exactly as you wish. We're just pointing out some things for consideration.
 

MisterBill2

Joined Jan 23, 2018
18,590
From post #1 we see that the TS "just wants to know how much water is in the tubs" without any explanation for the purpose. Are they protecting a pump? or deciding to use a alternate water supply? Or just wondering??
Or is this just an effort to do something for fun??
To simply know how much water is present, a simple float on the surface and a change from black plastic to clear will provide an accurate means of knowing how much water there is. And if light without contamination leads to algae growth, then an opaque hinged lid is the solution.
 

Thread Starter

Guytas

Joined Apr 29, 2021
32
hehehe Sorry I left you in the mistery. ;-) These past 2 or 3 days I've been monitoring the whole thing and it is finally very acceptable to my needs. My needs.. actually, it's my wife's needs. She water the garden with rain water. She has a very large garden for tomatoes, and all the rest. It's 35 X 65 feet. She passes all her days in it. She is always scare of not having enough water in the garden. So the system monitors the water level and translate it into liters of water. Every centimeter of water is 27.5 liters. I'm not afraid that the pump runs dry, it has a pressure regulator on it and it will prevent that.

A few years ago, I made the perfect thermostat to replace 2 thermostats side by side. But since then, we keep adding stuff in that thermostat to utilize the screen more and more. And this tanks water level is now part of it. It displays a tank with the water in it. I also added the number of liters on top of it. Every time my wife water her garden, she checks how many liters she used. Apparently, she needs so much water per type of plant, or something like that. I'm not into that myself.
Every time it rains, we see the number of liters going up, and she gets all excited. ;-)

What I found amazing about the charts is the four and five digit data resolution from a ten bit A/D converter
This is quite nice actually. The way I get this precision is by taking 300 readings in about 100ms. Amazingly, it returns a value that is almost stable each time. Anyhow, from that reading (300 time average), I read it every second, and average out the last 5 minutes. The law of average seems to be working pretty good there ;-)

just how precise does the reading need to be??
Precision is one thing, but the problem I was having was too much variation to be able to sense rain, or watering.

So, I ended it up placing the pressure sensor in the middle of a 1 square foot Styrofoam box full of sand. Now the reading is changing a little by the temperature, but extremely slow, thus, not causing any problem any more. I get a fairly strait line when the water is not changing.

The fact that the tanks are in plastic does not affect the reading since the mass of water is keeping the plastic at the same temperature (almost) for the whole day.

Thank you everyone for your support in this adventure. ;-)
IMG_20220708_114925_171.jpg
IMG_20220708_142223_832.jpg
 
Last edited:

MisterBill2

Joined Jan 23, 2018
18,590
"Precision"s a nebulous term, really. I use accuracy and resolution because they are much simpler to define clearly. So it does not seem reasonable that the resolution of the ten bit A/D converter is adequate to provide that many places of accurate data. Calculator math is notorious for adding more digits to results, and unfortunately it is not simple to make data more accurate that way. Averaging is a good way to reduce the effect of noise, but it does not improve resolution.
 

Thread Starter

Guytas

Joined Apr 29, 2021
32
"Precision"s a nebulous term, really. I use accuracy and resolution because they are much simpler to define clearly. So it does not seem reasonable that the resolution of the ten bit A/D converter is adequate to provide that many places of accurate data. Calculator math is notorious for adding more digits to results, and unfortunately it is not simple to make data more accurate that way. Averaging is a good way to reduce the effect of noise, but it does not improve resolution.
True most people confuse accuracy and precision. But I don’t. And yes resolution might be a better term to use. And in this case, the accuracy was not that important. The title of this thread related to the instability of the reading. Which is now solved.

It reminds me that when I asked people about the precision of this pressure sensor, everyone answered me about its accuracy. So now I know... in the future I’ll use resolution. Thanks
 

MisterBill2

Joined Jan 23, 2018
18,590
Accuracy and resolution are usually both important, but very different. Accuracy relates to the difference between the reported value of the measured variable and the actual value of that variable. Resolution relates to the size of the smallest change that can be accurately measured. Compare a yardstick with a micrometer, as an example. (I hope that comparison makes sense.)
 

Reloadron

Joined Jan 15, 2015
7,523
I have a cartoon for that stuff.

My own little view of the resolution thing figures this way.

Resolution.png

Now if the overall accuracy of my measurement plane is +/- 1.0 degree F only the top measurement of 76 degrees matters. While the rest look nice with places to the right of the decimal since my accuracy is only +/- 1.0 degree F they matter not. Now if my system was 0.1 degree F accurate the second one down would be nice and so it goes. For the last bottom reading of 76.270 Deg. F. my system would need an accuracy of 0.001 degree F. Must admit the numbers to the right of the decimal do look pretty cool though. :) So unless the accuracy can support the resolution having greater resolution is sort of worthless.

I have another cartoon because I happen to like cartoons. This gets into the old accuracy verse precision thing.
Accuracy and Precision.png
OK so not quite electrical or electronic but I really did have a life beyond my career. :) I just see precision as a high measure of repeatability as in Group #2. I see accuracy as unbiased precision.

Now while all of this is amusing stuff since the goal of the thread is sort of solved and working maybe I'll go make some ammunition. :) I do feel terminology is important and obviously I like cartoons.

Ron
 

MisterBill2

Joined Jan 23, 2018
18,590
If you need to make a precision measurment you will need to have an accurate measuring device with adequate resolution. You will not be able to set the gap in a spark plug accurately using a yardstick (or meter stick.)
 

Thread Starter

Guytas

Joined Apr 29, 2021
32
While the rest look nice with places to the right of the decimal since my accuracy is only +/- 1.0 degree F they matter not
It depends.... you might be interested in the change of value. For instance, if you see 76.3 and the later on 76.1, you know the temperature is lowering. Even if the accuracy is to the full degree, the precision might tell you something anyhow. ;)
I really like your « point of aim » cartoon. Can I print it and put it in my office to show people? There is no copyright on it?
 

Reloadron

Joined Jan 15, 2015
7,523
It depends.... you might be interested in the change of value. For instance, if you see 76.3 and the later on 76.1, you know the temperature is lowering. Even if the accuracy is to the full degree, the precision might tell you something anyhow. ;)
I really like your « point of aim » cartoon. Can I print it and put it in my office to show people? There is no copyright on it?
Dat be true. :)

Ron
 
Top