SparkFun Forums 

Where electronics enthusiasts find answers.

General project discussion / help
Did you make a robotic coffee pot which implements HTCPCP and decafs unauthorized users? Show it off here!
By crypt
I have kind of the same problem at the moment. These are the options I have evaluated so far:

Use a pressure sensor like the Bosch BME280. They are really precise and a contact to Bosch Sensortec suggested to use this sensor. However, he left me with the open question of how to make the sensor water resistant.

Ultra-sonic sensors are quite obvious. I started with the hc-sr04 and did quite a lot of optimizing. I managed to get it to 0.4cm on a scale of up to 2m. However, I would like to have it much more precise as well. The bigger problem is air moisture and I decided to use a different approach. At the moment I'm hacking on a K-14WP10. We'll see what precision can be squeezed out of this beast.

Might sound funny, but I seriously thought about using a rubber dug, attached to a rubber ring, which is attached to two deflection pulleys. Now you can use a grey code encoder on one of the pulleys. However, the accuracy is way above 0.1mm and having a mechanical solution can break easily.

I think I will go with #1, even if it's still quite hard. If you would do the same, one recommendation: You have to use another sensor for air pressure outside and only work with the difference of the two sensors. Otherwise you'll have different measures, depending on the weather.

By lyndon
Robert, I was involved as the software engineer on a project that did this with differential pressure sensors. I don't remember the actual sensor used, but we solved the "wetting" problem by placing the sensor outside the container, and running a stiff tube down to the bottom of the vessel. Since it was a gage sensor, it provided the difference between the bottom of fluid and atmosphere by design.
By MichaelN
Your requirement for 0.1mm resolution will be a real challenge. What's the maximum depth of water?

Have a look at the following, but note that with the specified sensor and schematic the resolution would be worse than 4mm, when using an Arduino operating from 5V. ... pth-sensor

If you go for a pressure-based solution you need to have a resolution of just 1 pascal to achieve 0.1mm resolution. I'd suggest a 2-port differential sensor somehow configured to avoid direct contact with water. Something like the following would be better than the MPX2010DP / MPX2053DP in the above webpage:

You can buy waterproof sensors, but they tend to be designed for much larger pressures than you're dealing with.