Water level indicat...
 
Notifications
Clear all

Water level indicator

81 Posts
12 Users
11 Reactions
12.3 K Views
(@tooter)
Member
Joined: 4 years ago
Posts: 33
Topic starter  

@ruplicator

Doh, Yer Thanks. rookie mistake.


   
ReplyQuote
(@mark-bolton)
Member
Joined: 3 years ago
Posts: 108
 

I did something similar to this in my RV about a year ago. It isnt working now because the whole system got flooded (from above ..not below..;-). I only glanced at you're setup but I will be resurrecting this.

What i did was put an ultrasonic sensor in the top of the tank where it took a distance measurement which was times width and depth and came out in liters. in an arduino . it output that via serial port to the Raspberry Pi as a text string.

It was pretty crude and I didnt really know what I was doing.

FWIW ;

https://marksfieldnotes.blogspot.com/2018/09/ultrasonic-water-level-sensor.html


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
 
Posted by: @tooter

Hi all. I've just started a new project a water level indicator for my fresh and grey water on my motor home. I've decided to use a arduino and the ultra sonic sensors( I plan to use water proof sensors). I want to use a 16x2 or 18x4 lcd screen with a mode button to switch between the 2 sensors showing the state of the tank. I found some code that is sort of what I need but it will need updating to add another sensor and the mode button to the code and remove some code that won't be needed. But my coding skills aren't up to the task in hand. It would be great if someone could give me some pointers to where to start with it all. Any input would be greatly received.

Link to cade used.

https://drive.google.com/file/d/1QPsYrArl0MN80G_l3lszzTftsYXi1rSa/view?usp=sharing

I stumbled across this topic, researching on the forum for my next project.  I know this thread is an old, but if the OP or anyone else is (still) interested in this project, here is one I did using the exact same concept. - This link is on a a sailboat forum that I also haunt - https://macgregorsailors.com/forum/viewtopic.php?f=8&t=28178

The project of mine (on that forum) is also quite old and out of date with my current InqPortal library.  If anyone is interested, I would gladly make the changes needed to work with the current one.

desktop
Case Out
Assembled Small

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
Inst-Tech reacted
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
 

Re-reading your post, I also should add, it would be trivial to have the second tank's sensor display on the same UI at the same time (a second gauge and second curve on the graph) and this UI would be available on any device in your motor home - laptop, smart phone, tablet, etc.  

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 7140
 

@inq EDIT: I just looked at your links and see this is only applicable to bladders not a hard tank. So probably will not work?

I am interested. My RV has 4 tanks to monitor, 1 black, 2 grey, 1 fresh. I upgraded to SeeLevel tank monitors but even they have stopped working. I suspect the installer didn't do a good job (me). The SeeLevel monitoring strips are on the edge of the tanks and they are all about 7" / 18cm high. I can see the tops of the main grey and black so placing this kind of sensor on top is easy, I will need to work a little harder for the galley grey and fresh but they are not nearly as important to me. Any links etc would be welcome. One question I have from looking at your pictures is do the 'eyes' not have to be in direct contact with the plastic tank? I can't see how your sensor block would stay in place.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
 

@zander - That link above has four pages of forum posts for ALL the details.  It will give you a great overview.  It even includes down the level of which pins to solder.  (VERY DETAILED)  However, some steps are out of date and some you wouldn't need as you're a developer.  I wrote that project for someone that had never opened up a development environment and I just sent them the binary to upload.  They didn't want to be bothered with "programming".  

 

HOWEVER - The big issue would be, you would need to use the sensors @tooter used that are water proof and I'm assuming... they have to be inside the tanks.  The link to the boat forum as you'll see in the pictures on that thread is based on a bladder that collapses as water is pulled from the tank.  The sensor pictured above is attached to the ceiling of the bilge, directly over the bladder.  It measures the distance to the collapsed bladder and then uses a table lookup and interpolation to calculate the amount of water contained... in liters, gallons or percentage.  It also takes into account an irregular shaped tank... in a boat at the keel, the bladder falls into the keel "wedge" and has drastically different quantity of water based on height.  IOW, it's completely non-linear.

VBR,

Inq

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
Inst-Tech reacted
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 7140
 

@inq No chance they can go inside the tanks, but I might try placing them on the tanks just to see what happens.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
 
Posted by: @zander

@inq No chance they can go inside the tanks, but I might try placing them on the tanks just to see what happens.

With my limited experience with those ultrasonic sensors, they're not going to work though a hard shell tank wall.  In that boat thread, we experimented with the tops being flush with the 3D printed housing... and that caused them to give false readings.  They HAD to be raised as shown above.  IOW, they're sensitive to trivial things.  Trying to pass sound through a wall, reflect off the liquid and come back through the wall, I doubt is possible.  

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 7140
 

@inq That's what I figured. The 'advanced' units I have now are glued on the sides but I must not have cleaned the surface well enough so after working for a while they are now not working well. I am going to get under the RV soon and do some work so will try to re-stick them. I don't know what tech they use, they look like printed circuits, some sort of capacitive maybe? It's only a small problem that goes away in 19 months when I sell this and move back into an apartment for the next phase of my life.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
Inst-Tech
(@inst-tech)
Member
Joined: 2 years ago
Posts: 554
 

@inq You are correct.. the ultrasonic sensors can not penetrate the walls of the tank, and they are also subjected to errors from foam that my accumulate on the surface of the tank.. The best you can do is to have the sensors above the tank so that the cone angle of the sonic beam is distributed across as large an area of the liquid level as possible without hitting the sides of the tank. To calibrate, first measure the distance of the empty tank, that's the zero point, the in you programming, set the max range of level desired.. So the level is  zero - level reading , and then convert to volume by level( height x width x length ) for rectangle or square tanks, or height x (pi r^2 ) for circular tanks. Bladders will be somewhat more difficult, as the volume will be inconsistent, and a look up table of some sort will be required. then all that's needed is to convert volume in cubic units to volume in engineering units of liters, gallons, or whatever you require. In the industrial realm, we didn't use ultrasonic all that much because of problems of vapor, foaming, and high temperature interference's. Radar was much more efficient, or just the simple pressure transducer, ( level transmitter) calibrated for the height of the tank to to over flow.  

LouisR


   
Inq reacted
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 7140
 

@inst-tech This is confusing

he ultrasonic sensors can not penetrate the walls of the tank, and they are also subjected to errors from foam that my accumulate on the surface of the tank.. The best you can do is to have the sensors above the tank

so they can't be touching the tank, but they will work positioned above the sealed tank? That might be hard to construct though, have you seen the inside of an RV?

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


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

@zander,  The swiss accent fellow had something recently on measuring water level by measuring the water pressure in a tube, so if you did not see it you may like to give it a peep.   

And whilst you are peeping over there I see he has done a youtube on using github, something you were asking for a little while back.  More homework for you. 😎 


   
Inst-Tech reacted
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 7140
 

@byron I will check out the swiss guy, but putting any openings into a sewage tank is a non starter of an idea. I am only living in this RV another 18 months, so this is a low priority project.

As far as github, I know how to get user contributed libraries, and don't have any further need of github. I deleted all my high speed code a few years back and have no desire to start over. These arduino/Pi projects are fun but it's trivial amounts of code, I am used to the thousands, 10K, 100k, Millions LOC where something like github might have been useful. The last time I made a contribution was as a paid consultant for a specialized computer vendor/manufacturer so the contrib was done by the client, I barely knew how it was done even back then, 2002 IIRC. BTW, good memory.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
 
Posted by: @inst-tech

To calibrate, first measure the distance of the empty tank, that's the zero point, the in you programming, set the max range of level desired.. So the level is  zero - level reading , and then convert to volume by level( height x width x length ) for rectangle or square tanks, or height x (pi r^2 ) for circular tanks. Bladders will be somewhat more difficult, as the volume will be inconsistent, and a look up table of some sort will be required.

Exactly right - The boating forum had many people that are not technically inclined... software, hardware or Mathematics and boats bilges are never nice and uniform.  I set up an easy calibration process for them. 

Uniform cross-section was easy  https://macgregorsailors.com/forum/viewtopic.php?p=348686#p348686

  1. Empty it, take reading
  2. Fill it, take reading

And the program would do linear interpolation between the two.

For more complicated cross-section changes (imagine keel of the boat)

keel

They could add as many points in-between the full and empty as they wanted and it would do linear interpolation between any two points.  The more data points... the more accurate the volume versus sonic reading the result becomes.  This was all handled by another client-side webpage (with JavaScript) and totally integrated into the UI.

Calibrate

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
Inst-Tech reacted
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
 

This was a very inexpensive boat as boats go.  If it was an RV, it would be somewhere between a pop-up camper and rental Winnebago from the '80s.  The stock version came with a 5 gallon collapsible camping water bag.  It is a heavily modified boat though and putting custom tankage in the bilge and under berths is a common upgrade.  Most people merely guessed how much water they had.  A couple of common and desirable locations were installed under things screw-down flooring that wasn't usable for anything else.  It also makes it impossible to "guess" how much water you have left. 

The most sophisticated one some years ago was this marvel of information... empty, half, full.  It cost somewhere north of $100.

Compete

This ultrasonic project could be built for $10 in parts and is far more accurate.

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
Inst-Tech reacted
ReplyQuote
Page 5 / 6