depth_sensor
PublicLoading…
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
| Parameter | Specification | Achieved |
|---|---|---|
| Maximum depth | 2,000 m | 2,300 m |
| Pressure rating | 200 bar | 230 bar |
| Accuracy | ±10 m | −20% to 70% error, uncalibrated |
| Power input | 5–24 V, ≤100 mA | 5 V, 80 mA |
| Data protocol | RS-232 | UART (RS-232 compatible) |
| Physical size | Soda can to Nalgene | Nalgene bottle |
| Connector | MacArtney SubConn | MacArtney SubConn |
| Mounting | Hose clamps, bolts | Not addressed |
Two prototypes were built and pressure-tested to destruction at WHOI:
| Max pressure | Equivalent depth | Change | |
|---|---|---|---|
| Sensor 1 | 120 bar | 1.2 km | Stock Pico W, potted at atmospheric pressure |
| Sensor 2 | 230 bar | 2.3 km | Wireless 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
| Path | Contents | Report 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, BOM | Fig. 13 |
hardware/cad/ | Printable parts — see hardware/cad/README.md | §6.3 |
figures/ | Figures from the report | — |
Notebooks
| Notebook | What it does |
|---|---|
01_hall_sensor_count.ipynb | Why three Hall sensors is the right number, from the Pico ADC's ~8.8 effective bits |
02_cavity_dimensions.ipynb | Sizing the 99% volume cavity against piston radius, magnet length, sensor count |
03_magnetic_field_model.ipynb | magpylib field modeling of the cylindrical magnet |
04_bench_adc_logs.ipynb | Bench captures from data/bench-2025-04/ |
05_pressure_test_analysis.ipynb | The 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:
| Category | Cost |
|---|---|
| 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 resin | by 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.pdfis 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 astools/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.
No comments yet. Be the first to ask about this board.