Field Wiring & Pinmap · Leak Detection Node
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.
| Signal | BCM | Physical Pin | Notes |
|---|---|---|---|
| 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 9 | 10MΩ 풀다운(GPIO17↔GND) 리턴용. Alternatives: any GND among Pin 6 / 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). |
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)
ACTIVE_LOW = False → when dry GPIO=LOW(0), on leak GPIO=HIGH(1).
Connect a 10MΩ resistor between GPIO17 (Pin 11) ↔ GND. Essential for the high-impedance sensor.
USE_INTERNAL_PULL = False — keep the internal pull at PUD_OFF.
DEBOUNCE_MS = 500 — set generously given the high-impedance behavior.
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).
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.
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).
LED module VCC → 5V (Pin 2), GND → GND (Pin 6). No signal pin — it is a bare power connection, always on.
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.
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.
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.
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.
| Device | Line | BCM / Rail | Physical Pin | Notes |
|---|---|---|---|---|
| 누수 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. |
dtparam=i2c_arm=on in /boot/firmware/config.txt. Verify with i2cdetect -y 1 (SHT30 at 0x44 / 0x45).
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_auto_detect=1 in config.txt. Verify with rpicam-hello --list-cameras.
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.
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).
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).