Notifications
Clear all

Introducing Myself with my irrigation project

368 Posts
9 Users
50 Likes
21.5 K Views
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2508
 

@wamagee 

Bad news on the tube idea. I made a cap for the tube and a small "carrier" for the HC-SR04 and mounted them at one end of the tube.

IMG 1764

I hot glued a disc about the same size as the inner dimeter of the tube (to simulate the water level) onto the end of a metre stick (at the zero mark).

IMG 1761

I decided that exact distance accuracy wasn't as important as difference in heights, so I measured and recorded the HC-SR04 readings at (insertion distance) 90-0 in 10 cm (about 4") decrements. The readings were as follows:

Inserted (cm)    Reading

90                    33

80                    44

70                    55

60 - 10             all around 55

0                      unstable (readings from 45-65)

So, regrettably, it looks like the echoes inside a closed tube tend to swamp out the sensor after a distance too short for your 60" water tanks. The range may be larger for 4" pipe (instead of the 3" I used), but I don't think it would be reliable.

So it looks like you may still need to mount the sensor inside the lid (or whatever replaces the lid).

Sorry about that.

Anything seems possible when you don't know what you're talking about.


   
WAMagee reacted
ReplyQuote
WAMagee
(@wamagee)
Member
Joined: 3 years ago
Posts: 183
Topic starter  

@will 

You wrote" Other questions to ponder before its arrival ...

For sure lots to ponder and I have been and will continue to do so.  And thanks for throwing these issues out there. It was your raising issues about the Hall effect sensors that got me off that direction. I could have spent considerable time there before realizing the pit falls, Thank You

 

With the above said I do want to address specifically what seems to be your biggest concern, that being:

"... your diagram is kinda strange because it looks like you're connecting the measuring tube to BOTH tanks ...."

And since you are wondering whats up I suppose many more could be wondering. So I am hoping the attached image with notes will point out how the two tanks are really one tank and so yes I am connecting the single Measuring Tube to two tanks and the two tanks are also sharing the single overflow.

Backflow Prevention For Forum Overview V003 4%22 Stack Two Tanks as One

 

Also I am finding significant information on available lasers and will update with discovered information.

As to measuring water height down a 4" tube with the HC-SR04, maybe I will be able to provide some valuable information to all about this approach.

 


   
ReplyQuote
WAMagee
(@wamagee)
Member
Joined: 3 years ago
Posts: 183
Topic starter  

@will I missed your post about trying out the HC-SR04 before posting the above reply.  First thank you so much for going through that effort and I wasn't asking for or expecting you to do so.  I am still going to try real hard to avoid altering the tanks in any way and will, just for grins if nothing else, try my 4" PVC, I already have a piece to play with.  I might even look for something larger but what I am learning about lasers is, well don't yet know for sure but will keep you updated.

Again a big thanks for all your efforts, they are significant!


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2508
 

@wamagee 

It was not my intention to dissuade you from using magnets or any other technology, I was simply "leaning over your fence" chatting about your alternatives.

In my last posting above, I think i killed the future of HC-SR04s inside tubes, unfortunately.

However, if the water is distributed evenly between the two tanks, then you only need to modify one lid to do the measuring and the other lid can still be used for venting and fill tubes.

Anything seems possible when you don't know what you're talking about.


   
WAMagee reacted
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2508
 
Posted by: @wamagee

I am still going to try real hard to avoid altering the tanks in any way and will, just for grins if nothing else, try my 4" PVC, I already have a piece to play with.  I might even look for something larger but what I am learning about lasers is, well don't yet know for sure but will keep you updated.

Yes, if you try the SR04 in a larger tube, please post the results because I'd love to know how the diameter affects the ranging.

I would expect that it would allow longer measurements, but it would be interesting to see what you find.

Anything seems possible when you don't know what you're talking about.


   
WAMagee reacted
ReplyQuote
WAMagee
(@wamagee)
Member
Joined: 3 years ago
Posts: 183
Topic starter  

@dryden @will

This thread started out and pretty much stayed on  how to accurately determine water level in my storage tank configuration.  (pictures in previous replays)  I've received some great ideas and feedback from the two members this response is addressed to. Up to this point discussions have been centered on two approaches. Those being using the HC-SR04 as advocated by Will and Hall Effect Sensors as advocated by Dryden. 

The Hall Effect Sensors that I really liked did not work out because we could not find a way to determine water level after a system shut down and restart.

The HC-SR04 then become the best approach I think mainly because it could always determine water level through all situations.  The outstanding issue with the HC-SR04 is how to mount it in the tank. I wanted to install it in what I've been referring to as a "Water Level Measurement Stack (pictures in previous replays) " and Will tested that approach and determined it would not work.  Will has suggested installing the HC-SR04 in one of the tank lids and it was boiling down to that being the approach.  Will did anticipate an issue with this approach and that being the moisture content in the air and that I should expect to have to replace the HR-SR04 over time.  

My research in last couple days discovered another issue with the HC-SR04. The issue being that the level of humidity and ambient temperature significantly affect measurements (values) returned by the HC-SR04. Possibly humidity would be somewhat constant because of water in tank, not sure though of difference between full and empty tank.  Temperature though will for sure vary between 4C (40F) and 44C (110F).  Yes there are devices available to measure humidity and temperature and so this issue is possibly manageable.  But my first thoughts centered on the difficulty of calibrating the system for a very high number of humidity and temperature combinations, especially establishing each combination for calibration.

This brought back to mind a significant advantage of the Hall Effect Sensors, they are not affected by humidity and temperature, too bad we could not determine water level on system restart.

Continued research led me to another type of sensor the “XKC-Y25-NPN Non-Contact Liquid Level Sensor”.  This device, like the Hall Effect Sensors, is attached to the outside of the tank (or "Water Level Measurement Stack") and will report when water is at the same level as the sensor.  The material difference between the XKC-Y25-NPN and Hall Effect Sensors is I am able to determine water level after a restart because it always reports if there is or isn't water at a specific point.  Another significant advantage of the XKC-Y25-NPN is it requires nothing inside the tank, no magnets no nothing.

XKC Y25 NPN Image

The following link has great information on these devices including wiring specifications:

http://www.icstation.com/contact-liquid-level-sensor-ip67-waterproof-output-water-level-detector-p-12292.html

     

 


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2508
 

@wamagee 

Looks like an interesting device and a potential solution for you. I hope it works the way you need.

Anything seems possible when you don't know what you're talking about.


   
WAMagee reacted
ReplyQuote
robotBuilder
(@robotbuilder)
Member
Joined: 5 years ago
Posts: 2042
 

@wamagee 

Another link for use with an Arduino

https://wiki.dfrobot.com/Non-contact_Liquid_Level_Sensor_XKC-Y25-T12V_SKU__SEN0204

My research in last couple days discovered another issue with the HC-SR04. The issue being that the level of humidity and ambient temperature significantly affect measurements (values) returned by the HC-SR04.

You can add an inexpensive temperature and humidity sensor to increase the accuracy of the HC-SR04 by compensating for the change in the speed of sound due to the ambient temperature and humidity as explained in one of Bill's tutorials.

 


   
WAMagee reacted
ReplyQuote
WAMagee
(@wamagee)
Member
Joined: 3 years ago
Posts: 183
Topic starter  

@robotbuilder

Thank you for the additional link and I have reviewed a few times Bill's HC-SR04 article/video where he also used the DHT22 (humidity & temperature) sensor. I also reviewed, a few times, Bill's Laser vs Ultrasonic article/video. 

When reviewing the Laser vs Ultrasonic article/video both of those devices lost accuracy somewhere between 50 & 75 cc, I need 120 cc.  Bill did point out that it was possible the ultrasonic suffered because of its widening beam and so picking up stuff on the workbench.  As to the laser he could not blame it for the same reason because the laser has a much narrower beam.  The thought came to mind that either of these devices would need some type of calibration, not sure though and not sure if the same calibration would be reasonably accurate over the range of about 10cc to 120cc.

For sure I am still evaluating what would be overall best and so really appreciate everyone, as @will stated, "looking over my fence".

Most important is my need for reasonable accuracy and so far it seems that the "XKC-Y25-NPN Non-Contact Liquid Level Sensor" is ahead here.  Either there is water at a specific point or there is no water at that point. No humidity, temperature or softness of water considerations. For sure the Non-Contact Liquid Level Sensor approach will more complicated to code for and more expensive because many sensors will be required,  something like a sensor every 10 cc over a 120 cc distance.  

The physical installation of the Non-Contact Liquid Level Sensor will be simpler since it just involves attaching them where needed with the laser and ultrasonic sensors need to be in the tank.

Environmental issues, moisture etc. very important.

Dependability very important, one reason for building and installing this irrigation system is to allow us to go on extended vacations. And this ties into the environmental issues, dependability of sensors and all equipment. Hopefully I am not overreaching with this project. 

 

Again, thanks for looking over my fence!

 


   
ReplyQuote
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1121
 

@wamagee

I have a couple of IBS crates in which I store rainwater.  The water is pumped into these crates from various waterbutts.  I too have been looking over your garden fence as I'm thinking of automating the pumping into the storage crates when the butts are full, but to refrain from doing so if the storage crates are already full.  Your endeavours could highlight the ideal solution for this.  I do hope you will report back once your experimenting is complete.  I like the latest sensor you have found, I did not know it existed.


   
WAMagee reacted
ReplyQuote
WAMagee
(@wamagee)
Member
Joined: 3 years ago
Posts: 183
Topic starter  

@byron

So far the information I've received VIA this forum has been very valuable. It is great having people say "Did you think of ...". Really great because one gets immersed in something and develops serious cases of tunnel vision. I do plan on updating as I progress, if for nothing else as a thank you for advise given and efforts undertaken.  For example @will actually took the time to setup a test environment and write some code to demonstrate a topic.  That's pretty cool!

For now I've received my "ELEGOO UNO R3 Project Most Complete Starter Kit w/Tutorial Compatible with Arduino IDE (63 Items) ". I am working with intentionally super simple prototypes so I can better concentrate on what is of extreme importance to me. That being understanding Arduino's IDE and C++ with its Classes and libraries. I need to control and keep track of developed code.  Experience has taught me that without great source code management development of complex systems becomes near impossible and at best wrought with bugs. And with that development times just get longer and longer, one just keeps writing tons of difficult to modify repetitive code and shooting themselves in the foot. 

BTW, you refer to "waterbutts", what are they?


   
ReplyQuote
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1121
 
Posted by: @wamagee

BTW, you refer to "waterbutts", what are they?

A water butt is the container used to collect rain water from a gutter drainpipe.  I probably should have spelled it water butts (two words).

image

Whilst I do a lot of stuff with arduino's and the like, I also so a lot of programming in python with the likes of a raspberry pi.  I find it easier to do my code in python, both for it readability when coming back to it some months down the line, and the ease with which one can organise the development in modules contained in separate files all of which makes the larger projects manageable.   The same can of course be done in Ardunio and imho you are certainly taking the right tack of going for a good understanding of the programming environment before getting in too deep with a coding effort.  Too many times folk don't do the required homework and get bogged down. 

I link to a project I saw using ultrasonic sensors, which I think you may have now discounted, but in case its of interest to see a similar effort done in python.

https://www.hackster.io/shafin-kothia/water-level-monitor-with-raspberry-pi-d509a2

I'll keep an eye out for your progress. 👍 


   
WAMagee reacted
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2508
 

@wamagee 

I was playing around with possible solutions in an external tube (which you preferred over modifying the existing tank(s).

You seem to be pretty handy and I came up with a weird DIY solution using a float and a multi-turn potentiometer. It's hard to describe in words, so here's a crude diagram to help understand what I'm talking about ...

Proposed potentiometer

It's basically a board with a chain and two sprockets (like a bike chain) where the sprocket at the bottom is just an idler and the axle of the sprocket at the top passes through the board and is connected (via a GT2 pulley and belt maybe) to the shaft of a multi-turn potentiometer. A float (and sinker) would be attached to the chain and would ride up and fall down freely with the water level.

Some playing around would be needed to determine the pot readings at the bottom (empty) and the top (full), but this could easily be done by simply dragging the chain to the desired extreme (top or bottom) and taking a reading.

This arrangement is completely independent on power, so it will continuously register the water level on the potentiometer. When the Arduino "wakes up", the current level will be instantly available.

This also allows the possibility of putting the Arduino to sleep, only waking it up every 5, 10, 30 or 60 minutes depending on how often you need water level updates.

Anything seems possible when you don't know what you're talking about.


   
WAMagee reacted
ReplyQuote
WAMagee
(@wamagee)
Member
Joined: 3 years ago
Posts: 183
Topic starter  

@will 

A couple things:

For sure you continually throw ideas out there, again thanks for your time and effort. So many thanks.

And a double for sure this idea is definitely "Food for Thought". 

Could I build it, pretty likely. 

Will I build it? First will need to consider pros and cons.

First big pro it keeps things out of the tank and another pro would be accuracy.

First con that comes to mind other than the complexity of building is the chain, pulleys and idler in dirty water. Another con would be lots of moving parts in dirty water.

What I do see though is another way of looking at things and that always sparks additional approaches and so again thank you.

 


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2508
 

@wamagee 

I visualized you building this to fit into the vertical pipe on the outflow/overflow line, so it wouldn't be directly in the tank. Depending on how you make the frame to hold the sprockets, it may take a wider than 4" pipe

 

Anything seems possible when you don't know what you're talking about.


   
WAMagee reacted
ReplyQuote
Page 2 / 25