Skip to the content
4 layers73.6 × 59.8 mmLeak sensor v1, the printed circuit board in 3D

Leak sensor v1

lewipewi/leakwatch

A multi-channel leak sensor for equipment enclosures. Instead of reporting "wet / dry" like a normal leak probe, it measures how wet each enclosure is, on a separate channel per enclosure, and carries a second circuit…

Size
73.6 × 59.8 mm
Copper layers
4
Thickness
1.61 mm
Parts
90
Nets
89
Pads
315
Tracks, vias
587, 205
Pours
7
Routed
Yes
KiCad
KiCad 9.0 (file 20241229)
Created
3 Sep 2026
Updated
12 Oct 2026

Overview

Leak sensor v1 is an open-source printed circuit board by lewipewi, from the lewipewi/leakwatch repository on GitHub. It is a 4-layer board of 73.6 × 59.8 mm with 90 parts on 89 nets, routed with 587 tracks and 205 vias.

It is built around the RP2040, W25Q128JVSIQ and 74LVC1G14Z, with the AP2112K-3.3, CD4051BE and DMG3415U-7 among its other parts. Its parts include 28 capacitors, 27 resistors, 12 ICs, 7 connectors and 2 diodes. It belongs with the sensors and measurement boards and the RP2040 boards of this library.

Main components

11

README

README.md

leakwatch

A multi-channel leak sensor for equipment enclosures. Instead of reporting "wet / dry" like a normal leak probe, it measures how wet each enclosure is, on a separate channel per enclosure, and carries a second circuit that raises an alarm in hardware with no firmware involved.

Designed with the Blue Robotics BlueROV2 in mind — a Navigator flight controller, I²C, and JST-GH connectors. The circuit itself is generic and would suit any multi-enclosure system.

Design study. Almost 100 parts, five schematic sheets, four-layer board. Simulated and netlist-validated. Never built — see Open items.

3D View 3D View


Early note

This was my first mixed-signal PCB layout and my first time using LTspice. Both show.


The problem

Commercial leak probes are threshold devices — they answer wet or dry and nothing more. That limitation is physical, not a design shortcut:

You can't measure water with DC. Apply a steady voltage across two electrodes in water and ions pile up on each surface within milliseconds. The reading drifts, and the net DC current slowly dissolves the electrodes.

So you use AC. But no single frequency works.

text
   LOW frequency   →  the layer of ions on each electrode blocks you
   HIGH frequency  →  the probe cable's own capacitance shunts around
                      the water, and a dry probe reads as flooded
   usable window   →  a few hundred Hz to a few tens of kHz — and the
                      window MOVES depending on how wet the probe is

A second problem, which is why this board has three channels: systems with several enclosures commonly combine their leak sensors into a single alarm bit. You learn something is wet. You don't learn which thing.

A stock BlueROV2 has two watertight enclosures — a 4" electronics tube (the camera lives inside it) and a 3" battery tube — and operators often add a payload tube. ArduSub supports three leak detector instances, which is why this board has three channels. A flooded battery is a power loss and a lithium hazard; a flooded electronics tube is a lost vehicle. Right now both raise the same alarm.

It's also worth being clear about what already exists: every BlueROV2 ships with a hand vacuum pump, and pulling ~15 inHg and watching it for 10–15 minutes is a good pre-dive seal check. But the vacuum is released before the vehicle enters the water, so nothing monitors the seal during the dive. This board addresses the second gap, not the first.


How it works

Two independent paths.

text
   probe 1 ──┐
   probe 2 ──┼──► FRONT END ──────► MCU ────► I²C to the host
   probe 3 ──┘    mux, amplifier,   measures,
                  4 gain ranges     logs, reports

   probe 4 ─────► BACKSTOP ─────────────────► alarm line
                  oscillator, peak            (no firmware
                  detector, comparator         in the path)

The front end

Excitation. A microcontroller pin swings 0–3.3 V at 10 Hz, 1 kHz or 20 kHz. A 100 Ω resistor softens the edges so the trace doesn't radiate across the board. A 10 µF capacitor in series guarantees zero average current through the water — a capacitor physically cannot pass DC, so the electrodes can't corrode.

Probe interface. Three connectors, one per enclosure. Every wire leaving the board gets a TVS clamp for static protection and a 100 Ω series resistor.

Calibration channels. Three of the multiplexer's inputs go to on-board resistors instead of probes — 100 Ω, 1 kΩ and 1 MΩ. Measuring a known resistor with the same circuit tells you what the circuit itself contributes, so you can subtract it. These are the reason the numbers mean anything.

Multiplexer. An 8:1 switch selects one probe or one calibration reference at a time. This is what preserves per-enclosure identity.

Transimpedance amplifier. The important part. A naive measurement — sense resistor to ground — lets the probe cable steal the signal, because the measuring point moves and the cable charges and discharges following it.

The amplifier instead holds that point perfectly still, pushing back exactly hard enough to keep it from moving. A node that never moves can't charge the cable, so the cable steals nothing. The amount of push-back is the measurement.

In simulation this moved the highest usable frequency from about 1 kHz to about 100 kHz — roughly 100×, and it's what makes the three-frequency scheme possible at all.

Four gain ranges. A flooded probe and a dry probe differ by about 10,000:1. No single amplifier setting reads both, so there are four and firmware picks the one that keeps the reading on scale.

VMID. The board has 0 V and 3.3 V and no negative rail, but the signal needs to swing both ways. So the circuit redefines zero as 1.65 V — a resistor divider buffered by an op-amp. Everything is referenced to that.

The backstop

A completely separate circuit sharing only the ground plane and the 5 V rail.

text
  Schmitt oscillator ──► DC block ──► probe ──► divider ──► peak detector ──► comparator
      ~4.5 kHz                                   3.3 kΩ                        TLV3011

A Schmitt-trigger inverter with one resistor and one capacitor oscillates at about 4.5 kHz whenever it has power — no clock, no configuration, nothing to program. A divider turns "how wet" into a voltage, a diode and capacitor turn AC into DC, and a comparator with hysteresis trips at about 2.3 kΩ of probe resistance.

It runs from 5 V, upstream of the 3.3 V regulator. If that regulator fails, the microcontroller dies but the backstop keeps working and can still assert the alarm.

The microcontroller can watch the alarm line to log it. It can't override it.


Board

Layers4 (signal / ground / power / signal), 1.6 mm
Size75.0 × 65.0 mm
JLC04161H-7628 Stackup

The board was routed using KiCad, and the files can be viewed in /pcb. v1 was made under sleep deprivation. v2 is a more thoughtfully routed board, taking into account proper rule zones, more carefully arranged components, and stricter adherence to the seperation between digital and analog zones.


Open items

This has never been built or tested. The full list is in DESIGN.md; the ones that matter most:

ItemStatus
Never fabricatedThe largest caveat
Amplifier compensation on the two high gain rangesOne fixed feedback capacitor can't serve four decades of gain. Needs one per range. Found reviewing my own work; not fixed
A broken probe wire reads as "dry"Nothing distinguishes dry from disconnected. Fix identified — a 10 MΩ across the electrodes at the probe end makes "open" detectable — not implemented
Anti-alias filter vs. ADC sample rateThe corner frequency was never chosen against an actual sample rate
Electrode material and geometryUnspecified, and it's what sets the values the whole frequency analysis rests on
Interference from nearby motor drivesNot analysed

Repository

text
  /schematics     KiCad schematics, 5 sheets, plus PDFs
  /pcb            KiCad layout, 4 layers, renders
  /sim            LTspice files for the front end and backstop
  DESIGN.md       full design document, every decision and why

References, and where the numbers came from

I've tried to be exact about which values are sourced and which are assumptions. Several are assumptions.

Electrochemistry

QuantityValue usedSource
Equivalent circuit modelRandles cell (solution resistance in series with a parallel double-layer capacitance and charge-transfer resistance)Randles, J.E.B., Kinetics of rapid electrode reactions, Discussions of the Faraday Society, vol. 1, 1947. Modern summary: Gamry, Basics of EIS
Double-layer capacitance0.5 µF per electrodeDerived, not measured. Gamry gives 20–60 µF/cm² for a metal–electrolyte interface. 0.5 µF therefore implies roughly 1 mm² of wetted electrode area. A realistic probe with larger pads would have a considerably higher Cdl, which shifts the low-frequency limit — see Open items
Charge-transfer resistance100 kΩOrder-of-magnitude placeholder. Not sourced. It depends on electrode material, surface condition and water chemistry, none of which are specified in this design

Cable

QuantityValue usedSource
Probe cable capacitance200 pFEstimate. TI, A Practical Guide to Cable Selection (SNLA164) cites 12–16 pF/ft (≈39–52 pF/m) mutual capacitance for low-capacitance twisted pair. 200 pF corresponds to roughly a 4 m run, or less for ordinary PVC-insulated pairs. Assumption, not a measurement of a specific cable

How this was made

This project was a way to further my experience with ECAD, as well as learn how analog design decisions get made.

The schematic capture and the PCB layout work are mine, and that's where most of the hours went.

The design decisions were largely not mine, and I feel that I should be honest about that. I worked through this with Claude (Anthropic), which proposed the architecture - the three-tone excitation scheme, the transimpedance front end, the switched gain ranges, the calibration channels, and the backstop - recommended the component families (verified by me), wrote the LTspice exercises I learned to simulate from, and wrote this documentation.

I haven't taken the advanced analog electronics sequence yet, but I feel that this was a good start into analog design. It wasn't my most refined project, and I do think I could have owned more of the design itself, but it definitely motivated me to independently explore analog electronics further.

Also thank you to Altium Academy, whose mixed-signal layout videos were very helpful, and to the KiCad project, whose libraries saved me a lot of effort importing components.

Parts

90
QtyValueFootprintReferences
13100nFCapacitor_SMD:C_0402_1005MetricC2, C5, C7, C9, C10, C16, C18, C22, C23, C24, C26, C27, C28
8100Resistor_SMD:R_0603_1608MetricR2, R3, R8, R9, R10, R11, R12, R18
61uFCapacitor_SMD:C_0603_1608MetricC3, C11, C14, C15, C17, C19
6PESD5V0S1BADiode_SMD:D_SOD-523CR1, CR2, CR3, CR4, CR5, CR6
5Conn_01x02_PinConnector_JST:JST_GH_BM02B-GHS-TBT_1x02-1MP_P1.25mm_VerticalJ1, J2, J3, J4, J5
310kResistor_SMD:R_0603_1608MetricR20, R21, R29
2100kResistor_SMD:R_0603_1608MetricR16, R22
210uFCapacitor_SMD:C_0805_2012MetricC6, C13
215pFCapacitor_SMD:C_0402_1005MetricC20, C21
21MResistor_SMD:R_0603_1608MetricR5, R13
21kResistor_SMD:R_0603_1608MetricR14, R19
24.7kResistor_SMD:R_0402_1005MetricR27, R28
247kResistor_SMD:R_0603_1608MetricR1, R7
2BAT54WPackage_TO_SOT_SMD:SOT-323_SC-70D1, D2
10.1FCapacitor_THT:CP_Radial_D8.0mm_P3.50mmC25
1100nFCapacitor_SMD:C_0805_2012MetricC4
110kResistor_SMD:R_0402_1005MetricR25
112MHzCrystal:Crystal_SMD_3225-4Pin_3.2x2.5mmY1
11kResistor_SMD:R_0402_1005MetricR24
11nFCapacitor_SMD:C_0603_1608MetricC12
12.2MResistor_SMD:R_0603_1608MetricR6
12.2pFCapacitor_SMD:C_0402_1005MetricC8
13.3kResistor_SMD:R_0603_1608MetricR4
132.768 kHzCrystal:Crystal_SMD_3215-2Pin_3.2x1.5mmY2
13MResistor_SMD:R_0603_1608MetricR15
13kResistor_SMD:R_0603_1608MetricR17
14.7nFCapacitor_SMD:C_0603_1608MetricC1
1600R @ 100MHzInductor_SMD:L_0603_1608MetricFB1
174LVC1G14Package_TO_SOT_SMD:SOT-353_SC-70-5U2
1AP2112K-3.3Package_TO_SOT_SMD:SOT-23-5U7
1CD4051BPackage_SO:SOIC-16_3.9x9.9mm_P1.27mmU4
1Conn_01x03_PinConnector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ6
1Conn_01x04_PinConnector_JST:JST_GH_BM04B-GHS-TBT_1x04-1MP_P1.25mm_VerticalJ7
1DMG3415U-7Package_TO_SOT_SMD:SOT-23U1
1MB85RC64Package_SO:SOIC-8_3.9x4.9mm_P1.27mmU11
1OPA2333xxDPackage_SO:MSOP-8_3x3mm_P0.65mmU5
1PCF8563TPackage_SO:SOIC-8_3.9x4.9mm_P1.27mmU12
1RP2040Package_DFN_QFN:QFN-56-1EP_7x7mm_P0.4mm_EP3.2x3.2mmU8
1SHT45Sensor_Humidity:Sensirion_DFN-4_1.5x1.5mm_P0.8mm_SHT4x_NoCentralPadU10
1SW_MEC_5GButton_Switch_SMD:SW_SPST_TL3342SW2
1TLV3011AIDBVTPackage_TO_SOT_SMD:SOT-23-6U3
1TMUX1104DGSRPackage_SO:VSSOP-10_3x3mm_P0.5mmU6
1W25Q128JVSIQPackage_SO:SOIC-8_5.3x5.3mm_P1.27mmU9

The 86 most common of 90 parts.

Similar boards

  • 4 layers76 × 50 mmWigglecam, the printed circuit board in 3D

    Wigglecam

    jadenrhee/wigglecam-controller

    RP2040 co-processor board for a 4-lens wigglegram camera: constant-current flash, controls, battery telemetry, Pi 5 I2C interface. 4-layer, DRC-clean, fab-ready.

    105 parts
  • 2 layers51.2 × 124.2 mmVersion current, the printed circuit board in 3D

    Version current

    oomlout/oomlout_oomp_project_src

    106 parts
  • 4 layers80 × 99 mmSpool, the printed circuit board in 3D

    Spool

    TheCacophonyProject/spool-pcb

    161 partsCERN-OHL-W-2.0
  • 6 layers73 × 75.5 mmTc2-main pcb, the printed circuit board in 3D

    Tc2-main pcb

    TheCacophonyProject/thermal-camera-v2

    tc2-panel.py uses KiKit to build the manufacturing panel from the individual board files.

    219 partsCERN-OHL-W-2.0
  • 4 layers130.5 × 88 mmTrap panelized, the printed circuit board in 3D

    Trap panelized

    TheCacophonyProject/trap-pcbs

    502 partsGPL-3.0
  • 2 layers170 × 73 mmIGNRocketOrderFile, the printed circuit board in 3D

    IGNRocketOrderFile

    wasa-rockoon/WOBC

    WASAロケットプロジェクト 共通電装基盤

    240 parts1MIT
  • 2 layers77.5 × 107.9 mmPowerBoard, the printed circuit board in 3D

    PowerBoard

    AUV-IITK/electrical-systems

    64 parts4

Questions

How big is the Leak sensor v1 PCB?

It measures 73.6 × 59.8 mm and has 4 copper layers, 1.61 mm thick.

What parts does the Leak sensor v1 use?

90 parts, built around the RP2040, W25Q128JVSIQ, 74LVC1G14Z and AP2112K-3.3. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Leak sensor v1 KiCad files?

From the lewipewi/leakwatch repository on GitHub, at the commit this page was made from: the board is pcb/leak_sensor_v1.kicad_pcb and its schematic schematics/backstop.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Leak sensor v1 design in my own project?

Its repository states no licence, so its author keeps all rights: ask lewipewi before reusing the design.