User avatar
TerryC65
Posts: 151
Joined: Sat May 09, 2015 7:50 am
Location: Wimborne, Dorset, UK

Fluid Level Sensing

Mon May 01, 2017 11:54 am

Our local Model Town has an ongoing Project to improve the sustainability of water in the 'Model' river. This follows the route of the real River through the Model Town and has, until now, been managed and maintained by volunteers and staff turning the mains water tap on and off.

We have mapped out some requirements to do it automatically and a bit more sustainably by catching rainwater and pumping it in and out of the sump at the bottom of the river system. The current stage of development is that a bog garden has been established at the 'source' of the river to clean the water, but otherwise the rest is ongoing.

We want to use Raspberry Pis for processing and control and for the web-based GUI.

We have plenty of ideas, but not a lot of practical experience at the moment. Our main problem is how to monitor the level of water in a number of places in the river system, eg in the water barrels that are storing the rainwater and (probably) in the sump. We would also like to measure flow through the river system at one or more places.

Obviously we can use electro-mechanical means to do this (float sensors, paddle wheels attached to a pickup, etc), but we have been looking at various electronic methods, such as:

https://www.efxkits.co.uk/liquid-level- ... l-sensors/

but commercial sensors tend to be expensive and although I reckon we could do the electronics for at least some of those types, we have to keep everything dry.

Has anyone ever done anything like this? Ideally, for level, an ultrasonic sensor with a good level of water resistance would be ideal (it won't be immersed, but it will be exposed to rain, mist etc). The capacitive sensor requires RF, which brings it's own issues and the other types may provide readings that are too coarse to monitor rate of change of level.

I haven't found anything much yet that will give us flow measurement in a 'river'. The commercial types tend to be fairly cheap but designed to go into pipes. However, we should be able to come up with something using hall effect sensors, so I'm more interested in level at the moment.

Any ideas, links to projects that have done this?

Moe
Posts: 230
Joined: Sun Jan 25, 2015 2:44 pm

Re: Fluid Level Sensing

Tue May 02, 2017 11:19 pm

Maxbotic do IP67 sonars: https://www.maxbotix.com/Ultrasonic_Sensors.htm?1b8106

But you probably don't need the performance for this application. If I was doing this, I'd get some HC-SR04s off Ebay and mount them in some cheap plastic hobby boxes. They will be facing downwards, so should be rain resistant to an extent (the IP rating standard IEC 60529 allows for this, if you have a hole in the bottom of the box to let water out).
Submarine communication systems engineer and amateur robot enthusiast.

asandford
Posts: 1998
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: Fluid Level Sensing

Wed May 03, 2017 1:36 am

The weight of the water butt will be proportional to the amount of water in it.

If you know the capacity and the weight, you can work out the level - if a 100l butt weighs 100kg (minus the weight of an empty butt) it's full.

User avatar
TerryC65
Posts: 151
Joined: Sat May 09, 2015 7:50 am
Location: Wimborne, Dorset, UK

Re: Fluid Level Sensing

Wed May 03, 2017 8:41 am

Coo... Did you see the price of those things? Our budget for materials is about 1/10th of the cost of a single sensor. :shock:
Moe wrote:But you probably don't need the performance for this application. If I was doing this, I'd get some HC-SR04s off Ebay and mount them in some cheap plastic hobby boxes. They will be facing downwards, so should be rain resistant to an extent (the IP rating standard IEC 60529 allows for this, if you have a hole in the bottom of the box to let water out).
We did consider this as an option. The problem that we've identified is the build up of ice / condensation on the sensor faces, which will probably throw off the reading completely. Even if we found some material that is transparent to ultrasound, but impervious to water, this is still an issue.

Although the Model Town is only open to visitors in the summer, the real risk of flooding etc mainly occurs in the winter, so we will have to operated the system all-year-round.

User avatar
bensimmo
Posts: 4225
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Fluid Level Sensing

Wed May 03, 2017 8:56 am

How much are laser distance devices coding now?
In a water butt you could create a float on say a rod that you can reflect off.

Or some strain gauge type float device (float connected wire string to a gauge at the bottom of the butt).

Or weight as mentioned above (external strain/pressure plates/setups.

Cheap small impellers/water fans you can place in the river flow ?

Just ideas sorry, no practical help here.
Interesting though :-)

User avatar
TerryC65
Posts: 151
Joined: Sat May 09, 2015 7:50 am
Location: Wimborne, Dorset, UK

Re: Fluid Level Sensing

Wed May 03, 2017 8:57 am

asandford wrote:The weight of the water butt will be proportional to the amount of water in it.

If you know the capacity and the weight, you can work out the level - if a 100l butt weighs 100kg (minus the weight of an empty butt) it's full.
Now this isn't a bad idea!! In fact the butts are probably around 200 litres, so the weight could be in excess of 200 kg. However a load cell to cope with that range can be obtained for around £15 on eBay.

User avatar
TerryC65
Posts: 151
Joined: Sat May 09, 2015 7:50 am
Location: Wimborne, Dorset, UK

Re: Fluid Level Sensing

Wed May 03, 2017 9:10 am

bensimmo wrote:How much are laser distance devices coding now?
In a water butt you could create a float on say a rod that you can reflect off.

Or some strain gauge type float device (float connected wire string to a gauge at the bottom of the butt).

Or weight as mentioned above (external strain/pressure plates/setups.

Cheap small impellers/water fans you can place in the river flow ?

Just ideas sorry, no practical help here.
Interesting though :-)
We're kind of steering clear of reflective techniques, because of the vulnerability of the sensor to ice and condensation as mentioned above.

However, your point about the strain gauge has been mentioned elsewhere and we are currently looking at measuring the air pressure in a pipe that is connected to the bottom of the butt. Obviously when the tank is empty the sensor will measure 0 kPa (as compared to the atmosphere) and when it is full it will measure the pressure due to the height of the water column, which I calculate to be up to 15 kPa in a 200 litre butt.

Anyone see any flaws in that argument?

As for the flow sensor, the best suggestion so far is a hall effect sensor detecting a magnet going round in the flow.

scotty101
Posts: 3803
Joined: Fri Jun 08, 2012 6:03 pm

Re: Fluid Level Sensing

Wed May 03, 2017 9:12 am

Unless you need super accuracy, Conductivity probes are the simplest way to measure approx levels.

One probe detects tank full, One Medium and another almost empty.

The probes are nothing more than two nails seperated by small distance. and you measure the conductivity between the two nails. If they conduct, they are underwater.
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

User avatar
TerryC65
Posts: 151
Joined: Sat May 09, 2015 7:50 am
Location: Wimborne, Dorset, UK

Re: Fluid Level Sensing

Wed May 03, 2017 9:17 am

scotty101 wrote:Unless you need super accuracy, Conductivity probes are the simplest way to measure approx levels.

One probe detects tank full, One Medium and another almost empty.

The probes are nothing more than two nails seperated by small distance. and you measure the conductivity between the two nails. If they conduct, they are underwater.
This has also been suggested elsewhere and certainly has the benefit of being simple. (We can also use GPIO pins and pull-up resistors to detect each level.)

However, we would like to monitor rate of change of level so we would probably need a few more probes. At the moment, I'm putting this into the 'Risk Fallback' category.

scotty101
Posts: 3803
Joined: Fri Jun 08, 2012 6:03 pm

Re: Fluid Level Sensing

Wed May 03, 2017 11:30 am

This sounds like an impressive Model village! I'll have to visit if I can when i go camping in Dorset this year.
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

User avatar
TerryC65
Posts: 151
Joined: Sat May 09, 2015 7:50 am
Location: Wimborne, Dorset, UK

Re: Fluid Level Sensing

Wed May 03, 2017 12:16 pm

scotty101 wrote:This sounds like an impressive Model village! I'll have to visit if I can when i go camping in Dorset this year.
Well. As a volunteer there, I can only suggest that you won't be disappointed.

The attraction is run as a charity. There are only three full-time staff, plus the people in the cafeteria. Everyone else is a volunteer; from the ticket office staff to the gardeners. There are around 70 volunteers in all.

I've been helping out there for about 18 months now. Over winter 2015/16, we improved the lighting in the Model Railway room; day / night floodlights and lights in the houses. That was run by a pi Zero and got a two-page spread in MagPi Issue 45 :D

Last winter, we re-instated the bells in the Model Minster (including a working model Quarter Jack) and also set up a Webserver to provide an Audio Guide and Children's Quiz. Those Projects used a Pi 3.

You can a flavour of the place at http://www.wimborne-modeltown.com/.

End of shameless plug ;)

User avatar
Burngate
Posts: 6182
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: Fluid Level Sensing

Wed May 03, 2017 5:29 pm

I'm also going to be close by, 26 June onwards for a week (not camping - too old for that - Chalke Valley History Festval) so if you're at the Model Town when we visit I'll say Hi.

Moe
Posts: 230
Joined: Sun Jan 25, 2015 2:44 pm

Re: Fluid Level Sensing

Wed May 03, 2017 7:27 pm

We did consider this as an option. The problem that we've identified is the build up of ice / condensation on the sensor faces, which will probably throw off the reading completely.
Yes it would give rrneous readings if and when it happened, but I have not experienced such problems in practice, and it's very easy to eliminate false readings in software. With cheap sensors you would have to eliminate the spurious readings anyway.

In defence/aerospace we would use anti-condensation heaters where icing is expected to be a long term problem. In your case - if it became necessary - the ACH could be as simple as a big resistor stuck to the sensor mounting plate or the inside of the box, turned on via a relay when multiple erroneous readings are detected.
Submarine communication systems engineer and amateur robot enthusiast.

User avatar
TerryC65
Posts: 151
Joined: Sat May 09, 2015 7:50 am
Location: Wimborne, Dorset, UK

Re: Fluid Level Sensing

Thu May 04, 2017 9:52 am

Burngate wrote:I'm also going to be close by, 26 June onwards for a week (not camping - too old for that - Chalke Valley History Festval) so if you're at the Model Town when we visit I'll say Hi.
I have to say that I'm unlikely to be there at that time; I only normally attend during the Open period if something has gone wrong (so obviously I'd rather not be there :| ). However, we might be progressing the River System development by then so you never know. Like most development, much of the work is done in my 'office' (a spare bedroom) and I only get out on site for integration.

I hope you enjoy your day out at the Model Town and the Festival. The Model Town is all about history too of course; it is a snapshot of Wimborne as it was in the early 50s when it was originally constructed. There's not much fighting though :D

User avatar
TerryC65
Posts: 151
Joined: Sat May 09, 2015 7:50 am
Location: Wimborne, Dorset, UK

Re: Fluid Level Sensing

Thu May 04, 2017 10:06 am

Moe wrote:Yes it would give rrneous readings if and when it happened, but I have not experienced such problems in practice, and it's very easy to eliminate false readings in software. With cheap sensors you would have to eliminate the spurious readings anyway.
My main concern would be if the acoustic signal was to be totally attenuated or totally reflected by the ice or condensation. That would be impossible to compensate for and could lead to flooding if the condition wasn't detected and dealt with.

I know very little about acoustic propagation (I did work on sonar systems at one point in my life, but that was more concerned with signal processing), so I don't know exactly what is likely to happen. However, we will be relying on reflections from an air/water interface for our measurements and under icing / condensing conditions we will have a second air/water interface.....
Moe wrote:In defence/aerospace we would use anti-condensation heaters where icing is expected to be a long term problem. In your case - if it became necessary - the ACH could be as simple as a big resistor stuck to the sensor mounting plate or the inside of the box, turned on via a relay when multiple erroneous readings are detected.
Yes we could certainly do that. The current thinking is that we prototype a couple of solutions; probably the pressure sensor and this one and see what problems we have. If it was just measuring the depth of the water in the butts, then I would think that the pressure (or weight) approach would do the trick. However, we also have to measure the depth of the water in the sump. This is basically a concrete 'tank' about 40 - 50 cms deep, which is sunk into the ground at the bottom of the river system. We obviously can't weigh it and pressure measurements may not yield enough of a difference between normal and overflowing to allow us to predict a flood. The ultrasound sensors may be the best option here therefore.

User avatar
Gavinmc42
Posts: 4292
Joined: Wed Aug 28, 2013 3:31 am

Re: Fluid Level Sensing

Thu May 04, 2017 12:06 pm

Pressure sensors are used in washing machine for water level.
Time domain RF reflectance sensors are used for fluid levels.

Adafruit have a laser Time of Flight sensor that looks usable.
https://www.adafruit.com/product/3317
Ultrasonic plus laser, dual sensors for cross verification.

You need a town camera security system.
Pi cameras on poles so the rest of the World can explore your village.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
TerryC65
Posts: 151
Joined: Sat May 09, 2015 7:50 am
Location: Wimborne, Dorset, UK

Re: Fluid Level Sensing

Thu May 04, 2017 12:27 pm

Gavinmc42 wrote:Pressure sensors are used in washing machine for water level.
Yes. I had noticed that these are available, but I wasn't sure if they were a pressure sensing device or a simple pressure switch.
Gavinmc42 wrote:Time domain RF reflectance sensors are used for fluid levels.

Adafruit have a laser Time of Flight sensor that looks usable.
https://www.adafruit.com/product/3317
Ultrasonic plus laser, dual sensors for cross verification.
Now that looks interesting. We could still have problems with ice / condensation, but it might be easier to overcome that with this. It would certainly be easy to encapsulate this device with a clear window for the laser signal than to do the same for an ultrasound sensor.
Gavinmc42 wrote:You need a town camera security system.
Pi cameras on poles so the rest of the World can explore your village.
Maybe next year's project :-)

Return to “Automation, sensing and robotics”