Making an Electronic Weight-Based (Non-Tipping) Rain Gauge

Tonyr1084

Joined Sep 24, 2015
9,744
Here's an additional thought: Spray the vessel and tubes with a hydrophobic spray to water doesn't hang around in the vessel or tubes.
 
Last edited:

MrAl

Joined Jun 17, 2014
13,726
Great discussion! Thank you to everyone offering thoughts and suggestions. It's much appreciated!

For a weight solution, I would probably connect a load cell to a raspberry pi using an HX711 chip. That will amplify and convert the load cell voltages into a digital weight and has calibration options. Calibrating for known weights is the easy part. Hard part is dealing with drift over time due to creep and temperature swings from being outdoors.

It is true that when a constant load is placed on the load cell, creep is most significant after the first few minutes (as the load cell deforms from the weight), then tends to level off. While my setup would be constantly under weight (weight of the empty collection container which would be zeroed out in your final output), the amount of weight would also be changing as rain fills the collection container. So even if creep from the weight of the container subsides after a while, will the creep start again when additional weight from rain gets added later?

Maybe one way to avoid creep would be avoiding the constant load by having some type of lift motor that lowers and raises the gauge onto and off of the scales every so many seconds? Say it lowers onto scale for 20 seconds while taking a few weight measures and averaging. Then lifts off the scale for 20 seconds, zeros the scale during that time, then lowers back onto the scale for more measures. Something like a motorized pan/tilt bracket for a security camera. Or maybe there's other ideas that could raise/lower on a time scale?

Then comes the temperature correction. I could always put a temperature sensor on the load cell. If the calibration is linear, then set it based on 2 or 3 different temperatures. If the temperature calibration is non-linear, then I don't know how I could check for every possible temperature to make the curve.

As the load cell calibration may be a time consuming process, I'm also rethinking the possibility of temporarily using the laser rangefinder idea. Biggest drawback there being waves and splashing of water in the collection pipe. Maybe if I have a plastic float on top of the water level, that would help stabilize the water?

View attachment 353717
Or alternatively, use a second, smaller diameter entrance pipe that extends almost to the bottom of the measuring container so that water fills the measuring container from the bottom:

View attachment 353718

Any thoughts on that? or other ideas to stabilize the splashing/water waves?

Even an ultra cheap rangefinder should work providing there's enough vertical distance between significant values..

There could be issues with condensation forming on the rangefinder sensor being that it's inside a mostly-closed container of water. Even the manual gauges sometimes get fog/steam droplets on the sides of the measuring tube; Especially if the water sits for an extended period or if there's big temperature changes. Perhaps there would need to be a very small heating element against the rangefinder to limit this.
I thought you were intent on using a weight measurement.
 

MisterBill2

Joined Jan 23, 2018
27,730
If you are willing to use a four element load cell scheme, the better commercial bridge type load cells are much less affected by temperature variations. Check the websites of the larger load cell manufacturers rather than anything you see on the cartoon channel.
 

Thread Starter

wxman

Joined Oct 13, 2022
69
A longer drain tube would facilitate a siphon vacuum and drain the vessel quicker. Just be sure the MAP sensor is higher than the overflow tube or the rim of the vessel.
View attachment 353831
Interesting idea. I've never dealt with MAP sensors, so I'm not exactly sure how it works, but I'll definitely look into it as a possibilty. I'd like to get as many low-cost solutions as possible and compare performances between them.


I thought you were intent on using a weight measurement.
A weight solution (if I can affordably make it work) seems most ideal, but working out a solution for dealing with creep and temperature compensation may be time consuming, as it's going to be a learning curve for me. So in the meantime, I'm definitely open to trying other possibilities (laser distance rangefinder, etc.) to see what works and what doesn't. These other solutions may not be as ideal as weight measurement, but may still be an improvement over the tipping buckets (and work as a temporary solution until the weight solution gets perfected. )


If you are open to alternative approaches (other than weight) consider capacitance water level sensing.
Definitely open to other ideas. I'm not sure how to make the idea work with capacitance, though? I'm familiar with finding the water level inside a pipe by scanning up and down the outside side of the pipe and finding the capacitance change where water changes to air. And how a fixed install of this at a specific level could tell you by capacitance if the water line has reached that level. But I'm unsure of how to make such a setup that would detect the whole volume of the pipe from top to bottom. Is there some way of making the whole pipe a vertical capacitor?
 

MisterBill2

Joined Jan 23, 2018
27,730
An MAP sensor (Manifold Absolute Pressure) is simply an absolute pressure transducer with a range of "zero to one atmosphere". The function is similar to a vacuum gage but wit the output increasing with pressure rather than decreasing. That makes the math simpler. There will be a non-constant gage factor as the air column pressure increases.
 

Tonyr1084

Joined Sep 24, 2015
9,744
Interesting idea. I've never dealt with MAP sensors, so I'm not exactly sure how it works, but I'll definitely look into it as a possibilty.
A MAP sensor has three pins. Typically one is power, that's at 5V from the car's computer. Naturally anything running on a voltage needs an input and a ground. So there's a second pin which is ground (or negative). The output or Sense pin puts out an analog voltage. As manifold pressure increases the output moves from one voltage to another. It does so in an analog manor, meaning (it probably) starts at 1 volt with no vacuum. As the vacuum increases it goes to 1.1V, 1.2V, 1.3V all the way up to 4.0V. So as water accumulates in the vessel the weight of the water within the system goes up. Since a MAP sensor senses absolute pressure - I THINK it will put out a varying voltage as air pressure increases. But I don't know that for sure. I've messed with MAP's before but I don't recall ever trying one with an air pressure. Will have to research that.
 

Tonyr1084

Joined Sep 24, 2015
9,744
Upon further reflection I think the MAP sensor works from atmospheric pressure (1 atmosphere) into a vacuum, not an air pressure. So I'm thinking without modifying the MAP sensor this won't work. I believe the MAP I messed with had to have the air chamber cut open. THEN upon blowing air into the chamber the sensor would react and produce a raising voltage. My test was a very unscientific test. I blew into the chamber. THAT is where the water pressure (air pressure rise with greater volume of water) would need to be. I think my solution will not be of any value to you or to this thread. Not unless you want to modify the sensor.

I'll look around and see if I can find that sensor. If successful I'll post pictures of it.
 

Tonyr1084

Joined Sep 24, 2015
9,744
OK, yes, I can confirm. This is the MAP sensor out of an old 1989 Toyota Celica. You can see the hole I pierced into the air chamber. It's located opposite of the vacuum port. See second pic.
View attachment 353865

The barb goes into the intake manifold. As I drew a vacuum on the barb voltage at the middle pin voltage rose (going from memory) around 1V to 4V. The greater the vacuum the higher the voltage up to the 4V output.
View attachment 353867

The modification is intended - though I've never gotten around to doing so - is intended as an air PRESSURE input. This particular sensor can now be used to measure pressure. It might be necessary to plug up the vacuum port so that air pressure is more related to atmospheric pressure at the time of sealing the vacuum port. Otherwise without back pressure, very little air pressure would be required to send the gauge from 1 to 4 volts.

My original intention was to install this in my truck and measure air pressure upon the nose. To watch how traffic affected the nose pressure and whatnot. It was intended as a teaching tool to teach me how to avoid high pressure situations such as passing a truck or car and feeling the air coming off the noses of those vehicles. Conversely it would also show a lower air pressure (my postulation) when following a large vehicle. Tailgating is never recommended. But out of curiosity I'd like to know. Not that I'd use this for improved gas mileage. No sense in putting my life and the lives of other motorists in danger just to get an extra mile per gallon out of my fuel.

Anyway, you'd have to modify a MAP sensor since they only work on vacuum in reference to 1 atmosphere.
 

MrAl

Joined Jun 17, 2014
13,726
Hi,

As to the water sloshing problem with the depth detection, I would think the waves would be random and so the amplitudes could be filtered with a good low pass filter design. The idea is to average the changes. This also has an interesting side effect. It allows (with careful design) to oversample and thus get even better accuracy. You can't do that with a perfectly level water surface you are stuck with the resolution of the sensor.
 

MrAl

Joined Jun 17, 2014
13,726
A weight solution (if I can affordably make it work) seems most ideal, but working out a solution for dealing with creep and temperature compensation may be time consuming, as it's going to be a learning curve for me. So in the meantime, I'm definitely open to trying other possibilities (laser distance rangefinder, etc.) to see what works and what doesn't. These other solutions may not be as ideal as weight measurement, but may still be an improvement over the tipping buckets (and work as a temporary solution until the weight solution gets perfected. )
Well did you look into sensors that compensate for creep?
They would not be as creepy :)
 

MisterBill2

Joined Jan 23, 2018
27,730
@tony: There are three kinds of pressure sensors, which are #1 Gage, which reports the difference between the applied pressure and the pressure from the surrounding atmosphere, #2 DIFFERENTIAL PRESSURE, which reports the pressure difference between the two ports. #3 ABSOLUTE pressure, which reports the difference between the applied pressure and an "absolute" vacuum, such as in deep outer space.
The MAP sensor is used for fuel system controls because it's output is independent of the altitude, which affects the reading of a GAGE sensor.

Hopefully there would not be waves sloshing around in an adequately designed rainfall sensor.
 

Tonyr1084

Joined Sep 24, 2015
9,744
@MisterBill2 is your comment directed to me or a to "Tony" who joined back in 06 and hasn't 't been seen since 01/22/2006?

I'm sure there are all kinds of sensors. Just thinking on the cheap side getting a junk MAP sensor (an "Absolute" sensor) would not raise the cost much at all. Otherwise, finding a different sensor would require a possible sizable investment. As noted, mine is from 1989. Possibly later because the car DID get an engine swap at some point prior to my wife owning it.

@MrAl I'm envisioning a roof top device. Something like a collection vessel somewhere on the order of 4 inches in diameter, and possibly 6 inches deep. Back in the early 2000's I worked for a company that manufactured tanks for water, oil and all sorts of other purposes. One of my tasks was to perform a hydrostatic pressure test. When installing the pressure sensor on the top there was no need for calculations. But when it was installed on a side port, depending on the depth of the sensor location I would have to add to the readout. For every 1 inch of head water I had to add 0.0361 pounds to the readout. 6 inches of water would have a head pressure of 0.2166 pounds (or 3.47 ounces). It was a simple enough calculation. But inside a tube mounted on the roof, the weight of the water isn't likely going to be blown around. Perhaps a thunderstorm downdraft right over the sensor might skew the readout but I don't see a regular issue with wind.
 

Thread Starter

wxman

Joined Oct 13, 2022
69
Anyway, you'd have to modify a MAP sensor since they only work on vacuum in reference to 1 atmosphere.
Thanks, this is definitely interesting! The new ones would be out of my target budget, especially if I were risking damaging it through modifications. But if I come across a cheap used one, it would be fun to play around with!

Well did you look into sensors that compensate for creep?
They would not be as creepy :)
None of the cells I've looked at mention anything about it. I'm guessing that feature is only available on the more expensive cells?


Hi,

As to the water sloshing problem with the depth detection, I would think the waves would be random and so the amplitudes could be filtered with a good low pass filter design. The idea is to average the changes. This also has an interesting side effect. It allows (with careful design) to oversample and thus get even better accuracy. You can't do that with a perfectly level water surface you are stuck with the resolution of the sensor.
I imagine the script that's processing the data would probably be able to take 5 measures at 2 second intervals, average the values and export that average every 10 seconds. And really wouldn't have to be quite that frequent. One export every 20-30 seconds would be sufficient enough.

As long as the value is accurate when rounded to the nearest 0.01", it would work. If I'm doing my math correctly, taking an 8 inch diameter opening and funneling into a 1 inch diameter pipe would be a 64x magnification of the area. Thus, each 0.01" would be 0.64" apart (which is 16mm)...That, along with averaging several measures would probably still keep me accurate to the nearest 0.01"...And may not even need that much magnification. (ie. maybe funnel into a 1.5" pipe)...

Another complicating factor is finding cheap solenoid valves to control the emptying; One being normally closed on the bottom for emptying and one normally open on the top that holds back new rain from entering during emptying. All of the N/O and most of the N/C ones I'm finding on a budget are "inlet" valves requiring a water pressure of at least .02 Mpa (~ 3 PSI)...That won't work for a small, gravity-drain...I have found one budget solenoid that's a drain valve; working pressure 0 - 0.005 Mpa (0 - .725 PSI) which would support at most up to 20 inch water depth in the pipe. Using the 8" to 1" funnel, would require emptying about every quarter inch of rain, so as to not put too much pressure on the solenoid. That's doable, though I would prefer to collect more rain between empties (as each empty adds a source of error)...Bigger issue is I've been unable to find a cheap N/O solenoid that will work at low pressure. That may require finding an alternative solution in order to stay on budget.
 

neTC

Joined Jan 12, 2022
23
Definitely open to other ideas. I'm not sure how to make the idea work with capacitance, though? I'm familiar with finding the water level inside a pipe by scanning up and down the outside side of the pipe and finding the capacitance change where water changes to air. And how a fixed install of this at a specific level could tell you by capacitance if the water line has reached that level. But I'm unsure of how to make such a setup that would detect the whole volume of the pipe from top to bottom. Is there some way of making the whole pipe a vertical capacitor?
Capacitance level sensing is a common and robust technology. Analog Devices, TI, and Infineon all have application notes. The technology is simple and relies on the difference in the dielectric constant of air vs. water which is a factor of 80 if I remember correctly. So almost two orders of magnitude difference. Many vendors make ICs specifically for measuring capacitance accurately and robustly.
 

MrAl

Joined Jun 17, 2014
13,726
Thanks, this is definitely interesting! The new ones would be out of my target budget, especially if I were risking damaging it through modifications. But if I come across a cheap used one, it would be fun to play around with!



None of the cells I've looked at mention anything about it. I'm guessing that feature is only available on the more expensive cells?




I imagine the script that's processing the data would probably be able to take 5 measures at 2 second intervals, average the values and export that average every 10 seconds. And really wouldn't have to be quite that frequent. One export every 20-30 seconds would be sufficient enough.

As long as the value is accurate when rounded to the nearest 0.01", it would work. If I'm doing my math correctly, taking an 8 inch diameter opening and funneling into a 1 inch diameter pipe would be a 64x magnification of the area. Thus, each 0.01" would be 0.64" apart (which is 16mm)...That, along with averaging several measures would probably still keep me accurate to the nearest 0.01"...And may not even need that much magnification. (ie. maybe funnel into a 1.5" pipe)...

Another complicating factor is finding cheap solenoid valves to control the emptying; One being normally closed on the bottom for emptying and one normally open on the top that holds back new rain from entering during emptying. All of the N/O and most of the N/C ones I'm finding on a budget are "inlet" valves requiring a water pressure of at least .02 Mpa (~ 3 PSI)...That won't work for a small, gravity-drain...I have found one budget solenoid that's a drain valve; working pressure 0 - 0.005 Mpa (0 - .725 PSI) which would support at most up to 20 inch water depth in the pipe. Using the 8" to 1" funnel, would require emptying about every quarter inch of rain, so as to not put too much pressure on the solenoid. That's doable, though I would prefer to collect more rain between empties (as each empty adds a source of error)...Bigger issue is I've been unable to find a cheap N/O solenoid that will work at low pressure. That may require finding an alternative solution in order to stay on budget.
Oh ok, it sounds like you have some severe cost constraints. That will always be a problem when shooting for accuracy and repeatability.
 

MisterBill2

Joined Jan 23, 2018
27,730
Evidently my explanation was not clear enough: "Anyway, you'd have to modify a MAP sensor since they only work on vacuum in reference to 1 atmosphere." The fact is that ABSOLUTE pressure is relative to a vacuum, so a MAP (Manifold ABSOLUTE Pressure sensor is always reading a positive pressure, even when that pressure is less than the local atmospheric pressure. BUT if one vents the vacuum side, then it becomes a differential pressure sensor functioning to deliver GAGE pressure. MAP sensors are made to be very stable over a wide temperature range because their calibration affects both emissions and performance.
Consider the dumping-bucket type of volume sensor can certainly be built in a manner much more accurate than the very cheapest consumer grade devices available. The volumes controlled can be very accurately set, and the bearing friction issue avoided by proper design. And certainly complete draining can be assured by use of hydrophobic materials. An easy option would be to use both types, with the discharge from the tipping bucket sensor draining into the weighing collection container. A system like that could provide redundant readings at not moch extra cost, and it would remove the need for the upper solenoid valve.

As for valves, there are two types of the OPEN/CLOSED solenoid operated valves, with most of them requiring some inlet side pressure to open and to seal tightly. The others are the DIRECT ACTING valves, which are held in one position by a spring and shifted to the other position by a solenoid. Those valves do not require any external pressure to operate.
 
Last edited:

Tonyr1084

Joined Sep 24, 2015
9,744
A spring loaded Normally Closed Solenoid Valve requires no power except when being opened. When powered - it opens. When power is removed - it closes. It's simple. No moving parts other than inside the valve, no bearings to weather the storm. A tipping bucket can be near the tipping point but not fully there and a gust of wind in the right direction can tip it over. And how do you count the number of times it has been tipped over without charting the measurements? A powered solenoid, the power can also pulse a counter. If over night the storm tips the bucket three times - how do you know? A solenoid, over night, may be forced to open three times and a counter can indicate that. If you want to get really geeky you can also record the times when the solenoid opened along with charting the rainfall minute by minute or by 10th of an hour (every six minutes). Not so with a tipping bucket.
https://www.walmart.com/ip/NSESSHom...ping-Bird-Science-School-Wholesale/8335450329
 
Last edited:

MisterBill2

Joined Jan 23, 2018
27,730
A spring loaded Normally Closed Solenoid Valve requires no power except when being opened. When powered - it opens. When power is removed - it closes. It's simple. No moving parts other than inside the valve, no bearings to weather the storm. A tipping bucket can be near the tipping point but not fully there and a gust of wind in the right direction can tip it over. And how do you count the number of times it has been tipped over without charting the measurements? A powered solenoid, the power can also pulse a counter. If over night the storm tips the bucket three times - how do you know? A solenoid, over night, may be forced to open three times and a counter can indicate that. If you want to get really geeky you can also record the times when the solenoid opened along with charting the rainfall minute by minute or by 10th of an hour (every six minutes). Not so with a tipping bucket.
https://www.walmart.com/ip/NSESSHom...ping-Bird-Science-School-Wholesale/8335450329
Once again, there are two types, BOTH HAVE SPRING LOADED actions. But the water valve on your dishwasher will not open without the water supply pressure present, nor will the valve on your wash machine.They both have an internal diaphram that closes the flow path until the solenoid moves a small internal plunger that allows the water pressure to open the valve. That very small internal port that gets opened is subject to developing leaks from small water-born particles and this not sealing adequately. So disassembly and cleaning can repair many of that type of valve. Been there and done that.
 
Top