헤드리스 Pi 콘솔/journalctl에서 한글이 깨져 보이는 문제로, Pi 번들(02/03/04)에 들어가는 모든 소스의 사람-대상 텍스트를 영어로 전환. 코드·식별자·설정키·경로·숫자·hex·서명 스킴·f-string 플레이스홀더는 불변. - raspberry_pi4/, raspberry_pi4_sht30/: 로그·주석·문서·센서명·위치 영어화 - tools/make_deploy_bundles.py: 생성 템플릿(config_local.py/setup.sh/SETUP.md/PI_META 위치) 영어화 - tools/harden_pi.sh, tools/set_network.sh: echo/주석 영어화 - WIRING.html: 영어화 + SHT30 전압 경고 정정 반영 - 서버 번들(01, php/)은 한글 유지(브라우저 대시보드, Pi에서 안 깨짐) - 전 파이썬/셸 문법검사 통과, JSON 본문 서명 무영향
414 lines
34 KiB
HTML
414 lines
34 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||
<title>Leak Detection Node · Wiring & Pinmap (Raspberry Pi 4)</title>
|
||
<style>
|
||
:root{
|
||
--bg:#eef1f5; --card:#ffffff; --ink:#212529; --muted:#6b7280; --line:#e5e8ec;
|
||
--sig:#2f9e44; --sig-d:#2b8a3e; --pwr:#e03131; --pwr-d:#c92a2a;
|
||
--gnd:#1971c2; --gnd-d:#1864ab; --exp:#e8590c; --exp-b:#ffa94d;
|
||
--sans:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Malgun Gothic","Apple SD Gothic Neo","Noto Sans KR",sans-serif;
|
||
--mono:"SFMono-Regular",Consolas,"Liberation Mono",Menlo,monospace;
|
||
}
|
||
*{box-sizing:border-box}
|
||
html,body{margin:0}
|
||
body{font-family:var(--sans);background:var(--bg);color:var(--ink);line-height:1.6;
|
||
-webkit-font-smoothing:antialiased;padding:24px 16px 60px}
|
||
.wrap{max-width:1000px;margin:0 auto}
|
||
svg text{font-family:var(--sans)}
|
||
|
||
/* Header */
|
||
.hero{background:linear-gradient(135deg,#0b2545 0%,#134074 55%,#1971c2 100%);
|
||
color:#fff;border-radius:16px;padding:26px 28px;box-shadow:0 8px 24px rgba(11,37,69,.18)}
|
||
.hero .eyebrow{font-size:12px;letter-spacing:.14em;text-transform:uppercase;color:#a5c4e6;font-weight:700;margin:0 0 6px}
|
||
.hero h1{margin:0 0 10px;font-size:26px;line-height:1.25;font-weight:800}
|
||
.hero p{margin:0 0 16px;font-size:15px;color:#dbe7f5;max-width:70ch}
|
||
.chips{display:flex;flex-wrap:wrap;gap:8px}
|
||
.chip{background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.25);color:#fff;
|
||
border-radius:999px;padding:5px 12px;font-size:12.5px;font-weight:600;white-space:nowrap}
|
||
.chip.mono{font-family:var(--mono);letter-spacing:.02em}
|
||
|
||
/* Section cards */
|
||
section{background:var(--card);border:1px solid var(--line);border-radius:14px;
|
||
padding:22px 24px;margin-top:20px;box-shadow:0 2px 8px rgba(16,24,40,.05)}
|
||
h2{display:flex;align-items:center;gap:12px;margin:0 0 18px;font-size:19px;font-weight:800}
|
||
h2 .num{flex:none;width:30px;height:30px;border-radius:9px;background:#134074;color:#fff;
|
||
font-size:15px;display:flex;align-items:center;justify-content:center;font-weight:800}
|
||
h3{margin:22px 0 10px;font-size:15px;font-weight:700;color:#134074}
|
||
|
||
/* Pinmap block */
|
||
.pinwrap{display:grid;grid-template-columns:minmax(260px,1.15fr) 1fr;gap:24px;align-items:start}
|
||
.diagram{background:#fbfcfd;border:1px solid var(--line);border-radius:12px;padding:14px}
|
||
.legend{display:flex;flex-direction:column;gap:11px}
|
||
.legend .lg{display:flex;align-items:flex-start;gap:11px;font-size:13.5px}
|
||
.sw{flex:none;width:22px;height:22px;border-radius:6px;margin-top:1px}
|
||
.sw.sig{background:var(--sig);border:2px solid var(--sig-d)}
|
||
.sw.pwr{background:var(--pwr);border:2px solid var(--pwr-d)}
|
||
.sw.gnd{background:var(--gnd);border:2px solid var(--gnd-d)}
|
||
.sw.alt{background:#e7f5ff;border:2px dashed #4dabf7}
|
||
.sw.exp{background:#fff4e6;border:2px dashed var(--exp-b)}
|
||
.sw.off{background:#e9ecef;border:2px solid #ced4da}
|
||
.lg b{display:block;font-weight:700}
|
||
.lg span{color:var(--muted);font-size:12.5px}
|
||
.hint{margin-top:6px;font-size:12.5px;color:var(--muted);background:#f8f9fb;border:1px dashed #d5dbe3;
|
||
border-radius:8px;padding:9px 11px}
|
||
|
||
/* Table */
|
||
table{width:100%;border-collapse:collapse;font-size:14px}
|
||
caption{caption-side:bottom;text-align:left;color:var(--muted);font-size:12.5px;padding-top:10px}
|
||
th,td{padding:11px 12px;text-align:left;border-bottom:1px solid var(--line);vertical-align:top}
|
||
thead th{background:#f3f6fa;color:#134074;font-weight:700;font-size:13px;border-bottom:2px solid #d6e0ec}
|
||
td.mono,th.mono{font-family:var(--mono);white-space:nowrap}
|
||
.tag{display:inline-block;font-size:11px;font-weight:700;padding:2px 8px;border-radius:999px;line-height:1.7}
|
||
.tag.sig{background:#e7f6ec;color:var(--sig-d)}
|
||
.tag.pwr{background:#fdecec;color:var(--pwr-d)}
|
||
.tag.gnd{background:#e7f1fb;color:var(--gnd-d)}
|
||
.tag.exp{background:#fff1e3;color:var(--exp)}
|
||
tr.exprow td{background:#fffaf3}
|
||
|
||
/* Electrical notes */
|
||
.notes{display:grid;grid-template-columns:1fr 1fr;gap:14px}
|
||
.note{border:1px solid var(--line);border-left:4px solid #1971c2;border-radius:10px;padding:13px 15px;background:#fbfcfd}
|
||
.note h4{margin:0 0 4px;font-size:14px}
|
||
.note p{margin:0;font-size:13.5px;color:#374151}
|
||
.note code,.inline-code{font-family:var(--mono);background:#eef2f7;padding:1px 6px;border-radius:5px;font-size:12.5px}
|
||
.crit{grid-column:1 / -1;border:2px solid var(--pwr);border-left-width:6px;background:#fff5f5;border-radius:10px;padding:15px 18px}
|
||
.crit .badge{display:inline-block;background:var(--pwr);color:#fff;font-weight:800;font-size:12px;
|
||
padding:3px 11px;border-radius:6px;letter-spacing:.04em;margin-bottom:8px}
|
||
.crit h4{margin:0 0 6px;font-size:16px;color:var(--pwr-d)}
|
||
.crit p{margin:0;font-size:14px;color:#5c1a1a}
|
||
.cam{margin-top:16px;border:1px solid var(--line);border-left:4px solid #7048e8;border-radius:10px;
|
||
padding:13px 16px;background:#fbfaff}
|
||
.cam h4{margin:0 0 6px;font-size:14px;color:#5f3dc4}
|
||
.cam p{margin:0;font-size:13.5px;color:#374151}
|
||
|
||
/* Checklist */
|
||
ol.check{counter-reset:c;list-style:none;margin:0;padding:0}
|
||
ol.check li{position:relative;padding:12px 14px 12px 80px;border-bottom:1px solid #f1f3f5;
|
||
line-height:1.5;font-size:14px}
|
||
ol.check li:last-child{border-bottom:none}
|
||
ol.check li::before{counter-increment:c;content:counter(c);position:absolute;left:12px;top:11px;
|
||
width:26px;height:26px;border-radius:50%;background:#e7f1fb;color:#1971c2;font-weight:800;
|
||
font-size:13px;display:flex;align-items:center;justify-content:center}
|
||
ol.check li::after{content:"";position:absolute;left:50px;top:13px;width:18px;height:18px;
|
||
border:2px solid #adb5bd;border-radius:4px}
|
||
ol.check li.key{background:#fff8f8}
|
||
ol.check li b{color:var(--pwr-d)}
|
||
|
||
@media (max-width:720px){
|
||
.pinwrap{grid-template-columns:1fr}
|
||
.notes{grid-template-columns:1fr}
|
||
.hero h1{font-size:22px}
|
||
}
|
||
|
||
@media print{
|
||
:root{--bg:#fff}
|
||
body{background:#fff;color:#000;padding:0;font-size:12px}
|
||
.wrap{max-width:100%}
|
||
.hero{background:#fff!important;color:#000;border:2px solid #134074;box-shadow:none}
|
||
.hero .eyebrow{color:#134074}.hero p{color:#333}
|
||
.chip{background:#fff;border:1px solid #999;color:#000}
|
||
section{box-shadow:none;border:1px solid #999;page-break-inside:avoid;break-inside:avoid}
|
||
h2 .num{background:#134074!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}
|
||
svg{max-width:100%!important;height:auto}
|
||
table,tr,td,th,.note,.crit,.cam,ol.check li{page-break-inside:avoid;break-inside:avoid}
|
||
*{-webkit-print-color-adjust:exact;print-color-adjust:exact}
|
||
.diagram,.note,.crit,.cam{background:#fff}
|
||
}
|
||
</style>
|
||
</head>
|
||
<body>
|
||
<div class="wrap">
|
||
|
||
<!-- 1) HEADER -->
|
||
<header class="hero">
|
||
<p class="eyebrow">Field Wiring & Pinmap · Leak Detection Node</p>
|
||
<h1>Leak Detection Node · Wiring & Pinmap</h1>
|
||
<p>Standard wiring diagram for connecting the e-con 5C-08 resistive leak sensor to <b>GPIO17 (physical pin 11)</b>.
|
||
Pi-A (sensor_id=1 · Site 1 · Server Room) and Pi-C (sensor_id=3 · Site 3 · New) are <b>common nodes</b> with identical wiring.</p>
|
||
<div class="chips">
|
||
<span class="chip">Raspberry Pi 4 Model B</span>
|
||
<span class="chip mono">BCM2711</span>
|
||
<span class="chip">Raspberry Pi OS Bookworm 64-bit</span>
|
||
<span class="chip">e-con 5C-08 · Resistive ~1.5MΩ</span>
|
||
<span class="chip mono">GPIO17 / Pin 11</span>
|
||
<span class="chip">External 4.7MΩ pull-down required</span>
|
||
</div>
|
||
</header>
|
||
|
||
<!-- 2) 40-pin header pinmap diagram -->
|
||
<section>
|
||
<h2><span class="num">2</span>40-Pin Header Pinmap Diagram</h2>
|
||
<div class="pinwrap">
|
||
<div class="diagram">
|
||
<svg viewBox="0 0 600 681" role="img" aria-label="Raspberry Pi 4 40-pin GPIO header pinmap" xmlns="http://www.w3.org/2000/svg" style="width:100%;height:auto;max-width:600px;">
|
||
<rect x="70" y="69" width="460" height="31" fill="#f6f8fa"/>
|
||
<rect x="70" y="131" width="460" height="31" fill="#f6f8fa"/>
|
||
<rect x="70" y="193" width="460" height="31" fill="#f6f8fa"/>
|
||
<rect x="70" y="255" width="460" height="31" fill="#f6f8fa"/>
|
||
<rect x="70" y="317" width="460" height="31" fill="#f6f8fa"/>
|
||
<rect x="70" y="379" width="460" height="31" fill="#f6f8fa"/>
|
||
<rect x="70" y="441" width="460" height="31" fill="#f6f8fa"/>
|
||
<rect x="70" y="503" width="460" height="31" fill="#f6f8fa"/>
|
||
<rect x="70" y="565" width="460" height="31" fill="#f6f8fa"/>
|
||
<rect x="70" y="627" width="460" height="31" fill="#f6f8fa"/>
|
||
<rect x="234" y="30" width="112" height="633" rx="10" fill="#f1f3f5" stroke="#adb5bd" stroke-width="1.5"/>
|
||
<rect x="236" y="36" width="32" height="32" rx="6" fill="none" stroke="#e03131" stroke-width="1.5" stroke-dasharray="3 2"/>
|
||
<text x="252" y="22" text-anchor="middle" font-size="10" fill="#868e96">Odd pins</text>
|
||
<text x="330" y="22" text-anchor="middle" font-size="10" fill="#868e96">Even pins</text>
|
||
<text x="220" y="56" text-anchor="end" font-family="Consolas,monospace" font-size="12" font-weight="700" fill="#7d1616">3V3</text>
|
||
<text x="360" y="56" text-anchor="start" font-family="Consolas,monospace" font-size="12" font-weight="400" fill="#adb5bd">5V</text>
|
||
<circle cx="252" cy="52" r="12" fill="#e03131" stroke="#c92a2a" stroke-width="1.5"/><text x="252" y="55.5" text-anchor="middle" font-family="Consolas,monospace" font-size="10" font-weight="700" fill="#ffffff">1</text>
|
||
<circle cx="330" cy="52" r="12" fill="#e9ecef" stroke="#ced4da" stroke-width="1.5"/><text x="330" y="55.5" text-anchor="middle" font-family="Consolas,monospace" font-size="10" font-weight="700" fill="#868e96">2</text>
|
||
<text x="220" y="87" text-anchor="end" font-family="Consolas,monospace" font-size="12" font-weight="400" fill="#adb5bd">GPIO2 (SDA1)</text>
|
||
<text x="360" y="87" text-anchor="start" font-family="Consolas,monospace" font-size="12" font-weight="400" fill="#adb5bd">5V</text>
|
||
<circle cx="252" cy="83" r="12" fill="#e9ecef" stroke="#ced4da" stroke-width="1.5"/><text x="252" y="86.5" text-anchor="middle" font-family="Consolas,monospace" font-size="10" font-weight="700" fill="#868e96">3</text>
|
||
<circle cx="330" cy="83" r="12" fill="#e9ecef" stroke="#ced4da" stroke-width="1.5"/><text x="330" y="86.5" text-anchor="middle" font-family="Consolas,monospace" font-size="10" font-weight="700" fill="#868e96">4</text>
|
||
<text x="220" y="118" text-anchor="end" font-family="Consolas,monospace" font-size="12" font-weight="400" fill="#adb5bd">GPIO3 (SCL1)</text>
|
||
<text x="360" y="118" text-anchor="start" font-family="Consolas,monospace" font-size="12" font-weight="700" fill="#123a63">GND</text>
|
||
<circle cx="252" cy="114" r="12" fill="#e9ecef" stroke="#ced4da" stroke-width="1.5"/><text x="252" y="117.5" text-anchor="middle" font-family="Consolas,monospace" font-size="10" font-weight="700" fill="#868e96">5</text>
|
||
<circle cx="330" cy="114" r="12" fill="#1971c2" stroke="#1864ab" stroke-width="1.5"/><text x="330" y="117.5" text-anchor="middle" font-family="Consolas,monospace" font-size="10" font-weight="700" fill="#ffffff">6</text>
|
||
<text x="220" y="149" text-anchor="end" font-family="Consolas,monospace" font-size="12" font-weight="400" fill="#adb5bd">GPIO4</text>
|
||
<text x="360" y="149" text-anchor="start" font-family="Consolas,monospace" font-size="12" font-weight="400" fill="#adb5bd">GPIO14 (TXD)</text>
|
||
<circle cx="252" cy="145" r="12" fill="#e9ecef" stroke="#ced4da" stroke-width="1.5"/><text x="252" y="148.5" text-anchor="middle" font-family="Consolas,monospace" font-size="10" font-weight="700" fill="#868e96">7</text>
|
||
<circle cx="330" cy="145" r="12" fill="#e9ecef" stroke="#ced4da" stroke-width="1.5"/><text x="330" y="148.5" text-anchor="middle" font-family="Consolas,monospace" font-size="10" font-weight="700" fill="#868e96">8</text>
|
||
<text x="220" y="180" text-anchor="end" font-family="Consolas,monospace" font-size="12" font-weight="600" fill="#1971c2">GND</text>
|
||
<text x="360" y="180" text-anchor="start" font-family="Consolas,monospace" font-size="12" font-weight="400" fill="#adb5bd">GPIO15 (RXD)</text>
|
||
<circle cx="252" cy="176" r="12" fill="#e7f5ff" stroke="#4dabf7" stroke-width="1.5" stroke-dasharray="3 2"/><text x="252" y="179.5" text-anchor="middle" font-family="Consolas,monospace" font-size="10" font-weight="700" fill="#1971c2">9</text>
|
||
<circle cx="330" cy="176" r="12" fill="#e9ecef" stroke="#ced4da" stroke-width="1.5"/><text x="330" y="179.5" text-anchor="middle" font-family="Consolas,monospace" font-size="10" font-weight="700" fill="#868e96">10</text>
|
||
<text x="220" y="211" text-anchor="end" font-family="Consolas,monospace" font-size="12" font-weight="700" fill="#1b4332">GPIO17</text>
|
||
<text x="360" y="211" text-anchor="start" font-family="Consolas,monospace" font-size="12" font-weight="400" fill="#adb5bd">GPIO18</text>
|
||
<circle cx="252" cy="207" r="12" fill="#2f9e44" stroke="#2b8a3e" stroke-width="1.5"/><text x="252" y="210.5" text-anchor="middle" font-family="Consolas,monospace" font-size="10" font-weight="700" fill="#ffffff">11</text>
|
||
<circle cx="330" cy="207" r="12" fill="#e9ecef" stroke="#ced4da" stroke-width="1.5"/><text x="330" y="210.5" text-anchor="middle" font-family="Consolas,monospace" font-size="10" font-weight="700" fill="#868e96">12</text>
|
||
<text x="220" y="242" text-anchor="end" font-family="Consolas,monospace" font-size="12" font-weight="600" fill="#e8590c">GPIO27</text>
|
||
<text x="360" y="242" text-anchor="start" font-family="Consolas,monospace" font-size="12" font-weight="600" fill="#1971c2">GND</text>
|
||
<circle cx="252" cy="238" r="12" fill="#fff4e6" stroke="#ffa94d" stroke-width="1.5" stroke-dasharray="3 2"/><text x="252" y="241.5" text-anchor="middle" font-family="Consolas,monospace" font-size="10" font-weight="700" fill="#e8590c">13</text>
|
||
<circle cx="330" cy="238" r="12" fill="#e7f5ff" stroke="#4dabf7" stroke-width="1.5" stroke-dasharray="3 2"/><text x="330" y="241.5" text-anchor="middle" font-family="Consolas,monospace" font-size="10" font-weight="700" fill="#1971c2">14</text>
|
||
<text x="220" y="273" text-anchor="end" font-family="Consolas,monospace" font-size="12" font-weight="600" fill="#e8590c">GPIO22</text>
|
||
<text x="360" y="273" text-anchor="start" font-family="Consolas,monospace" font-size="12" font-weight="400" fill="#adb5bd">GPIO23</text>
|
||
<circle cx="252" cy="269" r="12" fill="#fff4e6" stroke="#ffa94d" stroke-width="1.5" stroke-dasharray="3 2"/><text x="252" y="272.5" text-anchor="middle" font-family="Consolas,monospace" font-size="10" font-weight="700" fill="#e8590c">15</text>
|
||
<circle cx="330" cy="269" r="12" fill="#e9ecef" stroke="#ced4da" stroke-width="1.5"/><text x="330" y="272.5" text-anchor="middle" font-family="Consolas,monospace" font-size="10" font-weight="700" fill="#868e96">16</text>
|
||
<text x="220" y="304" text-anchor="end" font-family="Consolas,monospace" font-size="12" font-weight="400" fill="#adb5bd">3V3</text>
|
||
<text x="360" y="304" text-anchor="start" font-family="Consolas,monospace" font-size="12" font-weight="400" fill="#adb5bd">GPIO24</text>
|
||
<circle cx="252" cy="300" r="12" fill="#e9ecef" stroke="#ced4da" stroke-width="1.5"/><text x="252" y="303.5" text-anchor="middle" font-family="Consolas,monospace" font-size="10" font-weight="700" fill="#868e96">17</text>
|
||
<circle cx="330" cy="300" r="12" fill="#e9ecef" stroke="#ced4da" stroke-width="1.5"/><text x="330" y="303.5" text-anchor="middle" font-family="Consolas,monospace" font-size="10" font-weight="700" fill="#868e96">18</text>
|
||
<text x="220" y="335" text-anchor="end" font-family="Consolas,monospace" font-size="12" font-weight="400" fill="#adb5bd">GPIO10 (MOSI)</text>
|
||
<text x="360" y="335" text-anchor="start" font-family="Consolas,monospace" font-size="12" font-weight="600" fill="#1971c2">GND</text>
|
||
<circle cx="252" cy="331" r="12" fill="#e9ecef" stroke="#ced4da" stroke-width="1.5"/><text x="252" y="334.5" text-anchor="middle" font-family="Consolas,monospace" font-size="10" font-weight="700" fill="#868e96">19</text>
|
||
<circle cx="330" cy="331" r="12" fill="#e7f5ff" stroke="#4dabf7" stroke-width="1.5" stroke-dasharray="3 2"/><text x="330" y="334.5" text-anchor="middle" font-family="Consolas,monospace" font-size="10" font-weight="700" fill="#1971c2">20</text>
|
||
<text x="220" y="366" text-anchor="end" font-family="Consolas,monospace" font-size="12" font-weight="400" fill="#adb5bd">GPIO9 (MISO)</text>
|
||
<text x="360" y="366" text-anchor="start" font-family="Consolas,monospace" font-size="12" font-weight="400" fill="#adb5bd">GPIO25</text>
|
||
<circle cx="252" cy="362" r="12" fill="#e9ecef" stroke="#ced4da" stroke-width="1.5"/><text x="252" y="365.5" text-anchor="middle" font-family="Consolas,monospace" font-size="10" font-weight="700" fill="#868e96">21</text>
|
||
<circle cx="330" cy="362" r="12" fill="#e9ecef" stroke="#ced4da" stroke-width="1.5"/><text x="330" y="365.5" text-anchor="middle" font-family="Consolas,monospace" font-size="10" font-weight="700" fill="#868e96">22</text>
|
||
<text x="220" y="397" text-anchor="end" font-family="Consolas,monospace" font-size="12" font-weight="400" fill="#adb5bd">GPIO11 (SCLK)</text>
|
||
<text x="360" y="397" text-anchor="start" font-family="Consolas,monospace" font-size="12" font-weight="400" fill="#adb5bd">GPIO8 (CE0)</text>
|
||
<circle cx="252" cy="393" r="12" fill="#e9ecef" stroke="#ced4da" stroke-width="1.5"/><text x="252" y="396.5" text-anchor="middle" font-family="Consolas,monospace" font-size="10" font-weight="700" fill="#868e96">23</text>
|
||
<circle cx="330" cy="393" r="12" fill="#e9ecef" stroke="#ced4da" stroke-width="1.5"/><text x="330" y="396.5" text-anchor="middle" font-family="Consolas,monospace" font-size="10" font-weight="700" fill="#868e96">24</text>
|
||
<text x="220" y="428" text-anchor="end" font-family="Consolas,monospace" font-size="12" font-weight="600" fill="#1971c2">GND</text>
|
||
<text x="360" y="428" text-anchor="start" font-family="Consolas,monospace" font-size="12" font-weight="400" fill="#adb5bd">GPIO7 (CE1)</text>
|
||
<circle cx="252" cy="424" r="12" fill="#e7f5ff" stroke="#4dabf7" stroke-width="1.5" stroke-dasharray="3 2"/><text x="252" y="427.5" text-anchor="middle" font-family="Consolas,monospace" font-size="10" font-weight="700" fill="#1971c2">25</text>
|
||
<circle cx="330" cy="424" r="12" fill="#e9ecef" stroke="#ced4da" stroke-width="1.5"/><text x="330" y="427.5" text-anchor="middle" font-family="Consolas,monospace" font-size="10" font-weight="700" fill="#868e96">26</text>
|
||
<text x="220" y="459" text-anchor="end" font-family="Consolas,monospace" font-size="12" font-weight="400" fill="#adb5bd">GPIO0 (ID_SD)</text>
|
||
<text x="360" y="459" text-anchor="start" font-family="Consolas,monospace" font-size="12" font-weight="400" fill="#adb5bd">GPIO1 (ID_SC)</text>
|
||
<circle cx="252" cy="455" r="12" fill="#e9ecef" stroke="#ced4da" stroke-width="1.5"/><text x="252" y="458.5" text-anchor="middle" font-family="Consolas,monospace" font-size="10" font-weight="700" fill="#868e96">27</text>
|
||
<circle cx="330" cy="455" r="12" fill="#e9ecef" stroke="#ced4da" stroke-width="1.5"/><text x="330" y="458.5" text-anchor="middle" font-family="Consolas,monospace" font-size="10" font-weight="700" fill="#868e96">28</text>
|
||
<text x="220" y="490" text-anchor="end" font-family="Consolas,monospace" font-size="12" font-weight="400" fill="#adb5bd">GPIO5</text>
|
||
<text x="360" y="490" text-anchor="start" font-family="Consolas,monospace" font-size="12" font-weight="600" fill="#1971c2">GND</text>
|
||
<circle cx="252" cy="486" r="12" fill="#e9ecef" stroke="#ced4da" stroke-width="1.5"/><text x="252" y="489.5" text-anchor="middle" font-family="Consolas,monospace" font-size="10" font-weight="700" fill="#868e96">29</text>
|
||
<circle cx="330" cy="486" r="12" fill="#e7f5ff" stroke="#4dabf7" stroke-width="1.5" stroke-dasharray="3 2"/><text x="330" y="489.5" text-anchor="middle" font-family="Consolas,monospace" font-size="10" font-weight="700" fill="#1971c2">30</text>
|
||
<text x="220" y="521" text-anchor="end" font-family="Consolas,monospace" font-size="12" font-weight="400" fill="#adb5bd">GPIO6</text>
|
||
<text x="360" y="521" text-anchor="start" font-family="Consolas,monospace" font-size="12" font-weight="400" fill="#adb5bd">GPIO12</text>
|
||
<circle cx="252" cy="517" r="12" fill="#e9ecef" stroke="#ced4da" stroke-width="1.5"/><text x="252" y="520.5" text-anchor="middle" font-family="Consolas,monospace" font-size="10" font-weight="700" fill="#868e96">31</text>
|
||
<circle cx="330" cy="517" r="12" fill="#e9ecef" stroke="#ced4da" stroke-width="1.5"/><text x="330" y="520.5" text-anchor="middle" font-family="Consolas,monospace" font-size="10" font-weight="700" fill="#868e96">32</text>
|
||
<text x="220" y="552" text-anchor="end" font-family="Consolas,monospace" font-size="12" font-weight="400" fill="#adb5bd">GPIO13</text>
|
||
<text x="360" y="552" text-anchor="start" font-family="Consolas,monospace" font-size="12" font-weight="600" fill="#1971c2">GND</text>
|
||
<circle cx="252" cy="548" r="12" fill="#e9ecef" stroke="#ced4da" stroke-width="1.5"/><text x="252" y="551.5" text-anchor="middle" font-family="Consolas,monospace" font-size="10" font-weight="700" fill="#868e96">33</text>
|
||
<circle cx="330" cy="548" r="12" fill="#e7f5ff" stroke="#4dabf7" stroke-width="1.5" stroke-dasharray="3 2"/><text x="330" y="551.5" text-anchor="middle" font-family="Consolas,monospace" font-size="10" font-weight="700" fill="#1971c2">34</text>
|
||
<text x="220" y="583" text-anchor="end" font-family="Consolas,monospace" font-size="12" font-weight="400" fill="#adb5bd">GPIO19</text>
|
||
<text x="360" y="583" text-anchor="start" font-family="Consolas,monospace" font-size="12" font-weight="400" fill="#adb5bd">GPIO16</text>
|
||
<circle cx="252" cy="579" r="12" fill="#e9ecef" stroke="#ced4da" stroke-width="1.5"/><text x="252" y="582.5" text-anchor="middle" font-family="Consolas,monospace" font-size="10" font-weight="700" fill="#868e96">35</text>
|
||
<circle cx="330" cy="579" r="12" fill="#e9ecef" stroke="#ced4da" stroke-width="1.5"/><text x="330" y="582.5" text-anchor="middle" font-family="Consolas,monospace" font-size="10" font-weight="700" fill="#868e96">36</text>
|
||
<text x="220" y="614" text-anchor="end" font-family="Consolas,monospace" font-size="12" font-weight="400" fill="#adb5bd">GPIO26</text>
|
||
<text x="360" y="614" text-anchor="start" font-family="Consolas,monospace" font-size="12" font-weight="400" fill="#adb5bd">GPIO20</text>
|
||
<circle cx="252" cy="610" r="12" fill="#e9ecef" stroke="#ced4da" stroke-width="1.5"/><text x="252" y="613.5" text-anchor="middle" font-family="Consolas,monospace" font-size="10" font-weight="700" fill="#868e96">37</text>
|
||
<circle cx="330" cy="610" r="12" fill="#e9ecef" stroke="#ced4da" stroke-width="1.5"/><text x="330" y="613.5" text-anchor="middle" font-family="Consolas,monospace" font-size="10" font-weight="700" fill="#868e96">38</text>
|
||
<text x="220" y="645" text-anchor="end" font-family="Consolas,monospace" font-size="12" font-weight="600" fill="#1971c2">GND</text>
|
||
<text x="360" y="645" text-anchor="start" font-family="Consolas,monospace" font-size="12" font-weight="400" fill="#adb5bd">GPIO21</text>
|
||
<circle cx="252" cy="641" r="12" fill="#e7f5ff" stroke="#4dabf7" stroke-width="1.5" stroke-dasharray="3 2"/><text x="252" y="644.5" text-anchor="middle" font-family="Consolas,monospace" font-size="10" font-weight="700" fill="#1971c2">39</text>
|
||
<circle cx="330" cy="641" r="12" fill="#e9ecef" stroke="#ced4da" stroke-width="1.5"/><text x="330" y="644.5" text-anchor="middle" font-family="Consolas,monospace" font-size="10" font-weight="700" fill="#868e96">40</text>
|
||
</svg>
|
||
</div>
|
||
<div class="legend">
|
||
<div class="lg"><span class="sw sig"></span><b>Signal (GPIO17 · Pin 11)<span>Sensor signal line input</span></b></div>
|
||
<div class="lg"><span class="sw pwr"></span><b>Power 3V3 (Pin 1)<span>Sensor power supply</span></b></div>
|
||
<div class="lg"><span class="sw gnd"></span><b>Ground GND (Pin 6 · used)<span>Default sensor GND connection</span></b></div>
|
||
<div class="lg"><span class="sw alt"></span><b>Ground alternatives<span>Pin 9 / 14 / 20 / 25 / 30 / 34 / 39</span></b></div>
|
||
<div class="lg"><span class="sw exp"></span><b>Expansion example (optional)<span>GPIO27·Pin 13, GPIO22·Pin 15</span></b></div>
|
||
<div class="lg"><span class="sw off"></span><b>Unused pins<span>Not connected on this node</span></b></div>
|
||
<div class="hint">The red dashed square marks the <b>Pin 1</b> position. Always verify the header orientation (relative to Pin 1) before wiring. Only three pins are actually used: <b>1 · 6 · 11</b>.</div>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
|
||
<!-- 3) Pinmap table -->
|
||
<section>
|
||
<h2><span class="num">3</span>Pinmap Table</h2>
|
||
<table>
|
||
<thead>
|
||
<tr><th>Signal</th><th class="mono">BCM</th><th class="mono">Physical Pin</th><th>Notes</th></tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td><span class="tag sig">Signal</span> Sensor signal line</td>
|
||
<td class="mono">GPIO17</td>
|
||
<td class="mono">Pin 11</td>
|
||
<td>Sensor signal input. Connect an external 4.7MΩ pull-down between <b>Pin 11 ↔ GND</b>.</td>
|
||
</tr>
|
||
<tr>
|
||
<td><span class="tag pwr">Power</span> Sensor power 3.3V</td>
|
||
<td class="mono">3V3</td>
|
||
<td class="mono">Pin 1</td>
|
||
<td>Sensor VCC supply. (Spare 3V3 = Pin 17)</td>
|
||
</tr>
|
||
<tr>
|
||
<td><span class="tag gnd">Ground</span> Sensor GND</td>
|
||
<td class="mono">GND</td>
|
||
<td class="mono">Pin 6</td>
|
||
<td>Alternatives: any GND among Pin 9 / 14 / 20 / 25 / 30 / 34 / 39.</td>
|
||
</tr>
|
||
<tr class="exprow">
|
||
<td><span class="tag exp">Expansion</span> Additional sensor example</td>
|
||
<td class="mono">GPIO27</td>
|
||
<td class="mono">Pin 13</td>
|
||
<td>Optional. Add by BCM number to SENSORS in <span class="inline-code">config.py</span>.</td>
|
||
</tr>
|
||
<tr class="exprow">
|
||
<td><span class="tag exp">Expansion</span> Additional sensor example</td>
|
||
<td class="mono">GPIO22</td>
|
||
<td class="mono">Pin 15</td>
|
||
<td>Optional. Add the same way as above (each channel needs its own external pull-down).</td>
|
||
</tr>
|
||
</tbody>
|
||
<caption>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 <span class="inline-code">config_local.py</span>.</caption>
|
||
</table>
|
||
</section>
|
||
|
||
<!-- 4) Wiring schematic -->
|
||
<section>
|
||
<h2><span class="num">4</span>Wiring Schematic</h2>
|
||
<div class="diagram">
|
||
<svg viewBox="0 0 640 400" role="img" aria-label="Leak sensor wiring schematic — 3V3·GPIO17·GND and external 4.7MΩ pull-down" xmlns="http://www.w3.org/2000/svg" style="width:100%;height:auto">
|
||
<!-- Pi header block -->
|
||
<rect x="36" y="70" width="150" height="250" rx="10" fill="#f1f3f5" stroke="#adb5bd" stroke-width="1.5"/>
|
||
<text x="111" y="60" text-anchor="middle" font-size="13" font-weight="700" fill="#212529">Raspberry Pi 4 · 40-pin header</text>
|
||
<!-- header pin rows -->
|
||
<circle cx="60" cy="120" r="5" fill="#e03131"/>
|
||
<text x="74" y="124" text-anchor="start" font-family="Consolas,monospace" font-size="12" fill="#212529">Pin 1 · 3V3</text>
|
||
<rect x="182" y="114" width="10" height="12" rx="2" fill="#e03131"/>
|
||
<circle cx="60" cy="195" r="5" fill="#2f9e44"/>
|
||
<text x="74" y="199" text-anchor="start" font-family="Consolas,monospace" font-size="12" fill="#212529">Pin 11 · GPIO17</text>
|
||
<rect x="182" y="189" width="10" height="12" rx="2" fill="#2f9e44"/>
|
||
<circle cx="60" cy="270" r="5" fill="#1971c2"/>
|
||
<text x="74" y="274" text-anchor="start" font-family="Consolas,monospace" font-size="12" fill="#212529">Pin 6 · GND</text>
|
||
<rect x="182" y="264" width="10" height="12" rx="2" fill="#1971c2"/>
|
||
<!-- sensor block -->
|
||
<rect x="470" y="95" width="150" height="190" rx="10" fill="#ffffff" stroke="#495057" stroke-width="1.5"/>
|
||
<text x="545" y="84" text-anchor="middle" font-size="13" font-weight="700" fill="#212529">e-con 5C-08 leak sensor</text>
|
||
<rect x="462" y="114" width="10" height="12" rx="2" fill="#e03131"/>
|
||
<text x="484" y="124" text-anchor="start" font-family="Consolas,monospace" font-size="12" fill="#212529">VCC 3.3V</text>
|
||
<rect x="462" y="189" width="10" height="12" rx="2" fill="#2f9e44"/>
|
||
<text x="484" y="199" text-anchor="start" font-family="Consolas,monospace" font-size="12" fill="#212529">SIG signal</text>
|
||
<rect x="462" y="264" width="10" height="12" rx="2" fill="#1971c2"/>
|
||
<text x="484" y="274" text-anchor="start" font-family="Consolas,monospace" font-size="12" fill="#212529">GND</text>
|
||
<!-- wires -->
|
||
<path d="M192,120 H462" stroke="#e03131" stroke-width="2.5" fill="none"/>
|
||
<path d="M192,195 H462" stroke="#2f9e44" stroke-width="2.5" fill="none"/>
|
||
<path d="M192,270 H462" stroke="#1971c2" stroke-width="2.5" fill="none"/>
|
||
<text x="327" y="111" text-anchor="middle" font-size="11" fill="#c92a2a">3.3V power · Pin 1</text>
|
||
<text x="250" y="186" text-anchor="middle" font-size="11" fill="#2b8a3e">Signal · GPIO17 · Pin 11</text>
|
||
<text x="250" y="261" text-anchor="middle" font-size="11" fill="#1864ab">GND · Pin 6</text>
|
||
<!-- external pulldown between SIG wire and GND wire -->
|
||
<circle cx="340" cy="195" r="4" fill="#2f9e44"/>
|
||
<circle cx="340" cy="270" r="4" fill="#1971c2"/>
|
||
<polyline points="340,199 340,206 330,210 350,218 330,226 350,234 330,242 340,246 340,266" fill="none" stroke="#343a40" stroke-width="2"/>
|
||
<text x="360" y="226" text-anchor="start" font-size="13" font-weight="700" fill="#343a40">4.7MΩ</text>
|
||
<text x="360" y="242" text-anchor="start" font-size="11" fill="#495057">External pull-down (required)</text>
|
||
<!-- internal pull off note -->
|
||
<rect x="60" y="300" width="330" height="26" rx="6" fill="#fff5f5" stroke="#ffa8a8" stroke-width="1.5" stroke-dasharray="4 3"/>
|
||
<text x="72" y="317" text-anchor="start" font-size="11" font-weight="700" fill="#c92a2a">Internal pull OFF · USE_INTERNAL_PULL=False (PUD_OFF)</text>
|
||
<!-- logic box -->
|
||
<rect x="60" y="350" width="520" height="30" rx="6" fill="#f1f3f5" stroke="#ced4da"/>
|
||
<text x="320" y="369" text-anchor="middle" font-size="11.5" fill="#343a40">Dry → GPIO=LOW(0) · Leak → GPIO=HIGH(1) · ACTIVE_LOW=False</text>
|
||
</svg>
|
||
</div>
|
||
<div class="hint">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 <b>LOW</b>. When a leak bridges the electrodes with water, 3.3V pulls the signal line up through ~1.5MΩ and GPIO17 switches to <b>HIGH</b>.</div>
|
||
</section>
|
||
|
||
<!-- 5) Electrical design · cautions -->
|
||
<section>
|
||
<h2><span class="num">5</span>Electrical Design · Cautions</h2>
|
||
|
||
<div class="crit">
|
||
<span class="badge">★ Critical Caution · CRITICAL</span>
|
||
<h4>Do not enable the internal pull-down</h4>
|
||
<p>If you enable the internal <b>50kΩ</b> pull-down, the ~1.5MΩ high-impedance sensor cannot pull the GPIO HIGH,
|
||
so <b>leaks will not be detected (detection failure)</b>. Always turn the internal pull off with <span class="inline-code">PUD_OFF</span>
|
||
and use <b>only the external 4.7MΩ pull-down</b>. (<span class="inline-code">USE_INTERNAL_PULL = False</span>)</p>
|
||
</div>
|
||
|
||
<div class="notes" style="margin-top:14px">
|
||
<div class="note">
|
||
<h4>Polarity · Logic Level</h4>
|
||
<p><span class="inline-code">ACTIVE_LOW = False</span> → when dry <b>GPIO=LOW(0)</b>, on leak <b>GPIO=HIGH(1)</b>.</p>
|
||
</div>
|
||
<div class="note">
|
||
<h4>External Pull-down (required)</h4>
|
||
<p>Connect a 4.7MΩ resistor between <b>GPIO17 (Pin 11) ↔ GND</b>. Essential for the high-impedance sensor.</p>
|
||
</div>
|
||
<div class="note">
|
||
<h4>Internal Pull Setting</h4>
|
||
<p><span class="inline-code">USE_INTERNAL_PULL = False</span> — keep the internal pull at <span class="inline-code">PUD_OFF</span>.</p>
|
||
</div>
|
||
<div class="note">
|
||
<h4>Debounce</h4>
|
||
<p><span class="inline-code">DEBOUNCE_MS = 500</span> — set generously given the high-impedance behavior.</p>
|
||
</div>
|
||
<div class="note" style="grid-column:1 / -1">
|
||
<h4>Configuration Files</h4>
|
||
<p>Electrical parameters live in <span class="inline-code">raspberry_pi4/config.py</span> (SENSORS · ACTIVE_LOW · USE_INTERNAL_PULL · DEBOUNCE_MS).
|
||
Per-device <b>sensor_id / location</b> is in <span class="inline-code">config_local.py</span>
|
||
(Pi-A = id 1 · Site 1 · Server Room / Pi-C = id 3 · Site 3 · New).</p>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="cam">
|
||
<h4>Camera (optional · CAMERA_ENABLED=True)</h4>
|
||
<p>The Raspberry Pi 4 uses a <b>15-pin (1.0mm pitch) standard CSI connector</b>. The Zero 2 W uses 22-pin (0.5mm),
|
||
so its ribbon and camera board are <b>incompatible</b> → you need a <b>15-pin ribbon</b> for the Pi 4 or a <b>15↔22 conversion adapter</b>.
|
||
Capture with <span class="inline-code">rpicam-still</span> (Bookworm) / <span class="inline-code">libcamera-still</span> (Bullseye), <b>640×480 JPEG</b>.</p>
|
||
</div>
|
||
</section>
|
||
|
||
<!-- 6) Installation checklist -->
|
||
<section>
|
||
<h2><span class="num">6</span>Installation Checklist</h2>
|
||
<ol class="check">
|
||
<li>Start wiring with the Raspberry Pi power <b>fully disconnected</b>.</li>
|
||
<li>Verify the header orientation (Pin 1 position). Red dashed marker = Pin 1.</li>
|
||
<li>Connect the sensor signal line to <b>Pin 11 (GPIO17)</b>.</li>
|
||
<li>Connect sensor power (3.3V) to <b>Pin 1 (3V3)</b> and sensor GND to <b>Pin 6 (GND)</b>.</li>
|
||
<li class="key">Connect an external <b>4.7MΩ pull-down</b> between <b>Pin 11 ↔ GND</b>. <b>(Required · omitting it causes detection failure)</b></li>
|
||
<li class="key">Confirm the internal pull is off — <span class="inline-code">USE_INTERNAL_PULL=False</span> (PUD_OFF). <b>Never use the internal pull-down.</b></li>
|
||
<li>Check <span class="inline-code">config.py</span>: <span class="inline-code">ACTIVE_LOW=False</span>, <span class="inline-code">DEBOUNCE_MS=500</span>, GPIO17 registered in SENSORS.</li>
|
||
<li>Set the per-device <b>sensor_id / location</b> in <span class="inline-code">config_local.py</span> (Pi-A=1/Server Room, Pi-C=3/New).</li>
|
||
<li>After powering on, confirm via the log that GPIO17 = <b>LOW(0)</b> in the <b>dry state</b>.</li>
|
||
<li>Wet the sensor with water (or a damp cloth) and confirm GPIO17 switches to <b>HIGH(1)</b> and a leak event is logged.</li>
|
||
<li>(Optional) When using the camera, verify the ribbon orientation and connector spec (15-pin / adapter) and run a 640×480 capture test.</li>
|
||
</ol>
|
||
</section>
|
||
|
||
</div>
|
||
</body>
|
||
</html>
|