Field Wiring & Pinmap · Leak Detection Node

Leak Detection Node · Wiring & Pinmap

Standard wiring diagram for connecting the e-con 5C-08 resistive leak sensor to GPIO17 (physical pin 11). Pi-A (sensor_id=1 · Site 1 · Server Room) and Pi-C (sensor_id=3 · Site 3 · New) are common nodes with identical wiring.

Raspberry Pi 4 Model B BCM2711 Raspberry Pi OS Bookworm 64-bit e-con 5C-08 · Resistive ~1.5MΩ GPIO17 / Pin 11 External 4.7MΩ pull-down required

240-Pin Header Pinmap Diagram

Odd pins Even pins 3V3 5V 1 2 GPIO2 (SDA1) 5V 3 4 GPIO3 (SCL1) GND 5 6 GPIO4 GPIO14 (TXD) 7 8 GND GPIO15 (RXD) 9 10 GPIO17 GPIO18 11 12 GPIO27 GND 13 14 GPIO22 GPIO23 15 16 3V3 GPIO24 17 18 GPIO10 (MOSI) GND 19 20 GPIO9 (MISO) GPIO25 21 22 GPIO11 (SCLK) GPIO8 (CE0) 23 24 GND GPIO7 (CE1) 25 26 GPIO0 (ID_SD) GPIO1 (ID_SC) 27 28 GPIO5 GND 29 30 GPIO6 GPIO12 31 32 GPIO13 GND 33 34 GPIO19 GPIO16 35 36 GPIO26 GPIO20 37 38 GND GPIO21 39 40
Signal (GPIO17 · Pin 11)Sensor signal line input
Power 3V3 (Pin 1)Sensor power supply
Ground GND (Pin 6 · used)Default sensor GND connection
Ground alternativesPin 9 / 14 / 20 / 25 / 30 / 34 / 39
Expansion example (optional)GPIO27·Pin 13, GPIO22·Pin 15
Unused pinsNot connected on this node
The red dashed square marks the Pin 1 position. Always verify the header orientation (relative to Pin 1) before wiring. Only three pins are actually used: 1 · 6 · 11.

3Pinmap Table

SignalBCMPhysical PinNotes
Signal Sensor signal line GPIO17 Pin 11 Sensor signal input. Connect an external 4.7MΩ pull-down between Pin 11 ↔ GND.
Power Sensor power 3.3V 3V3 Pin 1 Sensor VCC supply. (Spare 3V3 = Pin 17)
Ground Sensor GND GND Pin 6 Alternatives: any GND among Pin 9 / 14 / 20 / 25 / 30 / 34 / 39.
Expansion Additional sensor example GPIO27 Pin 13 Optional. Add by BCM number to SENSORS in config.py.
Expansion Additional sensor example GPIO22 Pin 15 Optional. Add the same way as above (each channel needs its own external pull-down).
Three pins used (Pin 1 · 6 · 11). The expansion rows are reference examples for multi-sensor setups. Per-device sensor_id / location is set in config_local.py.

4Wiring Schematic

Raspberry Pi 4 · 40-pin header Pin 1 · 3V3 Pin 11 · GPIO17 Pin 6 · GND e-con 5C-08 leak sensor VCC 3.3V SIG signal GND 3.3V power · Pin 1 Signal · GPIO17 · Pin 11 GND · Pin 6 4.7MΩ External pull-down (required) Internal pull OFF · USE_INTERNAL_PULL=False (PUD_OFF) Dry → GPIO=LOW(0) · Leak → GPIO=HIGH(1) · ACTIVE_LOW=False
How it works: when dry, the sensor sits in an ultra-high-impedance (nearly open) state, so the external 4.7MΩ pull-down holds GPIO17 LOW. When a leak bridges the electrodes with water, 3.3V pulls the signal line up through ~1.5MΩ and GPIO17 switches to HIGH.

5Electrical Design · Cautions

★ Critical Caution · CRITICAL

Do not enable the internal pull-down

If you enable the internal 50kΩ pull-down, the ~1.5MΩ high-impedance sensor cannot pull the GPIO HIGH, so leaks will not be detected (detection failure). Always turn the internal pull off with PUD_OFF and use only the external 4.7MΩ pull-down. (USE_INTERNAL_PULL = False)

Polarity · Logic Level

ACTIVE_LOW = False → when dry GPIO=LOW(0), on leak GPIO=HIGH(1).

External Pull-down (required)

Connect a 4.7MΩ resistor between GPIO17 (Pin 11) ↔ GND. Essential for the high-impedance sensor.

Internal Pull Setting

USE_INTERNAL_PULL = False — keep the internal pull at PUD_OFF.

Debounce

DEBOUNCE_MS = 500 — set generously given the high-impedance behavior.

Configuration Files

Electrical parameters live in raspberry_pi4/config.py (SENSORS · ACTIVE_LOW · USE_INTERNAL_PULL · DEBOUNCE_MS). Per-device sensor_id / location is in config_local.py (Pi-A = id 1 · Site 1 · Server Room / Pi-C = id 3 · Site 3 · New).

Camera (optional · CAMERA_ENABLED=True)

The Raspberry Pi 4 uses a 15-pin (1.0mm pitch) standard CSI connector. The Zero 2 W uses 22-pin (0.5mm), so its ribbon and camera board are incompatible → you need a 15-pin ribbon for the Pi 4 or a 15↔22 conversion adapter. Capture with rpicam-still (Bookworm) / libcamera-still (Bullseye), 640×480 JPEG.

6Installation Checklist

  1. Start wiring with the Raspberry Pi power fully disconnected.
  2. Verify the header orientation (Pin 1 position). Red dashed marker = Pin 1.
  3. Connect the sensor signal line to Pin 11 (GPIO17).
  4. Connect sensor power (3.3V) to Pin 1 (3V3) and sensor GND to Pin 6 (GND).
  5. Connect an external 4.7MΩ pull-down between Pin 11 ↔ GND. (Required · omitting it causes detection failure)
  6. Confirm the internal pull is off — USE_INTERNAL_PULL=False (PUD_OFF). Never use the internal pull-down.
  7. Check config.py: ACTIVE_LOW=False, DEBOUNCE_MS=500, GPIO17 registered in SENSORS.
  8. Set the per-device sensor_id / location in config_local.py (Pi-A=1/Server Room, Pi-C=3/New).
  9. After powering on, confirm via the log that GPIO17 = LOW(0) in the dry state.
  10. Wet the sensor with water (or a damp cloth) and confirm GPIO17 switches to HIGH(1) and a leak event is logged.
  11. (Optional) When using the camera, verify the ribbon orientation and connector spec (15-pin / adapter) and run a 640×480 capture test.