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 10MΩ 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
GND (Pin 6) · 풀다운용10MΩ 풀다운 리턴 · 센서 선 아님
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 10MΩ pull-down between Pin 11 ↔ GND.
Power Sensor power 3.3V 3V3 Pin 1 Sensor VCC supply. (Spare 3V3 = Pin 17)
Ground 풀다운 GND (센서 선 아님) GND Pin 6 10MΩ 풀다운(GPIO17↔GND) 리턴용. 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 리크 프로브 2선(2전극) 전극 A 전극 B 물 닿으면 도통 ① 전극 A → 3V3 · Pin 1 ② 전극 B → GPIO17 · Pin 11 GND · Pin 6 (풀다운용) 10MΩ 풀다운 (보드 부품·센서 선 아님) 내부 풀 OFF · USE_INTERNAL_PULL=False (PUD_OFF) 건조 → GPIO17=LOW(0) · 누수(물 도통) → GPIO17=HIGH(1) · ACTIVE_LOW=False
센서는 2선(2전극). 전극 A는 3V3(Pin 1), 전극 B는 GPIO17(Pin 11)에 연결한다. Pin 6 GND는 센서 선이 아니라 GPIO17↔GND 사이 10MΩ 풀다운 저항용이다. 건조 시 프로브가 초고임피던스(거의 개방)라 풀다운이 GPIO17을 LOW로 잡고, 물이 두 전극을 이으면 3.3V가 ~1.5MΩ를 통해 전극 B 선을 끌어올려 GPIO17이 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 10MΩ 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 10MΩ 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 10MΩ 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.

7Camera Lighting (Always-On)

White LED module — always on, no switching, no code

Power a small white LED module directly from the Pi so the leak-check camera has light. VCC → 5V (Pin 2), GND → GND (Pin 6). It stays lit continuously — there is no GPIO control, no switching, and no software. The module is low-power, so continuous operation produces negligible heat (harmless to leave on).

Wiring

LED module VCC → 5V (Pin 2), GND → GND (Pin 6). No signal pin — it is a bare power connection, always on.

No conflict with sensors

Uses only 5V/GND power rails — it does not touch GPIO17 (leak), the I2C pins (SHT30), or the UART pins (PMS7003 on GPIO15). All can coexist.

NoIR camera + white light → pink tint

A NoIR camera (no IR-cut filter) under white LED light renders the image with a pink/magenta tint. This does not hinder leak identification (a wet patch is still clearly visible). If you need natural color, use a standard camera with a built-in IR-cut filter instead of the NoIR module.

8통합 노드 배선 (누수 + 온습도 + 미세먼지 + 카메라 + 조명)

Pi-A (id 1) / Pi-C (id 3) are combined nodes carrying all five loads on one Pi: leak sensor + SHT30 (온습도) + PMS7003 (미세먼지) + camera + always-on light. The three standalone sensor sheets each independently claim Pin 1 / Pin 2 / Pin 6, which physically collide on a shared board. This single table is the de-conflicted master; wire the combined node from here, not from the per-sensor sections above.

★ De-conflict · KEY FIX

GND is common, but you cannot stack 4 wires on Pin 6

Every device shares the same ground, but the Pi 4 exposes 8 separate GND pins (6 · 9 · 14 · 20 · 25 · 30 · 34 · 39). Spread the four grounds across them, one per device. Likewise there are two 3V3 pins (1, 17) and two 5V pins (2, 4): give the leak sensor Pin 1 and the SHT30 the second 3V3 (Pin 17); give the PMS7003 Pin 2 and the LED the second 5V (Pin 4). Never double up two wires on a single rail pin.

DeviceLineBCM / RailPhysical PinNotes
누수 Leak
e-con 5C-08
Signal Sensor signal GPIO17 Pin 11 External 10MΩ pull-down Pin 11 ↔ GND (required). Internal pull OFF (PUD_OFF).
Power VCC 3.3V 3V3 Pin 1 First 3V3 rail.
Ground GND GND Pin 20 10MΩ 풀다운 리턴 GND(센서 선 아님). 고임피던스 라인이라 짧고 견고하게. (alt: Pin 25)
온습도 SHT30
I2C · 3.3V ONLY
I2C SDA GPIO2 Pin 3 I2C data (SDA1).
I2C SCL GPIO3 Pin 5 I2C clock (SCL1).
Power VCC 3.3V 3V3 Pin 17 SECOND 3V3, NOT Pin 1. 3.3V only, never 5V (5V damages the SHT30).
Ground GND GND Pin 9 I2C ground (adjacent to Pin 3 / 5).
미세먼지 PMS7003
UART
UART PMS TXD → Pi RXD GPIO15 Pin 10 PMS transmit into the Pi; the data line that must be present.
UART Pi TXD → PMS RXD (opt) GPIO14 Pin 8 Optional: only for sleep/wake commands. Passive read does not need it.
Power VCC 5V 5V Pin 2 PMS7003 runs on 5V (its UART logic is 3.3V-safe for the Pi).
Ground GND GND Pin 6 UART ground.
카메라 Camera CSI Ribbon n/a CSI (separate) Not on the 40-pin header. 15-pin CSI ribbon into the camera connector (see §5).
조명 LED
always-on
Power VCC 5V 5V Pin 4 SECOND 5V, NOT Pin 2. Must be an LED module with an integrated resistor, or add a ~150–330Ω series resistor (a bare LED on 5V burns out).
Ground GND GND Pin 14 Always lit: no GPIO, no switching, no code.
Combined-node master pinout. Header pins used: 1 · 2 · 3 · 4 · 5 · 6 · 8 · 9 · 10 · 11 · 14 · 17 · 20 (+ CSI ribbon). Four grounds spread over Pin 6 / 9 / 14 / 20, never stacked on one pin.

Boot configuration (Bookworm · idempotent via install.sh)

I2C · SHT30

dtparam=i2c_arm=on in /boot/firmware/config.txt. Verify with i2cdetect -y 1 (SHT30 at 0x44 / 0x45).

UART · PMS7003

enable_uart=1 in config.txt, and remove console=serial0,115200 from /boot/firmware/cmdline.txt so the login console does not fight the sensor.

Camera

camera_auto_detect=1 in config.txt. Verify with rpicam-hello --list-cameras.

Leak GPIO17 · unaffected

Enabling UART / disabling the serial console does not affect the GPIO17 leak read or the camera. GPIO17 is a plain input, independent of the serial peripheral.

One reboot applies everything

All three install.sh scripts set these idempotently (I2C · UART + cmdline · camera). Run them, then a single reboot applies I2C, UART, and the camera together (no per-sensor reboot needed).

Power supply

Use a genuine 5.1V / 3A USB-C PSU

Combined draw of all five loads is ~1.4–1.8A typical, ~2.2A worst-case, so the official 5.1V / 3A supply has ample headroom. Avoid phone chargers and unpowered USB hubs: sag below ~4.8V triggers a brown-out → CPU throttle and SD-card corruption. Check health with vcgencmd get_throttled (expect 0x0; any non-zero indicates under-voltage).