Measure Water Depth with an Absolute Pressure Sensor: References, Sealing and Calibration
A pressure sensor can estimate water depth without a float, but the number it returns is not automatically the depth below the surface. Atmospheric pressure, liquid density, mounting position and the sensor's calibration all enter the result. A waterproof-looking metal cap also says little about whether the surrounding circuit board can be submerged.
The MS5803-14BA pressure-sensor breakout provides a useful example of a higher-range absolute sensor. It appears in PMD Way's barometric pressure sensor collection, but its suitability for a particular experiment depends on the actual range and installation, rather than the collection name.
Start with the reference pressure
An absolute sensor measures pressure relative to an internal vacuum reference. At the surface of an open container, it therefore reads atmospheric pressure. Below the surface, its reading includes atmospheric pressure plus the pressure produced by the water above it.
For still liquid in an open container, the useful relationship is:
depth = (pressure at sensor − pressure at surface) / (density × gravitational acceleration)
Use pressure in pascals, density in kilograms per cubic metre and gravitational acceleration in metres per second squared to obtain depth in metres. WIKA's explanation of hydrostatic level measurement describes the physical principle. Liquid density and the reference pressure are part of the measurement, not optional refinements.
For example, suppose the pressure difference is 9,810 Pa. With an assumed density of 1,000 kg/m³ and gravitational acceleration of 9.81 m/s², the calculated depth is 1.00 m. This is an illustrative calculation for approximately fresh water; use suitable density information when temperature, dissolved material or another liquid matters.
A surface reference measured at the beginning may be sufficient for a short demonstration. A long deployment needs a way to account for changing atmospheric pressure, such as a suitably checked reference sensor. In a sealed vessel, the gas pressure above the liquid is the relevant reference and may differ substantially from the outside atmosphere.
Match the range to the experiment
The TE Connectivity MS5803-14BA datasheet specifies a 0–14 bar operating pressure range and a 1.8–3.6 V operating supply. Its separate 30 bar overpressure figure is not an extended measurement range. Accuracy conditions also include a wet/dry-cycle qualification: the document calls for drying typically once a day.
These details make it inappropriate to infer permanent underwater service from the protective cap alone. Confirm the intended medium, exposure schedule and mechanical installation with the sensor documentation before building a long-term level monitor. Do not generalise water compatibility to arbitrary chemicals or fuels.
A very wide pressure range is not always an advantage for a shallow tank. Compare the expected pressure change with the specified accuracy and noise under your conditions. A generous maximum pressure rating does not prove that a few millimetres of changing level will be distinguishable.
Keep resolution separate from accuracy
The datasheet lists oversampling-dependent RMS resolution down to 0.2 mbar. That corresponds to 20 Pa, or roughly 2 mm of water using the assumptions above. It does not establish 2 mm absolute depth accuracy. Offset, temperature effects, reference error and installation effects can be larger.
Decide what your project actually needs: detecting a substantial level change, comparing repeated fills or reporting an absolute height. Give each requirement an allowed error and a response time. A display showing three decimal places is useful only if those digits communicate meaningful information.
Protect the assembly without blocking pressure
Separate the wet pressure path from the dry electronics in your mechanical drawing. Identify exactly where pressure reaches the sensing element, where seals sit and how wires exit. The exposed PCB, solder joints and connectors need protection appropriate to the environment.
Do not fill the sensing opening with glue or press on the gel. If an enclosure or isolation arrangement changes the pressure path, test that completed arrangement rather than assuming it behaves like the bare sensor. Air pockets, flexible tubing, trapped liquid and restrictions can change response or introduce offsets.
Mark the height of the sensing point on the finished assembly. Depth is measured above that point, which may sit above the bottom of a tank. A drawing that records this offset prevents software from silently treating the sensor's location as the zero level.
Use a shallow, non-pressurised test arrangement for initial experiments and keep power connections dry. A breakout project is not a qualified diving instrument, pressure-vessel controller or flood-protection system. Those applications require the appropriate complete equipment and assurance process.
Verify the digital measurement chain first
Inspect the supplied board's schematic and configuration before selecting I2C or SPI. Check its supply input, signal levels and any solder-jumper changes. A host's 5 V supply availability does not make a low-voltage sensor interface tolerant of 5 V signals.
The SparkFun MS5803-14BA library repository provides a starting point associated with the design referenced by the product listing. Record the library version and confirm that the code targets the 14BA variant. Related pressure sensors may use different compensation calculations despite similar commands.
The TE datasheet describes calibration coefficients, a PROM CRC check and pressure/temperature compensation. Check those steps and the maximum conversion waiting times when reviewing a driver. A successful bus acknowledgement alone does not establish that the resulting pressure is valid.
Log the raw or intermediate measurements available from your software, compensated pressure, temperature, timestamp and validity status. Keep a communication failure distinct from a measured zero. That distinction becomes essential when graphs or alarms are added later.
Calibrate the complete installation
- Let the assembly settle at the surface and record a reference interval.
- Place the sensing point at several independently measured shallow depths.
- Wait for a stable reading at each position and record both raw pressure and calculated depth.
- Repeat the points while returning towards the surface.
- Finish at the original reference position and compare the final reading with the initial one.
Use the mean of each stable interval and retain the spread as well. A consistent offset suggests a different issue from changing sensitivity or a delayed response. Returning to the start helps expose drift, trapped pressure or a mechanical change during the test.
Finally, repeat the test with the actual cable, enclosure and logging interval. Save the reference method, density assumption, mounting offset and software version with the results. Those details make a pressure-derived depth trace reproducible and give you a defensible basis for deciding whether the assembly suits the intended measurement.