Water level sensor needed. [ Discourse ended ]

300 gallons of water would weight about 2500 lbs (1130 kg), so you’d definitely need a hefty load sensor (@Moors7 suggestion sounds plausible).

I didn’t think about using a multi-turn pot. Then you could just directly use the resistance to get a reading, without all the fuss about counting turns, and having to figure out which direction it turned.

An ultrasonic sensor still seems like it has good potential (no pun intended). Mostly a matter of finding one that matches your range requirements. Or what about a light-based time-of-flight sensor, like the ones used in laser rulers?

While Googling around, I found this LIDAR Lite that looks extremely promising.

@dougal, the LIDAR looks fantastic. A simple float could be used to reflect the LIDAR so reflection issues could be avoided.

@peekay123, Oh yeah, I forgot to mention that. I was wondering if the transparancy/reflectivity of the water might cause any problems (would the sensor see the reflected signal, immediately followed by one that was transmissive then reflected?). Putting a floater in there is a great idea to deal with that.

That does look promising, but I think it is a bit out of my budget at $90.
It was suggested a couple times to try ultrasonic, so I am trying to do that. I have the sensor, but can’t find any example code for the core. Anyone know where I can get some example code (I tried some script for the arduino, but it would not work because pulseIn() is not supported).

I just happened to have run across this thread earlier:

Yea @dougal. I may have to use that, but was hoping there may be some more straight forward examples for the core. I will keep that in mind.

These forums are awesome :smile:

This doesn’t solve the problem in the short term but I am working with @mdma to create a timer API for both the Core and Photon that will support all timer functions including Input Compare which can be used for pulse timing measurement. I haven’t got all the answers yet but it is a work in progress.

PS, I think @timb’s pulseIn() function needs a refresh which will need the new fast I/O commands currently being worked on.

1 Like

There are lot of possible ways to do this depending on the tank, what kind of water, the temperature of the water, does it need to be food safe, etc.

One way that has not been mentioned yet is to use the fact that water is mildly conductive (unless you have a tank full of deionized water in a lab). You would need 10-12 metal points in contact with the water to make the measurements to get your 10% accuracy. I would use stainless steel screws or bolts either in the tank wall if it is plastic or in a PVC tube in the tank or outside the tank like a sight glass. You would need to be careful about the wiring and any galvanic problems that might arise from dissimilar metals if the wiring is inside the tank too.

Here’s a link to a small scale version:

The tank is a square tote pvc (or plastic) has been cleaned out.
The water can be sourced from rain gutters, creek water by a ram pump, or water company if needed.
Not food grade, but used in organic garden/greenhouse.

How about two stainless steel wires in close proximity, a few feet long? As the water rose, would the conductivity increase at a usable rate?

In theory this would work but in practice I think that the change in resistance would be too small as percentage of the overall value to be measured well.

1 Like

If I understand this, you mean the higher up the wires the water gets, the resistance change will diminish, but for the first couple inches, it may be easily measured?

What if we had the wires further apart at the low area, and the wires move closer together at the higher levels? Do you think that would help?

In my experience, this method does not work in water, particularly when you don’t know the ion concentration, but feel free to experiment for yourself.

1 Like

Lots of great info guys/gals, thanks. We are about ready to abandon this thread. I still don’t know which way to go tho.
After all the great input, if you want to vote on your choice go ahead. Then we will abandon this thread.
Great discourse.

You could also try a capacitively based sensor. An example would be this Water Level Sensor. It seems to be fairly accurate and is able to operate in many types of liquids. The only downfall that I can see is the fact that it is a little pricey. If you are going for a cheaper solution, you might want to consider a simple float based system. As an example, just check out the back of your toilet. You could hook it up to a pump and have it stop pumping water at the maximum point (in your case 6 feet of water).

1 Like

Anyone knows where i can find the library for the MPX4250GP sensor?

Just thought I’s throw in my two cents here about using an ultrasonic sensor. I tried using an HC-SR04 in my 2600 gallon above ground water tank, and while it worked fine for a day to two days, it then failed due to condensation on the sensor; I got readings that jumped from ~25 cm to over 100 cm when the actual level was constant at around 25 cm. If I removed the sensor, shook it out, and dried it off, it would work again for a day or so. So, this sensor is not really suitable for this purpose.

1 Like

Just a random though, but wouldn’t it be possible to spray it with one of those “hydrophobic nano sprays”? They’re ought to repel water, and might help?

That’s an interesting idea. I’ll have to check that out. Do you have a particular spray in mind?

You could also heat the sensor so it is always above the dew point.