feat(deploy): 센서별 배선도·핀맵 HTML + 번들 생성기 반영
- raspberry_pi4/WIRING.html, raspberry_pi4_sht30/WIRING.html 추가: 자체 완결형(인라인 CSS/SVG, 외부참조 0 → 폐쇄망 오프라인 열람) 40핀 핀맵 도해 + 핀맵 표 + 배선 스키매틱 + 전기설계 경고 + 설치 체크리스트. 인쇄 대응. 누수 노드(Pi-A/Pi-C 공통, GPIO17)·SHT30 노드(I2C1, 0x44) 각 1장. - make_deploy_bundles.py: TEXT_EXTS 에 .html 추가(번들 복사 시 CRLF→LF 정규화), Pi SETUP.md 에 WIRING.html 안내 줄 추가. copy_tree 가 각 Pi 번들에 자동 포함. (동반: 기존 dotfile .htaccess/.gitignore LF 정규화 반영.)
This commit is contained in:
parent
59d952953d
commit
96c5205f61
3 changed files with 979 additions and 3 deletions
414
raspberry_pi4/WIRING.html
Normal file
414
raspberry_pi4/WIRING.html
Normal file
|
|
@ -0,0 +1,414 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="ko">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<title>누수 감지 노드 · 배선 & 핀맵 (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 · 누수 감지 노드</p>
|
||||||
|
<h1>누수 감지 노드 · 배선 & 핀맵</h1>
|
||||||
|
<p>e-con 5C-08 저항형 누수감지센서를 <b>GPIO17(물리 핀 11)</b>에 연결하는 표준 배선도입니다.
|
||||||
|
Pi-A(sensor_id=1 · 1번 지점 · 서버실)와 Pi-C(sensor_id=3 · 3번 지점 · 신규)는 배선이 동일한 <b>공통 노드</b>입니다.</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 · 저항형 ~1.5MΩ</span>
|
||||||
|
<span class="chip mono">GPIO17 / 핀11</span>
|
||||||
|
<span class="chip">외부 4.7MΩ 풀다운 필수</span>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<!-- 2) 40핀 헤더 핀맵 도해 -->
|
||||||
|
<section>
|
||||||
|
<h2><span class="num">2</span>40핀 헤더 핀맵 도해</h2>
|
||||||
|
<div class="pinwrap">
|
||||||
|
<div class="diagram">
|
||||||
|
<svg viewBox="0 0 600 681" role="img" aria-label="Raspberry Pi 4 40핀 GPIO 헤더 핀맵" 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">홀수 핀</text>
|
||||||
|
<text x="330" y="22" text-anchor="middle" font-size="10" fill="#868e96">짝수 핀</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>신호 (GPIO17 · 핀 11)<span>센서 신호선 입력</span></b></div>
|
||||||
|
<div class="lg"><span class="sw pwr"></span><b>전원 3V3 (핀 1)<span>센서 전원 공급</span></b></div>
|
||||||
|
<div class="lg"><span class="sw gnd"></span><b>접지 GND (핀 6 · 사용)<span>센서 GND 기본 연결</span></b></div>
|
||||||
|
<div class="lg"><span class="sw alt"></span><b>접지 대체 가능<span>핀 9 / 14 / 20 / 25 / 30 / 34 / 39</span></b></div>
|
||||||
|
<div class="lg"><span class="sw exp"></span><b>확장 예시 (선택)<span>GPIO27·핀 13, GPIO22·핀 15</span></b></div>
|
||||||
|
<div class="lg"><span class="sw off"></span><b>미사용 핀<span>이 노드에서 연결하지 않음</span></b></div>
|
||||||
|
<div class="hint">붉은 점선 사각형이 <b>핀 1</b> 위치입니다. 헤더 방향(핀 1 기준)을 반드시 확인하고 배선하세요. 실제 사용 핀은 <b>1 · 6 · 11</b> 세 개뿐입니다.</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- 3) 핀맵 표 -->
|
||||||
|
<section>
|
||||||
|
<h2><span class="num">3</span>핀맵 표</h2>
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr><th>신호</th><th class="mono">BCM</th><th class="mono">물리 핀</th><th>비고</th></tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td><span class="tag sig">신호</span> 센서 신호선</td>
|
||||||
|
<td class="mono">GPIO17</td>
|
||||||
|
<td class="mono">핀 11</td>
|
||||||
|
<td>센서 신호 입력. 외부 4.7MΩ 풀다운을 <b>핀 11 ↔ GND</b> 사이에 연결.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><span class="tag pwr">전원</span> 센서 전원 3.3V</td>
|
||||||
|
<td class="mono">3V3</td>
|
||||||
|
<td class="mono">핀 1</td>
|
||||||
|
<td>센서 VCC 공급. (예비 3V3 = 핀 17)</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><span class="tag gnd">접지</span> 센서 GND</td>
|
||||||
|
<td class="mono">GND</td>
|
||||||
|
<td class="mono">핀 6</td>
|
||||||
|
<td>대체 가능: 핀 9 / 14 / 20 / 25 / 30 / 34 / 39 중 아무 GND.</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="exprow">
|
||||||
|
<td><span class="tag exp">확장</span> 추가 센서 예시</td>
|
||||||
|
<td class="mono">GPIO27</td>
|
||||||
|
<td class="mono">핀 13</td>
|
||||||
|
<td>선택. <span class="inline-code">config.py</span>의 SENSORS에 BCM 번호로 추가.</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="exprow">
|
||||||
|
<td><span class="tag exp">확장</span> 추가 센서 예시</td>
|
||||||
|
<td class="mono">GPIO22</td>
|
||||||
|
<td class="mono">핀 15</td>
|
||||||
|
<td>선택. 위와 동일한 방법으로 추가(각 채널마다 외부 풀다운 필요).</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
<caption>사용 핀은 3개(핀 1 · 6 · 11). 확장 행은 다중 센서 구성 시 참고용 예시입니다. 기기별 sensor_id / location은 <span class="inline-code">config_local.py</span>에서 설정.</caption>
|
||||||
|
</table>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- 4) 배선 스키매틱 -->
|
||||||
|
<section>
|
||||||
|
<h2><span class="num">4</span>배선 스키매틱</h2>
|
||||||
|
<div class="diagram">
|
||||||
|
<svg viewBox="0 0 640 400" role="img" aria-label="누수센서 배선 스키매틱 — 3V3·GPIO17·GND 및 외부 4.7MΩ 풀다운" 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핀 헤더</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">핀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">핀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">핀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 누수센서</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 신호</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 전원 · 핀1</text>
|
||||||
|
<text x="250" y="186" text-anchor="middle" font-size="11" fill="#2b8a3e">신호 · GPIO17 · 핀11</text>
|
||||||
|
<text x="250" y="261" text-anchor="middle" font-size="11" fill="#1864ab">GND · 핀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">외부 풀다운(필수)</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">내부 풀 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">건조 → GPIO=LOW(0) · 누수 → GPIO=HIGH(1) · ACTIVE_LOW=False</text>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
<div class="hint">동작 원리: 건조 시 센서는 초고임피던스(거의 개방) 상태라 외부 4.7MΩ 풀다운이 GPIO17을 <b>LOW</b>로 유지합니다. 누수로 물이 전극을 연결하면 3.3V가 ~1.5MΩ을 통해 신호선을 끌어올려 GPIO17이 <b>HIGH</b>로 전환됩니다.</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- 5) 전기 설계 · 주의 -->
|
||||||
|
<section>
|
||||||
|
<h2><span class="num">5</span>전기 설계 · 주의</h2>
|
||||||
|
|
||||||
|
<div class="crit">
|
||||||
|
<span class="badge">★ 절대 주의 · CRITICAL</span>
|
||||||
|
<h4>내부 풀다운을 켜지 마세요</h4>
|
||||||
|
<p>내부 <b>50kΩ</b> 풀다운을 활성화하면, ~1.5MΩ 고임피던스 센서가 GPIO를 HIGH로 끌어올리지 못해
|
||||||
|
<b>누수를 감지하지 못합니다(감지 실패)</b>. 반드시 내부 풀은 <span class="inline-code">PUD_OFF</span>로 끄고,
|
||||||
|
<b>외부 4.7MΩ 풀다운만</b> 사용하세요. (<span class="inline-code">USE_INTERNAL_PULL = False</span>)</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="notes" style="margin-top:14px">
|
||||||
|
<div class="note">
|
||||||
|
<h4>극성 · 로직 레벨</h4>
|
||||||
|
<p><span class="inline-code">ACTIVE_LOW = False</span> → 건조 시 <b>GPIO=LOW(0)</b>, 누수 시 <b>GPIO=HIGH(1)</b>.</p>
|
||||||
|
</div>
|
||||||
|
<div class="note">
|
||||||
|
<h4>외부 풀다운 (필수)</h4>
|
||||||
|
<p>4.7MΩ 저항을 <b>GPIO17(핀 11) ↔ GND</b> 사이에 연결. 고임피던스 센서용으로 반드시 필요.</p>
|
||||||
|
</div>
|
||||||
|
<div class="note">
|
||||||
|
<h4>내부 풀 설정</h4>
|
||||||
|
<p><span class="inline-code">USE_INTERNAL_PULL = False</span> — 내부 풀은 <span class="inline-code">PUD_OFF</span> 유지.</p>
|
||||||
|
</div>
|
||||||
|
<div class="note">
|
||||||
|
<h4>디바운스</h4>
|
||||||
|
<p><span class="inline-code">DEBOUNCE_MS = 500</span> — 고임피던스 특성상 넉넉하게 설정.</p>
|
||||||
|
</div>
|
||||||
|
<div class="note" style="grid-column:1 / -1">
|
||||||
|
<h4>설정 파일</h4>
|
||||||
|
<p>전기 파라미터는 <span class="inline-code">raspberry_pi4/config.py</span> (SENSORS · ACTIVE_LOW · USE_INTERNAL_PULL · DEBOUNCE_MS).
|
||||||
|
기기별 <b>sensor_id / location</b>은 <span class="inline-code">config_local.py</span>
|
||||||
|
(Pi-A = id 1 · 1번 지점 · 서버실 / Pi-C = id 3 · 3번 지점 · 신규).</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="cam">
|
||||||
|
<h4>카메라 (선택 · CAMERA_ENABLED=True)</h4>
|
||||||
|
<p>Raspberry Pi 4는 <b>15핀(1.0mm 피치) 표준 CSI 커넥터</b>입니다. Zero 2 W는 22핀(0.5mm)이라
|
||||||
|
리본·카메라보드가 <b>비호환</b> → Pi 4용 <b>15핀 리본</b> 또는 <b>15↔22 변환 어댑터</b>가 필요합니다.
|
||||||
|
촬영은 <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) 설치 체크리스트 -->
|
||||||
|
<section>
|
||||||
|
<h2><span class="num">6</span>설치 체크리스트</h2>
|
||||||
|
<ol class="check">
|
||||||
|
<li>Raspberry Pi 전원을 <b>완전히 차단</b>한 상태에서 배선을 시작한다.</li>
|
||||||
|
<li>헤더 방향(핀 1 위치)을 확인한다. 붉은 점선 표시 = 핀 1.</li>
|
||||||
|
<li>센서 신호선을 <b>핀 11(GPIO17)</b>에 연결한다.</li>
|
||||||
|
<li>센서 전원(3.3V)을 <b>핀 1(3V3)</b>, 센서 GND를 <b>핀 6(GND)</b>에 연결한다.</li>
|
||||||
|
<li class="key">외부 <b>4.7MΩ 풀다운</b>을 <b>핀 11 ↔ GND</b> 사이에 연결한다. <b>(필수 · 생략 시 감지 실패)</b></li>
|
||||||
|
<li class="key">내부 풀이 꺼져 있는지 확인한다 — <span class="inline-code">USE_INTERNAL_PULL=False</span> (PUD_OFF). <b>내부 풀다운 절대 금지.</b></li>
|
||||||
|
<li><span class="inline-code">config.py</span> 확인: <span class="inline-code">ACTIVE_LOW=False</span>, <span class="inline-code">DEBOUNCE_MS=500</span>, SENSORS에 GPIO17 등록.</li>
|
||||||
|
<li><span class="inline-code">config_local.py</span>에서 기기별 <b>sensor_id / location</b> 설정 (Pi-A=1/서버실, Pi-C=3/신규).</li>
|
||||||
|
<li>전원 인가 후, <b>건조 상태</b>에서 GPIO17 = <b>LOW(0)</b>인지 로그로 확인한다.</li>
|
||||||
|
<li>물(또는 젖은 천)로 센서를 적셔 GPIO17이 <b>HIGH(1)</b>로 전환되고 누수 이벤트가 기록되는지 확인한다.</li>
|
||||||
|
<li>(선택) 카메라 사용 시 리본 방향·커넥터 규격(15핀 / 어댑터)을 확인하고 640×480 촬영 테스트를 수행한다.</li>
|
||||||
|
</ol>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
557
raspberry_pi4_sht30/WIRING.html
Normal file
557
raspberry_pi4_sht30/WIRING.html
Normal file
|
|
@ -0,0 +1,557 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="ko">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<title>온습도 노드 배선·핀맵 — Pi-B / SHT30 (sensor_id=2)</title>
|
||||||
|
<style>
|
||||||
|
:root{
|
||||||
|
--ink:#1a1d21; --muted:#5c6570; --line:#dfe3e8; --bg:#eef1f4; --card:#ffffff;
|
||||||
|
--accent:#1971c2; --accent-d:#155a9c; --warn:#e03131; --warnbg:#fff5f5;
|
||||||
|
--ok:#2f9e44; --gnd:#343a40; --chip:#eef2f6; --code:#0b3d2e;
|
||||||
|
--mono:"D2Coding","Consolas","Menlo","Courier New",ui-monospace,monospace;
|
||||||
|
--sans:"Malgun Gothic","Apple SD Gothic Neo","Noto Sans KR","Segoe UI",system-ui,-apple-system,sans-serif;
|
||||||
|
}
|
||||||
|
*{box-sizing:border-box;}
|
||||||
|
html,body{margin:0;padding:0;}
|
||||||
|
body{
|
||||||
|
font-family:var(--sans); color:var(--ink); background:var(--bg);
|
||||||
|
line-height:1.6; -webkit-font-smoothing:antialiased;
|
||||||
|
}
|
||||||
|
.wrap{max-width:1000px; margin:0 auto; padding:22px 18px 60px;}
|
||||||
|
|
||||||
|
/* ---------- Header ---------- */
|
||||||
|
.hero{
|
||||||
|
background:linear-gradient(135deg,#1f2933 0%,#283746 55%,#2f4a5a 100%);
|
||||||
|
color:#fff; border-radius:16px; padding:26px 28px;
|
||||||
|
box-shadow:0 8px 24px rgba(20,30,40,.18);
|
||||||
|
}
|
||||||
|
.hero .eyebrow{font-size:12.5px; letter-spacing:.14em; text-transform:uppercase;
|
||||||
|
color:#9fc3e0; font-weight:700; margin:0 0 6px;}
|
||||||
|
.hero h1{margin:0 0 8px; font-size:27px; line-height:1.25; font-weight:800;}
|
||||||
|
.hero p.sum{margin:0 0 16px; font-size:14.5px; color:#d7e2ec; max-width:72ch;}
|
||||||
|
.chips{display:flex; flex-wrap:wrap; gap:8px;}
|
||||||
|
.chip{
|
||||||
|
display:inline-flex; align-items:center; gap:6px;
|
||||||
|
background:rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.22);
|
||||||
|
color:#eef5fb; font-size:12.5px; font-weight:600; padding:5px 11px; border-radius:999px;
|
||||||
|
}
|
||||||
|
.chip.mono{font-family:var(--mono); letter-spacing:.01em;}
|
||||||
|
.chip b{color:#fff;}
|
||||||
|
|
||||||
|
/* ---------- Sections ---------- */
|
||||||
|
section{
|
||||||
|
background:var(--card); border:1px solid var(--line); border-radius:14px;
|
||||||
|
padding:22px 24px; margin-top:20px; box-shadow:0 2px 10px rgba(20,30,40,.05);
|
||||||
|
}
|
||||||
|
h2{
|
||||||
|
display:flex; align-items:center; gap:11px; margin:0 0 16px;
|
||||||
|
font-size:19px; font-weight:800; color:var(--ink);
|
||||||
|
}
|
||||||
|
h2 .n{
|
||||||
|
flex:0 0 auto; width:30px; height:30px; border-radius:9px;
|
||||||
|
background:var(--accent); color:#fff; font-size:15px; font-weight:800;
|
||||||
|
display:flex; align-items:center; justify-content:center;
|
||||||
|
}
|
||||||
|
h2 small{font-weight:600; font-size:13px; color:var(--muted);}
|
||||||
|
|
||||||
|
/* ---------- Pinmap SVG ---------- */
|
||||||
|
.svg-pin{display:block; width:100%; max-width:460px; height:auto; margin:2px auto 0;}
|
||||||
|
.diagram-cap{text-align:center; color:var(--muted); font-size:12.5px; margin:12px 0 0;}
|
||||||
|
.legend{
|
||||||
|
display:flex; flex-wrap:wrap; justify-content:center; gap:12px 18px;
|
||||||
|
margin:16px auto 2px; max-width:640px;
|
||||||
|
}
|
||||||
|
.legend span{display:inline-flex; align-items:center; gap:7px; font-size:12.5px; color:var(--ink);}
|
||||||
|
.sw{width:15px; height:15px; border-radius:50%; flex:0 0 auto; border:1px solid rgba(0,0,0,.15);}
|
||||||
|
.sw.pwr{background:#2f9e44;} .sw.i2c{background:#1971c2;}
|
||||||
|
.sw.gnd{background:#343a40;}
|
||||||
|
.sw.altgnd{background:#ced4da; border:1.5px dashed #868e96;}
|
||||||
|
.sw.off{background:#dee2e6;}
|
||||||
|
|
||||||
|
/* SVG element classes */
|
||||||
|
.p-pwr{fill:#2f9e44; stroke:#248a3b; stroke-width:1.5;}
|
||||||
|
.p-i2c{fill:#1971c2; stroke:#155a9c; stroke-width:1.5;}
|
||||||
|
.p-gnd{fill:#343a40; stroke:#1f2429; stroke-width:1.5;}
|
||||||
|
.p-altgnd{fill:#ced4da; stroke:#868e96; stroke-width:1.5; stroke-dasharray:3 2;}
|
||||||
|
.p-off{fill:#dee2e6; stroke:#c3c9cf; stroke-width:1;}
|
||||||
|
.rail{fill:#f1f3f5; stroke:#ced4da; stroke-width:1.5;}
|
||||||
|
.pnum{font-family:var(--mono); font-size:12px; font-weight:700; text-anchor:middle; dominant-baseline:central;}
|
||||||
|
.pnum-l{fill:#ffffff;} .pnum-d{fill:#495057;}
|
||||||
|
.plbl{font-family:var(--mono); font-size:12px; dominant-baseline:central;}
|
||||||
|
.lbl-l{text-anchor:end;} .lbl-r{text-anchor:start;}
|
||||||
|
.lbl-used{fill:#1a1d21; font-weight:700;}
|
||||||
|
.lbl-alt{fill:#5c6570; font-weight:600;}
|
||||||
|
.lbl-off{fill:#adb5bd; font-weight:500;}
|
||||||
|
.cap-svg{font-family:var(--sans); font-size:12.5px; fill:#5c6570; font-weight:600; text-anchor:middle;}
|
||||||
|
|
||||||
|
/* ---------- Table ---------- */
|
||||||
|
table{width:100%; border-collapse:collapse; font-size:14px;}
|
||||||
|
thead th{
|
||||||
|
background:#f1f4f7; color:#2b3541; text-align:left; font-weight:700;
|
||||||
|
padding:10px 12px; border-bottom:2px solid #ccd4dc; font-size:13px;
|
||||||
|
}
|
||||||
|
tbody td{padding:11px 12px; border-bottom:1px solid var(--line); vertical-align:top;}
|
||||||
|
tbody tr:last-child td{border-bottom:none;}
|
||||||
|
.mono{font-family:var(--mono);}
|
||||||
|
.pinbadge{
|
||||||
|
display:inline-block; min-width:26px; text-align:center; font-family:var(--mono);
|
||||||
|
font-weight:700; font-size:13px; color:#fff; background:var(--accent);
|
||||||
|
border-radius:6px; padding:2px 7px;
|
||||||
|
}
|
||||||
|
.pinbadge.gnd{background:var(--gnd);} .pinbadge.pwr{background:var(--ok);}
|
||||||
|
.pinbadge.na{background:#adb5bd;}
|
||||||
|
td .warn-inline{color:var(--warn); font-weight:700;}
|
||||||
|
|
||||||
|
/* ---------- Schematic ---------- */
|
||||||
|
.svg-sch{display:block; width:100%; max-width:840px; height:auto; margin:0 auto;}
|
||||||
|
.box{fill:#f8f9fa; stroke:#495057; stroke-width:2; rx:8;}
|
||||||
|
.boxtitle{font-family:var(--sans); font-size:14px; font-weight:800; fill:#1a1d21; text-anchor:middle;}
|
||||||
|
.term{font-family:var(--mono); font-size:12.5px; font-weight:700; fill:#2b3541;}
|
||||||
|
.w-pwr{stroke:#e03131; stroke-width:3; fill:none; stroke-linecap:round; stroke-linejoin:round;}
|
||||||
|
.w-i2c{stroke:#1971c2; stroke-width:3; fill:none; stroke-linecap:round; stroke-linejoin:round;}
|
||||||
|
.w-gnd{stroke:#343a40; stroke-width:3; fill:none; stroke-linecap:round; stroke-linejoin:round;}
|
||||||
|
.w-addr{stroke:#495057; stroke-width:2.5; fill:none; stroke-dasharray:6 4; stroke-linecap:round;}
|
||||||
|
.res{fill:#ffffff; stroke:#212529; stroke-width:2;}
|
||||||
|
.wlbl{font-family:var(--sans); font-size:12px; font-weight:700; fill:#2b3541;}
|
||||||
|
.rlbl{font-family:var(--mono); font-size:12px; font-weight:700; fill:#b02a2a;}
|
||||||
|
.jn{fill:#212529;}
|
||||||
|
.sch-note{color:var(--muted); font-size:12.5px; text-align:center; margin:12px 0 0;}
|
||||||
|
|
||||||
|
/* ---------- Callouts ---------- */
|
||||||
|
.warn{
|
||||||
|
background:var(--warnbg); border:1.5px solid #ffc9c9; border-left:6px solid var(--warn);
|
||||||
|
border-radius:12px; padding:16px 18px; margin:0 0 16px; display:flex; gap:14px; align-items:flex-start;
|
||||||
|
}
|
||||||
|
.warn .ic{flex:0 0 auto; width:34px; height:34px;}
|
||||||
|
.warn h3{margin:0 0 4px; color:#c92a2a; font-size:16px; font-weight:800;}
|
||||||
|
.warn p{margin:0; font-size:14px; color:#5a2020;}
|
||||||
|
.warn b{color:#c92a2a;}
|
||||||
|
ul.notes{margin:6px 0 0; padding:0; list-style:none;}
|
||||||
|
ul.notes li{position:relative; padding:7px 0 7px 24px; border-bottom:1px dashed var(--line); font-size:14px;}
|
||||||
|
ul.notes li:last-child{border-bottom:none;}
|
||||||
|
ul.notes li::before{content:""; position:absolute; left:4px; top:14px; width:8px; height:8px;
|
||||||
|
background:var(--accent); border-radius:2px; transform:rotate(45deg);}
|
||||||
|
code, .kbd{font-family:var(--mono); background:#eef2f6; color:#0b3d2e; padding:1px 6px; border-radius:5px; font-size:13px;}
|
||||||
|
.cmd{
|
||||||
|
font-family:var(--mono); background:#12211b; color:#c8f7d8; border-radius:10px;
|
||||||
|
padding:12px 14px; font-size:13.5px; margin:12px 0 0; overflow-x:auto;
|
||||||
|
}
|
||||||
|
.cmd .cm{color:#7fd6a3;} .cmd .ok{color:#ffd43b;}
|
||||||
|
|
||||||
|
/* ---------- Checklist ---------- */
|
||||||
|
ol.check{margin:0; padding:0; list-style:none; counter-reset:ck;}
|
||||||
|
ol.check li{
|
||||||
|
counter-increment:ck; position:relative; display:flex; align-items:flex-start; gap:12px;
|
||||||
|
padding:11px 4px 11px 0; border-bottom:1px solid var(--line); font-size:14px;
|
||||||
|
}
|
||||||
|
ol.check li:last-child{border-bottom:none;}
|
||||||
|
ol.check li .num{
|
||||||
|
flex:0 0 auto; width:24px; height:24px; border-radius:50%; background:#e7eef5; color:#1f5f97;
|
||||||
|
font-weight:800; font-size:12.5px; display:flex; align-items:center; justify-content:center;
|
||||||
|
}
|
||||||
|
ol.check li .num::before{content:counter(ck);}
|
||||||
|
ol.check li .cbox{flex:0 0 auto; width:18px; height:18px; border:2px solid #9aa6b1; border-radius:4px; margin-top:1px;}
|
||||||
|
ol.check li .txt{flex:1;}
|
||||||
|
ol.check li .txt b{color:var(--warn);}
|
||||||
|
|
||||||
|
footer{margin-top:26px; text-align:center; color:var(--muted); font-size:12px;}
|
||||||
|
|
||||||
|
/* ---------- Print ---------- */
|
||||||
|
@media print{
|
||||||
|
body{background:#fff;}
|
||||||
|
.wrap{max-width:none; padding:0;}
|
||||||
|
.hero{background:#fff !important; color:#111; border:2px solid #111; box-shadow:none;}
|
||||||
|
.hero .eyebrow{color:#444;} .hero p.sum{color:#222;}
|
||||||
|
.chip{background:#f2f2f2; color:#111; border:1px solid #999;}
|
||||||
|
.chip b{color:#000;}
|
||||||
|
h2 .n{background:#111;}
|
||||||
|
section{box-shadow:none; border:1px solid #999; break-inside:avoid; page-break-inside:avoid;}
|
||||||
|
table, tr, td, th, .warn, .card{break-inside:avoid; page-break-inside:avoid;}
|
||||||
|
.svg-pin, .svg-sch{max-width:100%;}
|
||||||
|
.cmd{background:#f2f2f2; color:#111; border:1px solid #999;}
|
||||||
|
a{color:#000;}
|
||||||
|
}
|
||||||
|
@media (max-width:560px){
|
||||||
|
.hero h1{font-size:22px;} h2{font-size:17px;}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="wrap">
|
||||||
|
|
||||||
|
<!-- ============ 1. HEADER ============ -->
|
||||||
|
<header class="hero">
|
||||||
|
<p class="eyebrow">현장 설치 문서 · 배선 & 핀맵</p>
|
||||||
|
<h1>온습도 노드 — 1번 지점 / 서버실</h1>
|
||||||
|
<p class="sum">
|
||||||
|
SHT30 온습도 센서를 라즈베리파이(Pi-B)의 I2C(버스 1, 주소 0x44)에 연결하는 측정 노드입니다.
|
||||||
|
이 노드는 측정값만 <b>5분 주기</b>로 서버에 보고하며, 고온·저온·고습·저습 임계 판정과 SMS 발송은 서버가 담당합니다.
|
||||||
|
</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">Sensirion SHT30 (한진데이터 P4422-3)</span>
|
||||||
|
<span class="chip mono">I2C bus <b>1</b></span>
|
||||||
|
<span class="chip mono">addr <b>0x44</b></span>
|
||||||
|
<span class="chip mono">sensor_id=<b>2</b></span>
|
||||||
|
<span class="chip">보고 주기 5분</span>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<!-- ============ 2. PINMAP SVG ============ -->
|
||||||
|
<section>
|
||||||
|
<h2><span class="n">2</span>40핀 헤더 핀맵 도해 <small>사용 핀만 강조 · 나머지는 회색</small></h2>
|
||||||
|
|
||||||
|
<svg class="svg-pin" viewBox="0 0 520 672" role="img" aria-label="라즈베리파이 40핀 GPIO 헤더 핀맵">
|
||||||
|
<!-- caption -->
|
||||||
|
<text class="cap-svg" x="260" y="20">40핀 GPIO 헤더 (J8) · 물리 핀 번호</text>
|
||||||
|
<!-- rails -->
|
||||||
|
<rect class="rail" x="186" y="46" width="28" height="600" rx="14"/>
|
||||||
|
<rect class="rail" x="306" y="46" width="28" height="600" rx="14"/>
|
||||||
|
|
||||||
|
<!-- Row 1 : pin1 (square = pin1 marker) / pin2 -->
|
||||||
|
<rect class="p-pwr" x="188" y="48" width="24" height="24" rx="5"/>
|
||||||
|
<text class="pnum pnum-l" x="200" y="60">1</text>
|
||||||
|
<text class="plbl lbl-l lbl-used" x="176" y="60">3V3</text>
|
||||||
|
<circle class="p-off" cx="320" cy="60" r="12"/>
|
||||||
|
<text class="pnum pnum-d" x="320" y="60">2</text>
|
||||||
|
<text class="plbl lbl-r lbl-off" x="344" y="60">5V</text>
|
||||||
|
|
||||||
|
<!-- Row 2 : pin3 / pin4 -->
|
||||||
|
<circle class="p-i2c" cx="200" cy="90" r="12"/>
|
||||||
|
<text class="pnum pnum-l" x="200" y="90">3</text>
|
||||||
|
<text class="plbl lbl-l lbl-used" x="176" y="90">GPIO2 (SDA1)</text>
|
||||||
|
<circle class="p-off" cx="320" cy="90" r="12"/>
|
||||||
|
<text class="pnum pnum-d" x="320" y="90">4</text>
|
||||||
|
<text class="plbl lbl-r lbl-off" x="344" y="90">5V</text>
|
||||||
|
|
||||||
|
<!-- Row 3 : pin5 / pin6 -->
|
||||||
|
<circle class="p-i2c" cx="200" cy="120" r="12"/>
|
||||||
|
<text class="pnum pnum-l" x="200" y="120">5</text>
|
||||||
|
<text class="plbl lbl-l lbl-used" x="176" y="120">GPIO3 (SCL1)</text>
|
||||||
|
<circle class="p-gnd" cx="320" cy="120" r="12"/>
|
||||||
|
<text class="pnum pnum-l" x="320" y="120">6</text>
|
||||||
|
<text class="plbl lbl-r lbl-used" x="344" y="120">GND</text>
|
||||||
|
|
||||||
|
<!-- Row 4 : pin7 / pin8 -->
|
||||||
|
<circle class="p-off" cx="200" cy="150" r="12"/>
|
||||||
|
<text class="pnum pnum-d" x="200" y="150">7</text>
|
||||||
|
<text class="plbl lbl-l lbl-off" x="176" y="150">GPIO4</text>
|
||||||
|
<circle class="p-off" cx="320" cy="150" r="12"/>
|
||||||
|
<text class="pnum pnum-d" x="320" y="150">8</text>
|
||||||
|
<text class="plbl lbl-r lbl-off" x="344" y="150">GPIO14 (TXD)</text>
|
||||||
|
|
||||||
|
<!-- Row 5 : pin9 / pin10 -->
|
||||||
|
<circle class="p-altgnd" cx="200" cy="180" r="12"/>
|
||||||
|
<text class="pnum pnum-d" x="200" y="180">9</text>
|
||||||
|
<text class="plbl lbl-l lbl-alt" x="176" y="180">GND</text>
|
||||||
|
<circle class="p-off" cx="320" cy="180" r="12"/>
|
||||||
|
<text class="pnum pnum-d" x="320" y="180">10</text>
|
||||||
|
<text class="plbl lbl-r lbl-off" x="344" y="180">GPIO15 (RXD)</text>
|
||||||
|
|
||||||
|
<!-- Row 6 : pin11 / pin12 -->
|
||||||
|
<circle class="p-off" cx="200" cy="210" r="12"/>
|
||||||
|
<text class="pnum pnum-d" x="200" y="210">11</text>
|
||||||
|
<text class="plbl lbl-l lbl-off" x="176" y="210">GPIO17</text>
|
||||||
|
<circle class="p-off" cx="320" cy="210" r="12"/>
|
||||||
|
<text class="pnum pnum-d" x="320" y="210">12</text>
|
||||||
|
<text class="plbl lbl-r lbl-off" x="344" y="210">GPIO18</text>
|
||||||
|
|
||||||
|
<!-- Row 7 : pin13 / pin14 -->
|
||||||
|
<circle class="p-off" cx="200" cy="240" r="12"/>
|
||||||
|
<text class="pnum pnum-d" x="200" y="240">13</text>
|
||||||
|
<text class="plbl lbl-l lbl-off" x="176" y="240">GPIO27</text>
|
||||||
|
<circle class="p-altgnd" cx="320" cy="240" r="12"/>
|
||||||
|
<text class="pnum pnum-d" x="320" y="240">14</text>
|
||||||
|
<text class="plbl lbl-r lbl-alt" x="344" y="240">GND</text>
|
||||||
|
|
||||||
|
<!-- Row 8 : pin15 / pin16 -->
|
||||||
|
<circle class="p-off" cx="200" cy="270" r="12"/>
|
||||||
|
<text class="pnum pnum-d" x="200" y="270">15</text>
|
||||||
|
<text class="plbl lbl-l lbl-off" x="176" y="270">GPIO22</text>
|
||||||
|
<circle class="p-off" cx="320" cy="270" r="12"/>
|
||||||
|
<text class="pnum pnum-d" x="320" y="270">16</text>
|
||||||
|
<text class="plbl lbl-r lbl-off" x="344" y="270">GPIO23</text>
|
||||||
|
|
||||||
|
<!-- Row 9 : pin17 / pin18 -->
|
||||||
|
<circle class="p-off" cx="200" cy="300" r="12"/>
|
||||||
|
<text class="pnum pnum-d" x="200" y="300">17</text>
|
||||||
|
<text class="plbl lbl-l lbl-off" x="176" y="300">3V3</text>
|
||||||
|
<circle class="p-off" cx="320" cy="300" r="12"/>
|
||||||
|
<text class="pnum pnum-d" x="320" y="300">18</text>
|
||||||
|
<text class="plbl lbl-r lbl-off" x="344" y="300">GPIO24</text>
|
||||||
|
|
||||||
|
<!-- Row 10 : pin19 / pin20 -->
|
||||||
|
<circle class="p-off" cx="200" cy="330" r="12"/>
|
||||||
|
<text class="pnum pnum-d" x="200" y="330">19</text>
|
||||||
|
<text class="plbl lbl-l lbl-off" x="176" y="330">GPIO10 (MOSI)</text>
|
||||||
|
<circle class="p-altgnd" cx="320" cy="330" r="12"/>
|
||||||
|
<text class="pnum pnum-d" x="320" y="330">20</text>
|
||||||
|
<text class="plbl lbl-r lbl-alt" x="344" y="330">GND</text>
|
||||||
|
|
||||||
|
<!-- Row 11 : pin21 / pin22 -->
|
||||||
|
<circle class="p-off" cx="200" cy="360" r="12"/>
|
||||||
|
<text class="pnum pnum-d" x="200" y="360">21</text>
|
||||||
|
<text class="plbl lbl-l lbl-off" x="176" y="360">GPIO9 (MISO)</text>
|
||||||
|
<circle class="p-off" cx="320" cy="360" r="12"/>
|
||||||
|
<text class="pnum pnum-d" x="320" y="360">22</text>
|
||||||
|
<text class="plbl lbl-r lbl-off" x="344" y="360">GPIO25</text>
|
||||||
|
|
||||||
|
<!-- Row 12 : pin23 / pin24 -->
|
||||||
|
<circle class="p-off" cx="200" cy="390" r="12"/>
|
||||||
|
<text class="pnum pnum-d" x="200" y="390">23</text>
|
||||||
|
<text class="plbl lbl-l lbl-off" x="176" y="390">GPIO11 (SCLK)</text>
|
||||||
|
<circle class="p-off" cx="320" cy="390" r="12"/>
|
||||||
|
<text class="pnum pnum-d" x="320" y="390">24</text>
|
||||||
|
<text class="plbl lbl-r lbl-off" x="344" y="390">GPIO8 (CE0)</text>
|
||||||
|
|
||||||
|
<!-- Row 13 : pin25 / pin26 -->
|
||||||
|
<circle class="p-altgnd" cx="200" cy="420" r="12"/>
|
||||||
|
<text class="pnum pnum-d" x="200" y="420">25</text>
|
||||||
|
<text class="plbl lbl-l lbl-alt" x="176" y="420">GND</text>
|
||||||
|
<circle class="p-off" cx="320" cy="420" r="12"/>
|
||||||
|
<text class="pnum pnum-d" x="320" y="420">26</text>
|
||||||
|
<text class="plbl lbl-r lbl-off" x="344" y="420">GPIO7 (CE1)</text>
|
||||||
|
|
||||||
|
<!-- Row 14 : pin27 / pin28 -->
|
||||||
|
<circle class="p-off" cx="200" cy="450" r="12"/>
|
||||||
|
<text class="pnum pnum-d" x="200" y="450">27</text>
|
||||||
|
<text class="plbl lbl-l lbl-off" x="176" y="450">GPIO0 (ID_SD)</text>
|
||||||
|
<circle class="p-off" cx="320" cy="450" r="12"/>
|
||||||
|
<text class="pnum pnum-d" x="320" y="450">28</text>
|
||||||
|
<text class="plbl lbl-r lbl-off" x="344" y="450">GPIO1 (ID_SC)</text>
|
||||||
|
|
||||||
|
<!-- Row 15 : pin29 / pin30 -->
|
||||||
|
<circle class="p-off" cx="200" cy="480" r="12"/>
|
||||||
|
<text class="pnum pnum-d" x="200" y="480">29</text>
|
||||||
|
<text class="plbl lbl-l lbl-off" x="176" y="480">GPIO5</text>
|
||||||
|
<circle class="p-altgnd" cx="320" cy="480" r="12"/>
|
||||||
|
<text class="pnum pnum-d" x="320" y="480">30</text>
|
||||||
|
<text class="plbl lbl-r lbl-alt" x="344" y="480">GND</text>
|
||||||
|
|
||||||
|
<!-- Row 16 : pin31 / pin32 -->
|
||||||
|
<circle class="p-off" cx="200" cy="510" r="12"/>
|
||||||
|
<text class="pnum pnum-d" x="200" y="510">31</text>
|
||||||
|
<text class="plbl lbl-l lbl-off" x="176" y="510">GPIO6</text>
|
||||||
|
<circle class="p-off" cx="320" cy="510" r="12"/>
|
||||||
|
<text class="pnum pnum-d" x="320" y="510">32</text>
|
||||||
|
<text class="plbl lbl-r lbl-off" x="344" y="510">GPIO12</text>
|
||||||
|
|
||||||
|
<!-- Row 17 : pin33 / pin34 -->
|
||||||
|
<circle class="p-off" cx="200" cy="540" r="12"/>
|
||||||
|
<text class="pnum pnum-d" x="200" y="540">33</text>
|
||||||
|
<text class="plbl lbl-l lbl-off" x="176" y="540">GPIO13</text>
|
||||||
|
<circle class="p-altgnd" cx="320" cy="540" r="12"/>
|
||||||
|
<text class="pnum pnum-d" x="320" y="540">34</text>
|
||||||
|
<text class="plbl lbl-r lbl-alt" x="344" y="540">GND</text>
|
||||||
|
|
||||||
|
<!-- Row 18 : pin35 / pin36 -->
|
||||||
|
<circle class="p-off" cx="200" cy="570" r="12"/>
|
||||||
|
<text class="pnum pnum-d" x="200" y="570">35</text>
|
||||||
|
<text class="plbl lbl-l lbl-off" x="176" y="570">GPIO19</text>
|
||||||
|
<circle class="p-off" cx="320" cy="570" r="12"/>
|
||||||
|
<text class="pnum pnum-d" x="320" y="570">36</text>
|
||||||
|
<text class="plbl lbl-r lbl-off" x="344" y="570">GPIO16</text>
|
||||||
|
|
||||||
|
<!-- Row 19 : pin37 / pin38 -->
|
||||||
|
<circle class="p-off" cx="200" cy="600" r="12"/>
|
||||||
|
<text class="pnum pnum-d" x="200" y="600">37</text>
|
||||||
|
<text class="plbl lbl-l lbl-off" x="176" y="600">GPIO26</text>
|
||||||
|
<circle class="p-off" cx="320" cy="600" r="12"/>
|
||||||
|
<text class="pnum pnum-d" x="320" y="600">38</text>
|
||||||
|
<text class="plbl lbl-r lbl-off" x="344" y="600">GPIO20</text>
|
||||||
|
|
||||||
|
<!-- Row 20 : pin39 / pin40 -->
|
||||||
|
<circle class="p-altgnd" cx="200" cy="630" r="12"/>
|
||||||
|
<text class="pnum pnum-d" x="200" y="630">39</text>
|
||||||
|
<text class="plbl lbl-l lbl-alt" x="176" y="630">GND</text>
|
||||||
|
<circle class="p-off" cx="320" cy="630" r="12"/>
|
||||||
|
<text class="pnum pnum-d" x="320" y="630">40</text>
|
||||||
|
<text class="plbl lbl-r lbl-off" x="344" y="630">GPIO21</text>
|
||||||
|
|
||||||
|
<!-- pin1 hint -->
|
||||||
|
<text class="cap-svg" x="260" y="662" style="font-size:11px;">■ 사각 표시 = 1번 핀 (기판 방향 기준)</text>
|
||||||
|
</svg>
|
||||||
|
|
||||||
|
<div class="legend">
|
||||||
|
<span><i class="sw pwr"></i>3.3V 전원 — 핀 1</span>
|
||||||
|
<span><i class="sw i2c"></i>I2C SDA/SCL — 핀 3·5</span>
|
||||||
|
<span><i class="sw gnd"></i>GND (사용) — 핀 6</span>
|
||||||
|
<span><i class="sw altgnd"></i>대체 GND (선택) — 9·14·20·25·30·34·39</span>
|
||||||
|
<span><i class="sw off"></i>미사용 핀</span>
|
||||||
|
</div>
|
||||||
|
<p class="diagram-cap">본 도해의 핀 번호·신호는 Raspberry Pi 4 Model B (BCM2711) 40핀 헤더 표준 배열과 일치합니다.</p>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- ============ 3. PINMAP TABLE ============ -->
|
||||||
|
<section>
|
||||||
|
<h2><span class="n">3</span>핀맵 표 <small>SHT30 → 40핀 헤더</small></h2>
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr><th style="width:30%">신호</th><th style="width:24%">BCM</th><th style="width:14%">물리핀</th><th>비고</th></tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td><b>3.3V 전원</b> (VCC)</td>
|
||||||
|
<td class="mono">—</td>
|
||||||
|
<td><span class="pinbadge pwr">1</span></td>
|
||||||
|
<td><span class="warn-inline">★ 반드시 3.3V — 5V(핀 2·4) 연결 금지</span></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><b>I2C 데이터</b> (SDA)</td>
|
||||||
|
<td class="mono">GPIO2 / SDA1</td>
|
||||||
|
<td><span class="pinbadge">3</span></td>
|
||||||
|
<td>4.7kΩ 풀업 → 3.3V <span style="color:var(--muted)">(모듈 내장 시 생략)</span></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><b>I2C 클럭</b> (SCL)</td>
|
||||||
|
<td class="mono">GPIO3 / SCL1</td>
|
||||||
|
<td><span class="pinbadge">5</span></td>
|
||||||
|
<td>4.7kΩ 풀업 → 3.3V <span style="color:var(--muted)">(모듈 내장 시 생략)</span></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><b>접지</b> (GND)</td>
|
||||||
|
<td class="mono">—</td>
|
||||||
|
<td><span class="pinbadge gnd">6</span></td>
|
||||||
|
<td>대체 GND 사용 가능: <span class="mono">9 · 14 · 20 · 25 · 30 · 34 · 39</span></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><b>주소 선택</b> (ADDR)</td>
|
||||||
|
<td class="mono">—</td>
|
||||||
|
<td><span class="pinbadge na">GND</span></td>
|
||||||
|
<td>ADDR → GND ⇒ <span class="mono">0x44</span> (선택) · ADDR → VDD ⇒ <span class="mono">0x45</span></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- ============ 4. SCHEMATIC SVG ============ -->
|
||||||
|
<section>
|
||||||
|
<h2><span class="n">4</span>배선 스키매틱 <small>센서 ↔ 헤더 ↔ 풀업 저항</small></h2>
|
||||||
|
|
||||||
|
<svg class="svg-sch" viewBox="0 0 840 400" role="img" aria-label="SHT30 배선 스키매틱">
|
||||||
|
<!-- component boxes -->
|
||||||
|
<rect class="box" x="70" y="90" width="150" height="290" rx="8"/>
|
||||||
|
<rect class="box" x="640" y="90" width="150" height="290" rx="8"/>
|
||||||
|
<text class="boxtitle" x="145" y="116">SHT30 센서 모듈</text>
|
||||||
|
<text class="boxtitle" x="715" y="116">Pi 40핀 헤더</text>
|
||||||
|
|
||||||
|
<!-- SHT30 terminal labels (right side) -->
|
||||||
|
<text class="term" x="210" y="150" text-anchor="end">VCC</text>
|
||||||
|
<text class="term" x="210" y="200" text-anchor="end">SDA</text>
|
||||||
|
<text class="term" x="210" y="250" text-anchor="end">SCL</text>
|
||||||
|
<text class="term" x="210" y="305" text-anchor="end">GND</text>
|
||||||
|
<text class="term" x="210" y="350" text-anchor="end">ADDR</text>
|
||||||
|
|
||||||
|
<!-- Pi terminal labels (left side) -->
|
||||||
|
<text class="term" x="650" y="150">3V3 (핀 1)</text>
|
||||||
|
<text class="term" x="650" y="200">SDA1 (핀 3)</text>
|
||||||
|
<text class="term" x="650" y="250">SCL1 (핀 5)</text>
|
||||||
|
<text class="term" x="650" y="305">GND (핀 6)</text>
|
||||||
|
|
||||||
|
<!-- POWER wire (also 3V3 rail for pull-ups) -->
|
||||||
|
<path class="w-pwr" d="M220 150 H640"/>
|
||||||
|
<text class="wlbl" x="300" y="140" fill="#b02a2a">전원 3.3V</text>
|
||||||
|
|
||||||
|
<!-- GND wire -->
|
||||||
|
<path class="w-gnd" d="M220 305 H640"/>
|
||||||
|
<text class="wlbl" x="300" y="322" fill="#2b3541">접지 GND</text>
|
||||||
|
|
||||||
|
<!-- SDA wire (with hop over SCL pull-up branch at x=480) -->
|
||||||
|
<path class="w-i2c" d="M220 200 H470 A10 9 0 0 1 490 200 H640"/>
|
||||||
|
<text class="wlbl" x="300" y="216" fill="#155a9c">SDA → GPIO2</text>
|
||||||
|
|
||||||
|
<!-- SCL wire -->
|
||||||
|
<path class="w-i2c" d="M220 250 H640"/>
|
||||||
|
<text class="wlbl" x="300" y="266" fill="#155a9c">SCL → GPIO3</text>
|
||||||
|
|
||||||
|
<!-- ADDR -> GND -->
|
||||||
|
<path class="w-addr" d="M220 350 H300 V305"/>
|
||||||
|
<text class="wlbl" x="228" y="368" fill="#3b444d">ADDR → GND = 0x44</text>
|
||||||
|
<circle class="jn" cx="300" cy="305" r="4"/>
|
||||||
|
|
||||||
|
<!-- Pull-up R1 on SDA (x=400) -->
|
||||||
|
<path class="w-i2c" d="M400 200 V190"/>
|
||||||
|
<rect class="res" x="390" y="165" width="20" height="25" rx="3"/>
|
||||||
|
<path class="w-i2c" d="M400 165 V150"/>
|
||||||
|
<circle class="jn" cx="400" cy="200" r="4"/>
|
||||||
|
<circle class="jn" cx="400" cy="150" r="4"/>
|
||||||
|
<text class="rlbl" x="416" y="180">R1 4.7kΩ</text>
|
||||||
|
|
||||||
|
<!-- Pull-up R2 on SCL (x=480), branch rises past SDA (hop) up to rail -->
|
||||||
|
<path class="w-i2c" d="M480 250 V188"/>
|
||||||
|
<rect class="res" x="470" y="163" width="20" height="25" rx="3"/>
|
||||||
|
<path class="w-i2c" d="M480 163 V150"/>
|
||||||
|
<circle class="jn" cx="480" cy="250" r="4"/>
|
||||||
|
<circle class="jn" cx="480" cy="150" r="4"/>
|
||||||
|
<text class="rlbl" x="496" y="178">R2 4.7kΩ</text>
|
||||||
|
</svg>
|
||||||
|
|
||||||
|
<p class="sch-note">
|
||||||
|
풀업 저항 R1·R2 (4.7kΩ ×2) 는 3.3V 레일로 연결됩니다. <b>SHT30 모듈에 내장되어 있으면 생략</b>하십시오.
|
||||||
|
SDA 선의 반원(hop)은 배선 교차 표시일 뿐 전기적 연결이 아닙니다.
|
||||||
|
</p>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- ============ 5. ELECTRICAL NOTES ============ -->
|
||||||
|
<section>
|
||||||
|
<h2><span class="n">5</span>전기 설계 · 주의</h2>
|
||||||
|
|
||||||
|
<div class="warn">
|
||||||
|
<svg class="ic" viewBox="0 0 24 24" aria-hidden="true">
|
||||||
|
<path d="M12 2 L23 21 H1 Z" fill="#ffe3e3" stroke="#e03131" stroke-width="1.6" stroke-linejoin="round"/>
|
||||||
|
<line x1="12" y1="9" x2="12" y2="15" stroke="#e03131" stroke-width="2.2" stroke-linecap="round"/>
|
||||||
|
<circle cx="12" cy="18" r="1.4" fill="#e03131"/>
|
||||||
|
</svg>
|
||||||
|
<div>
|
||||||
|
<h3>치명적 경고 — 전원은 반드시 3.3V</h3>
|
||||||
|
<p>SHT30 의 <b>VCC 는 물리 핀 1 (3.3V)</b> 에만 연결하십시오.
|
||||||
|
<b>5V (핀 2·4) 연결 절대 금지</b> — 소자가 즉시 손상될 수 있습니다.
|
||||||
|
결선 전 핀 번호를 다시 확인하십시오.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<ul class="notes">
|
||||||
|
<li><b>I2C 풀업:</b> SDA·SCL 각각 4.7kΩ 풀업 저항을 3.3V 로 연결. 센서 모듈에 내장된 경우 생략 가능.</li>
|
||||||
|
<li><b>주소 설정:</b> ADDR → GND 이면 <code>0x44</code>(기본), ADDR → VDD 이면 <code>0x45</code>. <code>config.py</code> 의 <code>I2C_ADDR</code> 값과 반드시 일치해야 합니다.</li>
|
||||||
|
<li><b>I2C 버스:</b> 버스 1 사용. 부팅 후 I2C 가 활성화되어 있어야 함(<code>raspi-config</code> 또는 <code>dtparam=i2c_arm=on</code>).</li>
|
||||||
|
<li><b>배선 길이:</b> I2C 는 짧은 케이블을 권장. 케이블이 길면 통신 오류·풀업 값 조정이 필요할 수 있습니다.</li>
|
||||||
|
<li><b>역할 분담:</b> 이 노드는 측정값만 5분 주기로 서버에 보고합니다. 고온·저온·고습·저습 <b>임계 판정과 SMS 발송은 서버</b>가 수행합니다.</li>
|
||||||
|
<li><b>설정 파일:</b> <code>raspberry_pi4_sht30/config.py</code> (<code>I2C_BUS=1</code>, <code>I2C_ADDR=0x44</code>). 기기별 값은 <code>config_local.py</code> 로 오버라이드.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<div class="cmd">
|
||||||
|
<span class="cm"># I2C 연결 확인 (0x44 가 표에 보이면 정상)</span>
|
||||||
|
$ i2cdetect -y 1
|
||||||
|
0 1 2 3 4 5 6 7 8 9 a b c d e f
|
||||||
|
40: -- -- -- -- <span class="ok">44</span> -- -- -- -- -- -- -- -- -- -- --
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- ============ 6. INSTALL CHECKLIST ============ -->
|
||||||
|
<section>
|
||||||
|
<h2><span class="n">6</span>설치 체크리스트</h2>
|
||||||
|
<ol class="check">
|
||||||
|
<li><span class="num"></span><span class="cbox"></span><span class="txt"><b>전원 차단 상태</b>에서 배선 작업 (핫플러그 금지)</span></li>
|
||||||
|
<li><span class="num"></span><span class="cbox"></span><span class="txt">VCC → 물리 핀 1 (3.3V) 연결 — <b>5V 핀(2·4) 아님</b>을 재확인</span></li>
|
||||||
|
<li><span class="num"></span><span class="cbox"></span><span class="txt">GND → 물리 핀 6 연결 (대체 GND 사용 시 9·14·20·25·30·34·39)</span></li>
|
||||||
|
<li><span class="num"></span><span class="cbox"></span><span class="txt">SDA → 핀 3 (GPIO2), SCL → 핀 5 (GPIO3) 연결</span></li>
|
||||||
|
<li><span class="num"></span><span class="cbox"></span><span class="txt">풀업 저항 4.7kΩ ×2 를 SDA·SCL → 3.3V 로 연결 (모듈 내장 시 생략)</span></li>
|
||||||
|
<li><span class="num"></span><span class="cbox"></span><span class="txt">ADDR → GND 확인 (주소 0x44 선택)</span></li>
|
||||||
|
<li><span class="num"></span><span class="cbox"></span><span class="txt">결선 전체 재확인 후 Pi 전원 인가</span></li>
|
||||||
|
<li><span class="num"></span><span class="cbox"></span><span class="txt">I2C 활성화 확인 (raspi-config / dtparam=i2c_arm=on)</span></li>
|
||||||
|
<li><span class="num"></span><span class="cbox"></span><span class="txt"><code>i2cdetect -y 1</code> 실행 → <code>0x44</code> 표시 확인</span></li>
|
||||||
|
<li><span class="num"></span><span class="cbox"></span><span class="txt">config.py / config_local.py 의 I2C_BUS=1, I2C_ADDR=0x44 확인</span></li>
|
||||||
|
<li><span class="num"></span><span class="cbox"></span><span class="txt">측정 로그 및 서버 수신 확인 (5분 주기 보고 정상)</span></li>
|
||||||
|
</ol>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<footer>
|
||||||
|
온습도 노드 · Pi-B (sensor_id=2, 1번 지점/서버실) · SHT30 I2C 배선 문서 — 현장 인쇄용
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -33,7 +33,7 @@ SECRETS_DIR = DEPLOY / ".secrets"
|
||||||
# deploy/.secrets/web_dir.txt 에서 로드한다(없으면 랜덤 생성). 아래 DOMAIN 만 수정.
|
# deploy/.secrets/web_dir.txt 에서 로드한다(없으면 랜덤 생성). 아래 DOMAIN 만 수정.
|
||||||
DOMAIN = "https://pores.kr"
|
DOMAIN = "https://pores.kr"
|
||||||
|
|
||||||
TEXT_EXTS = {".sh", ".py", ".php", ".service", ".sql", ".md", ".txt", ".example"}
|
TEXT_EXTS = {".sh", ".py", ".php", ".service", ".sql", ".md", ".txt", ".example", ".html"}
|
||||||
EXCLUDE_NAMES = {"__pycache__", ".gitignore", "config_local.py"}
|
EXCLUDE_NAMES = {"__pycache__", ".gitignore", "config_local.py"}
|
||||||
|
|
||||||
BUNDLES = [
|
BUNDLES = [
|
||||||
|
|
@ -97,9 +97,12 @@ def bcrypt_hash(password: str) -> str:
|
||||||
|
|
||||||
|
|
||||||
def normalize_lf(path: Path) -> None:
|
def normalize_lf(path: Path) -> None:
|
||||||
"""번들 내 텍스트 파일 CRLF → LF (Pi bash/systemd 오류 방지)."""
|
"""번들 내 텍스트 파일 CRLF → LF (Pi bash/systemd/Apache 오류 방지).
|
||||||
|
확장자 없는 설정 dotfile(.htaccess/.gitignore 등)도 확장자와 무관하게 포함한다
|
||||||
|
(.htaccess CRLF 는 Apache Header 값에 CR 를 섞을 수 있음)."""
|
||||||
|
dotfiles = {".htaccess", ".gitignore", ".env.example"}
|
||||||
for p in path.rglob("*"):
|
for p in path.rglob("*"):
|
||||||
if p.is_file() and p.suffix in TEXT_EXTS:
|
if p.is_file() and (p.suffix in TEXT_EXTS or p.name in dotfiles):
|
||||||
data = p.read_bytes()
|
data = p.read_bytes()
|
||||||
if b"\r\n" in data:
|
if b"\r\n" in data:
|
||||||
p.write_bytes(data.replace(b"\r\n", b"\n"))
|
p.write_bytes(data.replace(b"\r\n", b"\n"))
|
||||||
|
|
@ -211,6 +214,8 @@ echo "설치·검증·하드닝 완료. 마무리 리부팅 권장: sudo reboot
|
||||||
사전: Raspberry Pi OS **Bookworm 64-bit**, 사용자 **pi**, SSH 활성(Imager 설정).
|
사전: Raspberry Pi OS **Bookworm 64-bit**, 사용자 **pi**, SSH 활성(Imager 설정).
|
||||||
`config_local.py` 는 이미 채워져 있음(API_KEY/URL/기기 ID). 설치 장소가 바뀌면 DEVICE_LOCATION 만 수정.
|
`config_local.py` 는 이미 채워져 있음(API_KEY/URL/기기 ID). 설치 장소가 바뀌면 DEVICE_LOCATION 만 수정.
|
||||||
|
|
||||||
|
📐 **배선·핀맵:** 같은 폴더의 `WIRING.html` 을 브라우저로 열어 확인(자체 완결형 — 오프라인 열람 가능).
|
||||||
|
|
||||||
## 원샷 설치 (권장)
|
## 원샷 설치 (권장)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue