depth_sensor

Public

@nekrutnikolai

Share depth_sensor

Check access before sharing the link.

Who can open this board

Anyone can open this board. No sign-in is required.

This link opens the latest version. Copying it does not grant additional access.

Loading 3D model… large boards can take a moment.

README

Low-Cost Depth Sensing Module For Deep-Water Instruments

A ~$60 depth sensor module for underwater instruments, rated to 2,000 m. It uses the slight but linear compressibility of water: hydrostatic pressure squeezes a sealed water cavity, a magnetic piston travels in proportion, and three Hall effect sensors read the magnet's position without touching it. Only the electronics need a pressure-resistant package, and epoxy potting handles that — no machined housing, no gaskets, no pressure-rated enclosure.

The second prototype survived 230 bar, exceeding its 200 bar design target by 15%, which is 2.3 km of seawater. Commercial sensors in this depth class run $1,000–$10,000.

Developed as a Cornell M.Eng. design project in Electrical and Computer Engineering, in collaboration with the Woods Hole Oceanographic Institution.

Citation

Nekrutenko, N. (2025). Low-Cost Depth Sensing Module For Deep-Water Instruments. Design Project Report, M.Eng. in Electrical and Computer Engineering, Cornell University. May 22, 2025.

Field advisor: Dr. V. Hunter Adams (Cornell ECE). External advisor: Jonathan Pfeifer (WHOI). The full report is at docs/Masters_Thesis.pdf; machine-readable metadata is in CITATION.cff.

Results

ParameterSpecificationAchieved
Maximum depth2,000 m2,300 m
Pressure rating200 bar230 bar
Accuracy±10 m−20% to 70% error, uncalibrated
Power input5–24 V, ≤100 mA5 V, 80 mA
Data protocolRS-232UART (RS-232 compatible)
Physical sizeSoda can to NalgeneNalgene bottle
ConnectorMacArtney SubConnMacArtney SubConn
MountingHose clamps, boltsNot addressed

Two prototypes were built and pressure-tested to destruction at WHOI:

Max pressureEquivalent depthChange
Sensor 1120 bar1.2 kmStock Pico W, potted at atmospheric pressure
Sensor 2230 bar2.3 kmWireless shield removed, potted under vacuum

Epoxy never flowed under the Pico W's wireless shield on the first prototype; the shield collapsed under pressure and destroyed the board. Removing it and potting under vacuum nearly doubled the depth capability.

Magnet position was characterized in 2 mm steps and fitted to a magpylib model of the 4 × 12 mm N48 magnet. The fit is close — R² of 0.9977, 0.9984, and 0.9990 across the three channels — confirming the sensor behaves the way the physical model predicts.

How it works

At 2,000 m the pressure is about 200 bar. Water's bulk modulus makes that a 0.95% volume decrease — small, but linear in pressure, unlike a gas, whose 1/P response loses all resolution with depth.

The cavity is sized so that 1% of its volume equals the piston's full travel: a 247 ml reservoir gives 48 mm of stroke in an 8 mm bore. Three DRV5055 Hall effect sensors sit at 12 mm pitch, matching the magnet length, so each covers a distinct segment of travel and the active regions tile the full range. Position converts to pressure and depth by

    ΔP = (K·π·r²/V₀)·Δx ≈ 4.475 × 10⁸ · Δx      Δd = (K·π·r²/ρgV₀)·Δx ≈ 4.47 × 10⁴ · Δx

Because only the electronics see a pressure differential — the cavity equalizes as the piston moves — the structural parts can be 3D printed and PVC.

Repository contents

PathContentsReport section
docs/The design project report, and the WHOI lab notebook from the pressure test—
analysis/Five notebooks, numbered in reading order§6–7
data/Raw bench logs and the 2025-04-25 pressure test — see data/README.md§7
firmware/Pico ADC firmware — see firmware/README.md§6.2.3
tools/Host-side serial plotter and acquisition GUI§6.2.2
hardware/schematic/KiCad system schematic§6.2
hardware/hall-sensor-pcb/Hall sensor breakout PCB, gerbers, BOMFig. 13
hardware/cad/Printable parts — see hardware/cad/README.md§6.3
figures/Figures from the report—

Notebooks

NotebookWhat it does
01_hall_sensor_count.ipynbWhy three Hall sensors is the right number, from the Pico ADC's ~8.8 effective bits
02_cavity_dimensions.ipynbSizing the 99% volume cavity against piston radius, magnet length, sensor count
03_magnetic_field_model.ipynbmagpylib field modeling of the cylindrical magnet
04_bench_adc_logs.ipynbBench captures from data/bench-2025-04/
05_pressure_test_analysis.ipynbThe main analysis: magnetostatic fit, ADC → position lookup, pressure and depth results

Reproducing the analysis

pip install -r analysis/requirements.txt
jupyter lab analysis/

Notebooks read data by relative path and expect to run from analysis/. Run them in numeric order; 05 is self-contained and reproduces the report's §7 figures.

Building the firmware

Requires the Pico SDK (developed against 2.1.0) and the ARM GNU toolchain:

cmake -S firmware -B build
cmake --build build

Flash build/pot_test.uf2 by holding BOOTSEL while connecting the Pico. See firmware/README.md for pinout.

Printing the mechanical parts

All four printed components from the report's bill of materials are in hardware/cad/stl/: sensor package, magnetic piston, sensor spacer, and PVC adapter — 36.35 g of filament, $2.07 total. Printed in polycarbonate (Polymaker Polymax Tough PC) on a Prusa MINI+ or Bambu Lab X1C, with a brim, supports on the package, and ~3% over-extrusion for watertightness.

water_reservoir.stl is also included, but note that it is a printable redesign of the 99% volume cavity, not the part that was tested — the tested cavity was assembled from PVC fittings. It has not been pressure tested.

Bill of materials

Roughly $60 all in, over half of which is PVC plumbing:

CategoryCost
Electronics (Pico, 3× DRV5055, capacitors)$7.90
4 × 12 mm N48 magnet$0.10
Acrylic tube, O-rings$5.99
PVC fittings$30.54
PC filament (36.35 g)$2.07
3M Scotchcast 4N epoxy resinby volume

Full tables are in Appendix 10.1 of the report.

Known limitations

  • Uncalibrated error runs −20% to 70%. The response is highly linear above 20 bar — successive 20 bar steps produce a consistent 9.5–11.5 bar of estimated change — so a simple linear-interpolation calibration should address most of this. That routine has not been built.
  • A discontinuity between 0 and 20 bar, most likely trapped air in the cavity.
  • The pressure log stops at 160 bar because of a bug in the acquisition GUI, even though sensor 2 survived to 230 bar. The missing rows are a data-collection artifact.
  • Mounting was not addressed, and RS-232 is met only as UART-level compatibility.
  • Refilling the cavity moves the piston, since screwing the bottom fitting back in displaces volume. The piston has to be pushed deeper before sealing.

Licence

Released under CERN-OHL-W-2.0 (CERN Open Hardware Licence Version 2, Weakly Reciprocal), with two exceptions:

  • docs/Masters_Thesis.pdf is the author's academic report and is not covered by that licence.
  • docs/whoi-lab-notebook-2025-04-25.html, and the acquisition GUI extracted from it as tools/serial_logger_gui.py, are © Jonathan Pfeifer, Woods Hole Oceanographic Institution, reproduced with permission. They are not relicensed.

Acknowledgments

Dr. V. Hunter Adams and Jonathan Pfeifer, for mentorship that turned this from an idea into a sensor that works and can be deployed. Justin Ossolinski, WHOI building operations director, for time and facilities. The Cornell Maker Club and the MAE Drone Studio for 3D printers and materials.

Early research on the compressibility of liquids that led to this approach is written up here.

Comments

No comments yet. Be the first to ask about this board.

Ask about this board

Sign in to BoardRepo

New here? Signing in creates your account; there is no separate sign-up.