diff --git a/loop-detector/fig1-methods.png b/loop-detector/fig1-methods.png
new file mode 100644
index 0000000..31edc96
Binary files /dev/null and b/loop-detector/fig1-methods.png differ
diff --git a/loop-detector/fig1-methods.svg b/loop-detector/fig1-methods.svg
new file mode 100644
index 0000000..5711dcd
--- /dev/null
+++ b/loop-detector/fig1-methods.svg
@@ -0,0 +1,87 @@
+
+
+
+
+
+
+
+ 环路车检器 · 检测方法对比与选型推荐
+ 选型核心:灵敏度(能否测摩托/自行车)× 抗干扰(变频器/电力谐波)× 成本。结论先行:主推 ①LC振荡+频率计数;复杂电磁环境上 ④;高灵敏需求上 ②。
+
+
+
+
+
+ ① LC振荡 + 频率计数 ★★★★★
+ 原理
+ 车辆进入 → 线圈等效电感↓ →
+ 振荡频率↑ → MCU 定时器测频/测周期
+ 灵敏度
+ ★★★☆ 轿车/SUV 稳定;调阈值可测摩托
+ 抗干扰
+ ★★★ 配自适应阈值 + 频偏跟踪
+ 成本
+ 低(MCU + 三极管/比较器即可)
+ 适用
+ 主流道闸/停车场/流量计数,市场 90%
+ 要点
+ 周期法优于计数法:低速/停留不丢车
+ 回差阈值防抖动;基准慢速自适应抗温漂
+ ✅ 推荐主方案:成熟、稳定、成本最优
+
+
+
+ ② PLL 锁相 / 相位比较 ★★★★
+ 原理
+ PLL 锁定振荡信号,车辆引起
+ 相位/频率误差 → 输出误差电压
+ 灵敏度
+ ★★★★★ 可测自行车/电动车/行人拖车
+ 抗干扰
+ ★★★ 环路锁定本身有滤波作用
+ 成本
+ 中(PLL IC 或 MCU 内置 PLL 外设)
+ 适用
+ 混行车道、ETC 车道、摩托车检测
+ 要点
+ 环路带宽要窄:抗抖但响应慢,需折中
+ 适合与 ① 组合做双通道校验
+ ✅ 高灵敏场景备选
+
+
+
+ ③ 电桥阻抗检测 ★★
+ 原理
+ 环路与参考臂构成平衡电桥,
+ 车辆使阻抗失衡 → 输出失调电压
+ 灵敏度
+ ★★ 中低,依赖桥臂匹配精度
+ 抗干扰
+ ★★ 温漂/老化使零位漂移严重
+ 成本
+ 低(纯模拟)
+ 适用
+ 早期产品 / 教学演示
+ 要点
+ 需定期人工调零,现场维护成本高
+ ⚠️ 不推荐量产
+
+
+
+ ④ 多频扫频 + 自适应调谐 ★★★★
+ 原理
+ DDS/扫频实时搜索谐振点,
+ 自动调谐避开干扰频段(变频器/谐波)
+ 灵敏度
+ ★★★★ 扫频带宽内全频段可调
+ 抗干扰
+ ★★★★★ 变频器干扰场景的终极解
+ 成本
+ 高(DDS/高精度 ADC + 算法)
+ 适用
+ 工业区/充电桩/变频器密集场所
+ 要点
+ 与 ① 兼容:频率计数做粗判,
+ 扫频谱特征做细判与干扰识别
+ ✅ 复杂电磁环境旗舰方案
+
\ No newline at end of file
diff --git a/loop-detector/fig2-schematic.png b/loop-detector/fig2-schematic.png
new file mode 100644
index 0000000..8fa5f67
Binary files /dev/null and b/loop-detector/fig2-schematic.png differ
diff --git a/loop-detector/fig2-schematic.svg b/loop-detector/fig2-schematic.svg
new file mode 100644
index 0000000..0d51366
--- /dev/null
+++ b/loop-detector/fig2-schematic.svg
@@ -0,0 +1,319 @@
+
+
+
+
+
+
+
+ 环路车检器原理图 — LC 振荡 + 频率计数方案(推荐①)
+ 信号链:环形线圈 → 浪涌保护 → 匹配变压器 → 谐振/考毕兹振荡 → 比较器整形 → MCU 测频判车 → 光耦隔离 → 继电器输出
+
+
+
+ VCC 5V
+
+ GND
+
+ GND(电源地)
+
+
+
+
+ 路面(切割槽)
+
+
+
+ 环形线圈 3~5 匝
+ L≈50~200μH(待现场验证)
+
+
+
+ 引线(双绞屏蔽 ≤20m)
+
+
+
+ A
+
+ B
+
+ 浪涌保护
+
+
+
+
+
+
+
+
+ TVS1
+
+
+
+
+ RV1
+
+
+
+ T1 匹配变压器 1:1~1:2
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ C1 谐振电容
+ 100~470pF
+
+
+ Cc1 10pF
+
+
+
+
+
+
+
+
+ 考毕兹振荡器(基极调谐)
+
+
+
+
+ Rb1 100k
+
+
+
+
+ Rb2 47k
+
+
+
+
+
+
+
+
+
+ C3 100p
+
+
+
+
+
+
+
+ Q1
+ S9018
+
+
+
+
+ Rc 2.2k
+
+
+
+
+
+
+ Lx 谐振
+
+
+
+
+
+
+
+ C2 100p
+
+
+
+
+
+ Cc2
+
+
+
+ U1 比较器(带回差)
+
+
+
+
+ +
+ −
+
+
+
+
+
+
+
+
+
+ Vref 分压
+ (R3/R4)
+
+ 方波输出 f≈f₀
+
+
+
+ MCU
+ STM32/GD32F103
+ · 定时器输入捕获测周期
+ · f = Fclk / period → Δf
+ · 数字滤波 + 消抖
+ · 灵敏度阈值(多档)判断
+ · 存在/通过 状态机
+ · 基准频率慢速自适应(抗温漂)
+ · 继电器输出 + 自检/看门狗
+
+ PA0 捕获
+
+ PA1
+
+
+
+
+
+
+
+
+
+ D2 状态LED
+ R6 限流
+
+
+ VDD 3.3V
+
+
+
+ U2 光耦
+
+
+
+
+
+
+
+
+
+
+
+
+
+ R5
+
+
+
+
+
+
+
+
+
+ Q2
+ N-MOS
+
+
+ D
+ S
+
+
+
+ K1
+
+
+
+
+
+
+
+
+
+
+ NO
+ NC
+ COM
+ → 道闸/PLC
+
+
+ K1 线圈接 VCC(或外供)
+
+
+
+ 电源与保护
+
+ VIN 12~24V
+
+
+
+
+
+
+ D1 防反接
+ TVS2 吸收浪涌
+
+
+ U3 LDO 5V
+
+
+ U4 LDO 3.3V
+
+
+
+
+
+
+
+
+ Cin
+
+
+
+
+ C5
+
+
+
+
+ C6
+
+
+
+ 元件图例
+ L 电感(线圈符号)
+
+ C 电容
+
+ R 电阻
+
+ TVS 双向
+
+
+ NPN 三极管
+
+
+
+
+ MOS
+
+ 继电器
+
+
+ 关键设计点:① 环路经匹配变压器隔离耦合,直连会受地环路干扰;② 谐振电容 C1 决定频段,频率 f₀≈1/(2π√(LC));③ 灵敏度=Δf 阈值,建议多档可调 + 回差;④ 基准频率上电自学习 + 慢速跟踪,抗温漂;⑤ 输出必须光耦隔离,防浪涌反灌烧 MCU;⑥ 软件加看门狗,继电器粘连检测。
+ ⚠️ 数值为典型参考:线圈电感取决于尺寸/匝数/引线长度,谐振频率推荐 20~150kHz(越低抗干扰越差、灵敏度越高,需现场折中)。
+
\ No newline at end of file
diff --git a/loop-detector/inline_svg.py b/loop-detector/inline_svg.py
new file mode 100644
index 0000000..e474484
--- /dev/null
+++ b/loop-detector/inline_svg.py
@@ -0,0 +1,68 @@
+#!/usr/bin/env python3
+"""Extract SVGs from HTML, inline styles (light theme), output standalone .svg files."""
+import re, sys, html
+
+SRC = "/root/.openclaw/workspace/loop-detector/loop-detector-principle.html"
+
+CSS = {
+ "title": {"font-size": "20px", "font-weight": "650", "fill": "#172033"},
+ "label": {"font-size": "14px", "font-weight": "600", "fill": "#172033"},
+ "small": {"font-size": "12px", "fill": "#5b6475"},
+ "tiny": {"font-size": "11px", "fill": "#5b6475"},
+ "node": {"stroke": "#64748b", "stroke-width": "1"},
+ "neutral": {"fill": "#e2e8f0"},
+ "input": {"fill": "#bfdbfe"},
+ "process": {"fill": "#c7d2fe"},
+ "storage": {"fill": "#99f6e4"},
+ "external":{"fill": "#fde68a"},
+ "risk": {"fill": "#fecaca"},
+ "edge": {"stroke": "#64748b", "stroke-width": "1.5", "fill": "none"},
+ "wire": {"stroke": "#64748b", "stroke-width": "1.3", "fill": "none"},
+ "wireb": {"stroke": "#64748b", "stroke-width": "2", "fill": "none"},
+ "zone": {"fill": "none", "stroke": "#64748b", "stroke-width": "1",
+ "stroke-dasharray": "6 5", "opacity": "0.8"},
+ "comp": {"fill": "none", "stroke": "#172033", "stroke-width": "1.6"},
+ "compf": {"fill": "#172033", "stroke": "none"},
+ "rec": {"fill": "#172033", "stroke": "none"},
+ "rec-o": {"fill": "none", "stroke": "#172033", "stroke-width": "1.4"},
+ "badge": {"fill": "#16a34a"},
+ "badge-t": {"fill": "#ffffff", "font-size": "11px", "font-weight": "700"},
+ "hl": {"stroke": "#16a34a", "stroke-width": "2.5"},
+}
+
+def inline(el):
+ classes = el.get("class", "").split()
+ merged = {}
+ for c in classes:
+ if c in CSS:
+ merged.update(CSS[c])
+ # element-level attributes override classes (fill attr etc.)
+ for attr in ("fill", "stroke", "stroke-width", "opacity"):
+ v = el.get(attr)
+ if v is not None:
+ merged[attr] = v
+ if merged:
+ style = "; ".join(f"{k}: {v}" for k, v in merged.items())
+ old = el.get("style", "")
+ el.set("style", (old + ";" + style).strip(";") if old else style)
+ el.attrib.pop("class", None)
+ for child in el:
+ inline(child)
+
+def process(svg_text, out_path):
+ # drop ", "", svg_text, flags=re.S)
+ import xml.etree.ElementTree as ET
+ root = ET.fromstring(svg_text)
+ # add width/height for predictable output
+ root.set("xmlns", "http://www.w3.org/2000/svg")
+ inline(root)
+ tree = ET.ElementTree(root)
+ tree.write(out_path, encoding="utf-8", xml_declaration=True)
+ print("wrote", out_path)
+
+data = open(SRC, encoding="utf-8").read()
+svgs = re.findall(r"", data, flags=re.S)
+print("found", len(svgs), "svgs")
+process(svgs[0], "/root/.openclaw/workspace/loop-detector/fig1-methods.svg")
+process(svgs[1], "/root/.openclaw/workspace/loop-detector/fig2-schematic.svg")
diff --git a/loop-detector/loop-detector-kicad/gen_sch.py b/loop-detector/loop-detector-kicad/gen_sch.py
new file mode 100644
index 0000000..3b53cd4
--- /dev/null
+++ b/loop-detector/loop-detector-kicad/gen_sch.py
@@ -0,0 +1,258 @@
+#!/usr/bin/env python3
+"""Generate KiCad 7 schematic (.kicad_sch) for the loop vehicle detector."""
+import re, uuid, os
+
+BASE = "/root/.openclaw/workspace/loop-detector/loop-detector-kicad"
+SYM = os.path.join(BASE, "loopdet.kicad_sym")
+SCH = os.path.join(BASE, "loop-detector.kicad_sch")
+
+def uid():
+ return str(uuid.uuid4())
+
+# ---------- extract lib_symbols from .kicad_sym ----------
+data = open(SYM, encoding="utf-8").read()
+# only extract TOP-LEVEL (symbol "X" ...) blocks: track paren depth while scanning
+sym_blocks = []
+pat = re.compile(r'\(symbol "([^"]+)"')
+# find all matches, then filter to depth-1 (inside kicad_symbol_lib only)
+depth = 0
+top_starts = []
+for m in pat.finditer(data):
+ # compute depth at match start by counting parens before it
+ prefix = data[:m.start()]
+ d = prefix.count('(') - prefix.count(')')
+ if d == 1: # directly inside kicad_symbol_lib
+ top_starts.append(m.start())
+for start in top_starts:
+ depth = 0
+ j = start
+ while j < len(data):
+ if data[j] == '(':
+ depth += 1
+ elif data[j] == ')':
+ depth -= 1
+ if depth == 0:
+ break
+ j += 1
+ sym_blocks.append(data[start:j+1])
+
+# embedded symbol names must carry the library prefix (e.g. "loopdet:C") so that
+# lib_id "loopdet:C" resolves to the embedded definition without hitting the table
+import re as _re
+def _prefix(sym_block):
+ return _re.sub(r'\(symbol "([^"]+)"', r'(symbol "loopdet:\1"', sym_block, count=1)
+lib_symbols = "(lib_symbols\n" + "\n".join(" " + _prefix(b) for b in sym_blocks) + "\n)\n"
+
+# ---------- components ----------
+# (lib, ref, value, x, y, rot, ref_at, val_at)
+COMPONENTS = [
+ ("CONN2", "J1", "CONN_2P", 40, 130, 0, (40, 136), (40, 124)),
+ ("TVS_BI", "TVS1", "TVS_BIDI", 62, 130, 0, (62, 136), (62, 124)),
+ ("XFMR", "T1", "1:1", 90, 130, 0, (90, 138), (90, 120)),
+ ("C", "C1", "100~470p", 107, 130, 90, (113, 136), (113, 124)),
+ ("Q_NPN", "Q1", "S9018", 130, 130, 0, (126.5, 136),(126.5, 124)),
+ ("R", "Rc", "2.2k", 138, 126.19,0, (134.5, 132),(134.5, 120)),
+ ("R", "Rb1", "100k", 124.92,121.5,90, (131, 121.5),(131, 117)),
+ ("R", "Rb2", "47k", 124.92,137.5,90, (131, 137.5),(131, 133)),
+ ("R", "Re", "1k", 132.54,139.5,90, (138.5, 139.5),(138.5, 135)),
+ ("C", "C2", "100p", 138, 135.5, 90, (144, 135.5),(144, 131)),
+ ("C", "Cc2", "10p", 148, 126.19,0, (148, 132), (148, 120)),
+ ("COMP", "U1", "LM393", 170, 130, 0, (170, 137), (170, 123)),
+ ("R", "R3", "10k", 150, 124, 90, (156, 124), (156, 119.5)),
+ ("R", "R4", "10k", 150, 138.5, 90, (156, 138.5),(156, 134)),
+ ("MCU", "MCU1", "STM32F103C8", 215, 130, 0, (215, 143), (215, 117)),
+ ("R", "R5", "1k", 245, 124.92,0, (245, 131), (245, 119)),
+ ("OPTO", "U2", "PC817", 265, 124.92,0, (265, 131), (265, 119)),
+ ("MOS_N", "Q2", "N-MOS", 300, 126.19,0, (296.5, 132),(296.5, 120)),
+ ("RELAY_SPDT","K1", "SPDT 12V", 325, 122.38,0, (325, 130), (325, 116)),
+ ("R", "R6", "1k", 245, 130, 0, (245, 136), (245, 124)),
+ ("LED", "D2", "LED", 280, 130, 0, (280, 136), (280, 124)),
+]
+
+# ---------- wires ----------
+WIRES = [
+ # A net: J1.p1 - TVS1.p1 - T1.p1
+ ((37.46, 127.46), (82.38, 127.46)),
+ ((59.46, 127.46), (59.46, 130)),
+ # B net: J1.p2 - TVS1.p2 - T1.p2
+ ((37.46, 132.54), (82.38, 132.54)),
+ ((64.54, 132.54), (64.54, 130)),
+ # T1 sec upper: p3 - C1.p1 - base input
+ ((97.62, 127.46), (110, 127.46)),
+ ((110, 127.46), (110, 130)),
+ ((110, 130), (124.92, 130)),
+ # T1 sec lower: p4 - C1.p2 - GND
+ ((97.62, 132.54), (107, 132.54)),
+ ((107, 132.54), (107, 145)),
+ # VCC bus
+ ((100, 115), (320, 115)),
+ ((140.54, 126.19), (140.54, 115)),
+ ((124.92, 118.96), (124.92, 115)),
+ ((150, 121.46), (150, 115)),
+ ((317.38, 119.84), (317.38, 115)),
+ # GND bus
+ ((100, 145), (340, 145)),
+ ((124.92, 140.04), (124.92, 145)),
+ ((132.54, 142.04), (132.54, 145)),
+ ((138, 138.04), (138, 145)),
+ ((257.38, 127.46), (257.38, 145)),
+ ((302.54, 130), (302.54, 145)),
+ ((282.54, 130), (282.54, 145)),
+ # base net
+ ((124.92, 124.04), (124.92, 134.96)),
+ # collector net
+ ((132.54, 126.19), (145.46, 126.19)),
+ ((138, 126.19), (138, 132.96)),
+ # emitter
+ ((132.54, 133.81), (132.54, 136.96)),
+ # comp in+
+ ((150.54, 126.19), (162.38, 126.19)),
+ ((162.38, 126.19), (162.38, 127.46)),
+ # vref
+ ((150, 126.54), (150, 135.96)),
+ ((150, 132.54), (162.38, 132.54)),
+ # comp out -> PA0
+ ((177.62, 130), (177.62, 124.92)),
+ ((177.62, 124.92), (202.3, 124.92)),
+ # PA1 -> R5
+ ((227.7, 124.92), (242.46, 124.92)),
+ # R5 -> OPTO.1
+ ((247.54, 124.92), (257.38, 124.92)),
+ ((257.38, 124.92), (257.38, 122.38)),
+ # OPTO.4 -> gate
+ ((272.62, 122.38), (294.92, 122.38)),
+ ((294.92, 122.38), (294.92, 126.19)),
+ # drain -> K1.A2
+ ((302.54, 122.38), (317.38, 122.38)),
+ ((317.38, 122.38), (317.38, 124.92)),
+ # PA2 -> R6
+ ((227.7, 130), (242.46, 130)),
+ # R6 -> D2.A
+ ((247.54, 130), (277.46, 130)),
+]
+
+# ---------- net labels ----------
+LABELS = [
+ ("VCC", (100, 115), 0),
+ ("GND", (100, 145), 0),
+ ("VCC", (227.7, 135.08), 0),
+ ("GND", (202.3, 135.08), 0),
+ ("COM", (332.62, 122.38), 0),
+ ("NO", (332.62, 117.3), 0),
+ ("NC", (332.62, 127.46), 0),
+]
+
+# ---------- texts ----------
+TEXTS = [
+ ("环路车检器原理图 — LC 振荡 + 频率计数方案(推荐①)", (20, 20), 3.5),
+ ("信号链:环形线圈 → T1 匹配变压器 → 考毕兹振荡 → 比较器整形 → MCU 测频判车 → 光耦隔离 → 继电器输出", (20, 30), 1.5),
+ ("接路面环形线圈(3~5匝,双绞屏蔽线 ≤20m)", (20, 108), 1.27),
+ ("→ 道闸控制器 / PLC 输入", (340, 114), 1.27),
+ ("【设计说明】", (20, 165), 1.5),
+ ("1) 线圈经 T1 匹配变压器隔离耦合,抗地环路干扰;", (20, 173), 1.27),
+ ("2) 谐振频率 f0 ≈ 1/(2π√(L·C1)),建议 20~150kHz(待现场验证);", (20, 181), 1.27),
+ ("3) MCU 周期法测频(输入捕获),灵敏度阈值多档可调 + 回差防抖;", (20, 189), 1.27),
+ ("4) 基准频率上电自学习 + 慢速跟踪,抗温漂(雨雪/昼夜温差);", (20, 197), 1.27),
+ ("5) 输出经光耦 U2 隔离驱动继电器 K1,防浪涌反灌烧 MCU;", (20, 205), 1.27),
+ ("6) 软件加看门狗;继电器粘连/掉线检测;", (20, 213), 1.27),
+ ("7) 电源:VIN 12~24V → 防反接 + TVS → LDO 5V → LDO 3.3V(本页未画出);", (20, 221), 1.27),
+ ("8) 相邻车道串扰:线圈间距 ≥1m,必要时交替频率;", (20, 229), 1.27),
+ ("【关键参数(参考值,待现场验证)】", (240, 165), 1.5),
+ ("C1: 100~470pF C2: 100pF", (240, 173), 1.27),
+ ("Rb1: 100k Rb2: 47k", (240, 181), 1.27),
+ ("Rc: 2.2k Re: 1k", (240, 189), 1.27),
+ ("Q1: S9018/2N3904 Q2: N-MOS", (240, 197), 1.27),
+ ("U1: LM393 比较器 U2: PC817 光耦", (240, 205), 1.27),
+ ("K1: SPDT 12V/24V 继电器", (240, 213), 1.27),
+ ("MCU: STM32F103/GD32F103", (240, 221), 1.27),
+]
+
+# ---------- build ----------
+def fmt_xy(p):
+ return f"(xy {p[0]:g} {p[1]:g})"
+
+parts = []
+ROOT_UUID = uid()
+parts.append("(kicad_sch")
+parts.append(" (version 20230121)")
+parts.append(' (generator eeschema)')
+parts.append(f" (uuid {ROOT_UUID})")
+parts.append(' (paper "A3")')
+parts.append(" (title_block")
+parts.append(' (title "Loop Vehicle Detector")')
+parts.append(' (date "2026-08-21")')
+parts.append(' (rev "1.0")')
+parts.append(' (company "xde")')
+parts.append(' (comment 1 "LC Oscillation + Frequency Counting")')
+parts.append(" )")
+parts.append("")
+# lib_symbols (indent 2)
+parts.append(lib_symbols.rstrip("\n"))
+parts.append("")
+# components
+for lib, ref, value, x, y, rot, ref_at, val_at in COMPONENTS:
+ parts.append(" (symbol")
+ parts.append(f" (lib_id \"loopdet:{lib}\")")
+ parts.append(f" (at {x:g} {y:g} {rot})")
+ parts.append(" (unit 1)")
+ parts.append(" (in_bom yes)")
+ parts.append(" (on_board yes)")
+ parts.append(" (dnp no)")
+ parts.append(f" (uuid {uid()})")
+ parts.append(f" (property \"Reference\" \"{ref}\" (at {ref_at[0]:g} {ref_at[1]:g} 0) (effects (font (size 1.27 1.27)) (justify left)))")
+ parts.append(f" (property \"Value\" \"{value}\" (at {val_at[0]:g} {val_at[1]:g} 0) (effects (font (size 1.27 1.27)) (justify left)))")
+ parts.append(f" (property \"Footprint\" \"\" (at {x:g} {y:g} 0) (effects (font (size 1.27 1.27)) hide))")
+ parts.append(f" (property \"Datasheet\" \"\" (at {x:g} {y:g} 0) (effects (font (size 1.27 1.27)) hide))")
+ # pin uuids (number of pins depends on lib)
+ PINMAP = {
+ "R": ["1", "2"], "C": ["1", "2"], "TVS_BI": ["1", "2"], "LED": ["A", "K"],
+ "Q_NPN": ["B", "C", "E"], "MOS_N": ["G", "D", "S"],
+ "XFMR": ["1", "2", "3", "4"], "OPTO": ["1", "2", "4", "3"],
+ "COMP": ["+", "-", "OUT"],
+ "MCU": ["PA0", "GND", "PA1", "PA2", "VDD"],
+ "RELAY_SPDT": ["A1", "A2", "COM", "NO", "NC"],
+ "CONN2": ["1", "2"],
+ }
+ for pn in PINMAP[lib]:
+ parts.append(f" (pin \"{pn}\" (uuid {uid()}))")
+ parts.append(" (instances")
+ parts.append(" (project \"loop-detector\"")
+ parts.append(f" (path \"/{ROOT_UUID}\"")
+ parts.append(f" (reference \"{ref}\") (unit 1)")
+ parts.append(" )")
+ parts.append(" )")
+ parts.append(" )")
+ parts.append(" )")
+parts.append("")
+# wires
+for p1, p2 in WIRES:
+ parts.append(" (wire")
+ parts.append(f" (pts {fmt_xy(p1)} {fmt_xy(p2)})")
+ parts.append(" (stroke (width 0) (type default))")
+ parts.append(f" (uuid {uid()})")
+ parts.append(" )")
+parts.append("")
+# net labels
+for name, pos, ang in LABELS:
+ parts.append(" (label")
+ parts.append(f" \"{name}\" (at {pos[0]:g} {pos[1]:g} {ang})")
+ parts.append(" (effects (font (size 1.27 1.27)) (justify left bottom))")
+ parts.append(f" (uuid {uid()})")
+ parts.append(" )")
+parts.append("")
+# texts
+for s, pos, size in TEXTS:
+ parts.append(" (text")
+ parts.append(f" \"{s}\" (at {pos[0]:g} {pos[1]:g} 0)")
+ parts.append(f" (effects (font (size {size:g} {size:g})))")
+ parts.append(f" (uuid {uid()})")
+ parts.append(" )")
+parts.append("")
+parts.append(" (sheet_instances")
+parts.append(' (path "/" (page "1"))')
+parts.append(" )")
+parts.append(")")
+
+out = "\n".join(parts) + "\n"
+open(SCH, "w", encoding="utf-8").write(out)
+print("wrote", SCH, len(out), "bytes")
diff --git a/loop-detector/loop-detector-kicad/loop-detector-preview.png b/loop-detector/loop-detector-kicad/loop-detector-preview.png
new file mode 100644
index 0000000..b82d1e2
Binary files /dev/null and b/loop-detector/loop-detector-kicad/loop-detector-preview.png differ
diff --git a/loop-detector/loop-detector-kicad/loop-detector.kicad_pro b/loop-detector/loop-detector-kicad/loop-detector.kicad_pro
new file mode 100644
index 0000000..ae4cda7
--- /dev/null
+++ b/loop-detector/loop-detector-kicad/loop-detector.kicad_pro
@@ -0,0 +1,83 @@
+{
+ "board": {
+ "design_settings": {
+ "defaults": {
+ "apply_defaults_to_fp_fields": false,
+ "apply_defaults_to_new_footprints": false
+ }
+ }
+ },
+ "boards": [],
+ "cvpcb": {
+ "equivalence_files": []
+ },
+ "erc": {
+ "erc_exclusions": [],
+ "meta": {
+ "version": 0
+ }
+ },
+ "libraries": {
+ "pinned_footprint_libs": [],
+ "pinned_symbol_libs": []
+ },
+ "meta": {
+ "filename": "loop-detector.kicad_pro",
+ "version": 1
+ },
+ "net_settings": {
+ "classes": [
+ {
+ "bus_width": 12,
+ "clearance": 0.2,
+ "diff_pair_gap": 0.25,
+ "diff_pair_via_gap": 0.25,
+ "diff_pair_width": 0.2,
+ "line_style": 0,
+ "microvia_diameter": 0.3,
+ "microvia_drill": 0.1,
+ "name": "Default",
+ "pcb_color": "rgba(0, 0, 0, 0.000)",
+ "schematic_color": "rgba(0, 0, 0, 0.000)",
+ "track_width": 0.25,
+ "via_diameter": 0.8,
+ "via_drill": 0.4,
+ "wire_width": 6
+ }
+ ],
+ "meta": {
+ "version": 3
+ },
+ "net_colors": null,
+ "netclass_assignments": null,
+ "netclass_patterns": []
+ },
+ "pcbnew": {
+ "last_paths": {
+ "gencad": "",
+ "netlist": "",
+ "plot": "",
+ "pos": "",
+ "specctra_dsn": "",
+ "step": "",
+ "svg": "",
+ "vrml": ""
+ },
+ "page_layout_descr_file": ""
+ },
+ "schematic": {
+ "legacy_lib_dir": "",
+ "legacy_lib_list": [],
+ "meta": {
+ "version": 1
+ },
+ "page_layout_descr_file": ""
+ },
+ "sheets": [
+ [
+ "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa",
+ "Root"
+ ]
+ ],
+ "text_variables": {}
+}
diff --git a/loop-detector/loop-detector-kicad/loop-detector.kicad_sch b/loop-detector/loop-detector-kicad/loop-detector.kicad_sch
new file mode 100644
index 0000000..25d4097
--- /dev/null
+++ b/loop-detector/loop-detector-kicad/loop-detector.kicad_sch
@@ -0,0 +1,1227 @@
+(kicad_sch
+ (version 20230121)
+ (generator eeschema)
+ (uuid 917e639c-8969-4741-a7cd-e315437b423c)
+ (paper "A3")
+ (title_block
+ (title "Loop Vehicle Detector")
+ (date "2026-08-21")
+ (rev "1.0")
+ (company "xde")
+ (comment 1 "LC Oscillation + Frequency Counting")
+ )
+
+(lib_symbols
+ (symbol "loopdet:R"
+ (pin_numbers hide) (pin_names (offset 0))
+ (in_bom yes)
+ (on_board yes)
+ (property "Reference" "R" (at 0 2.54 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Value" "R" (at 0 -2.54 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Footprint" "" (at 0 0 0) (effects (font (size 1.27 1.27)) hide))
+ (property "Datasheet" "" (at 0 0 0) (effects (font (size 1.27 1.27)) hide))
+ (symbol "R_0_1"
+ (rectangle (start -1.27 -1.27) (end 1.27 1.27)
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ )
+ (symbol "R_1_1"
+ (pin passive line (at -2.54 0 0) (length 1.27)
+ (name "~" (effects (font (size 1.27 1.27))))
+ (number "1" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at 2.54 0 0) (length 1.27)
+ (name "~" (effects (font (size 1.27 1.27))))
+ (number "2" (effects (font (size 1.27 1.27)))))
+ )
+ )
+ (symbol "loopdet:C"
+ (pin_numbers hide) (pin_names (offset 0))
+ (in_bom yes)
+ (on_board yes)
+ (property "Reference" "C" (at 0 2.54 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Value" "C" (at 0 -2.54 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Footprint" "" (at 0 0 0) (effects (font (size 1.27 1.27)) hide))
+ (property "Datasheet" "" (at 0 0 0) (effects (font (size 1.27 1.27)) hide))
+ (symbol "C_0_1"
+ (polyline (pts (xy -0.635 -1.905) (xy -0.635 1.905))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy 0.635 -1.905) (xy 0.635 1.905))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ )
+ (symbol "C_1_1"
+ (pin passive line (at -2.54 0 0) (length 1.27)
+ (name "~" (effects (font (size 1.27 1.27))))
+ (number "1" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at 2.54 0 0) (length 1.27)
+ (name "~" (effects (font (size 1.27 1.27))))
+ (number "2" (effects (font (size 1.27 1.27)))))
+ )
+ )
+ (symbol "loopdet:Q_NPN"
+ (pin_numbers hide) (pin_names (offset 0))
+ (in_bom yes)
+ (on_board yes)
+ (property "Reference" "Q" (at -5.08 6.35 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Value" "Q" (at -5.08 -6.35 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Footprint" "" (at 0 0 0) (effects (font (size 1.27 1.27)) hide))
+ (property "Datasheet" "" (at 0 0 0) (effects (font (size 1.27 1.27)) hide))
+ (symbol "Q_NPN_0_1"
+ (circle (center 0 0) (radius 1.27)
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy -3.81 0) (xy -1.27 0))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy 0 0) (xy 1.27 -2.54) (xy 1.27 -3.81))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy 0 0) (xy 1.27 2.54) (xy 1.27 3.81))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy 1.02 1.78) (xy 1.45 1.65) (xy 1.35 2.2))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ )
+ (symbol "Q_NPN_1_1"
+ (pin passive line (at -5.08 0 0) (length 1.27)
+ (name "B" (effects (font (size 1.27 1.27))))
+ (number "B" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at 2.54 -3.81 90) (length 1.27)
+ (name "C" (effects (font (size 1.27 1.27))))
+ (number "C" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at 2.54 3.81 270) (length 1.27)
+ (name "E" (effects (font (size 1.27 1.27))))
+ (number "E" (effects (font (size 1.27 1.27)))))
+ )
+ )
+ (symbol "loopdet:MOS_N"
+ (pin_numbers hide) (pin_names (offset 0))
+ (in_bom yes)
+ (on_board yes)
+ (property "Reference" "Q" (at -5.08 6.35 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Value" "Q" (at -5.08 -6.35 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Footprint" "" (at 0 0 0) (effects (font (size 1.27 1.27)) hide))
+ (property "Datasheet" "" (at 0 0 0) (effects (font (size 1.27 1.27)) hide))
+ (symbol "MOS_N_0_1"
+ (polyline (pts (xy -3.81 0) (xy -1.27 0))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy -1.27 -3.81) (xy -1.27 3.81))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy 0 -3.81) (xy 0 3.81))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy 0 -3.81) (xy 2.54 -3.81))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy 0 3.81) (xy 2.54 3.81))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy 1.27 1.2) (xy 0.45 0) (xy 1.27 -1.2))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ )
+ (symbol "MOS_N_1_1"
+ (pin passive line (at -5.08 0 0) (length 1.27)
+ (name "G" (effects (font (size 1.27 1.27))))
+ (number "G" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at 2.54 -3.81 90) (length 1.27)
+ (name "D" (effects (font (size 1.27 1.27))))
+ (number "D" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at 2.54 3.81 270) (length 1.27)
+ (name "S" (effects (font (size 1.27 1.27))))
+ (number "S" (effects (font (size 1.27 1.27)))))
+ )
+ )
+ (symbol "loopdet:LED"
+ (pin_numbers hide) (pin_names (offset 0))
+ (in_bom yes)
+ (on_board yes)
+ (property "Reference" "D" (at 0 2.54 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Value" "D" (at 0 -2.54 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Footprint" "" (at 0 0 0) (effects (font (size 1.27 1.27)) hide))
+ (property "Datasheet" "" (at 0 0 0) (effects (font (size 1.27 1.27)) hide))
+ (symbol "LED_0_1"
+ (polyline (pts (xy -1.27 -1.27) (xy -1.27 1.27) (xy 1.27 0) (xy -1.27 -1.27))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy 1.27 -1.27) (xy 1.27 1.27))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy 1.27 0) (xy 2.54 0))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy -2.29 -1.02) (xy -1.52 -0.51))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy -2.29 -1.4) (xy -1.52 -0.89))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ )
+ (symbol "LED_1_1"
+ (pin passive line (at -2.54 0 0) (length 1.27)
+ (name "A" (effects (font (size 1.27 1.27))))
+ (number "A" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at 2.54 0 0) (length 1.27)
+ (name "K" (effects (font (size 1.27 1.27))))
+ (number "K" (effects (font (size 1.27 1.27)))))
+ )
+ )
+ (symbol "loopdet:TVS_BI"
+ (pin_numbers hide) (pin_names (offset 0))
+ (in_bom yes)
+ (on_board yes)
+ (property "Reference" "TVS" (at 0 2.54 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Value" "TVS" (at 0 -2.54 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Footprint" "" (at 0 0 0) (effects (font (size 1.27 1.27)) hide))
+ (property "Datasheet" "" (at 0 0 0) (effects (font (size 1.27 1.27)) hide))
+ (symbol "TVS_BI_0_1"
+ (polyline (pts (xy -1.27 -1.27) (xy -1.27 1.27) (xy 0 0) (xy -1.27 -1.27))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy 1.27 -1.27) (xy 1.27 1.27) (xy 0 0) (xy 1.27 -1.27))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy -3.81 0) (xy -1.27 0))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy 1.27 0) (xy 3.81 0))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ )
+ (symbol "TVS_BI_1_1"
+ (pin passive line (at -2.54 0 0) (length 1.27)
+ (name "~" (effects (font (size 1.27 1.27))))
+ (number "1" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at 2.54 0 0) (length 1.27)
+ (name "~" (effects (font (size 1.27 1.27))))
+ (number "2" (effects (font (size 1.27 1.27)))))
+ )
+ )
+ (symbol "loopdet:XFMR"
+ (pin_numbers hide) (pin_names (offset 0))
+ (in_bom yes)
+ (on_board yes)
+ (property "Reference" "T" (at -7.62 5.08 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Value" "T" (at -7.62 -5.08 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Footprint" "" (at 0 0 0) (effects (font (size 1.27 1.27)) hide))
+ (property "Datasheet" "" (at 0 0 0) (effects (font (size 1.27 1.27)) hide))
+ (symbol "XFMR_0_1"
+ (polyline (pts (xy -2.54 -2.54) (xy -1.27 -1.27) (xy -3.81 -1.27) (xy -1.27 1.27) (xy -3.81 1.27) (xy -2.54 2.54))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy 2.54 -2.54) (xy 1.27 -1.27) (xy 3.81 -1.27) (xy 1.27 1.27) (xy 3.81 1.27) (xy 2.54 2.54))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy -0.635 -2.54) (xy -0.635 2.54))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy 0.635 -2.54) (xy 0.635 2.54))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (circle (center -2.54 -2.54) (radius 0.4)
+ (stroke (width 0.254) (type default)) (fill (type outline)))
+ (circle (center 2.54 -2.54) (radius 0.4)
+ (stroke (width 0.254) (type default)) (fill (type outline)))
+ (polyline (pts (xy -6.35 -2.54) (xy -2.54 -2.54))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy -6.35 2.54) (xy -2.54 2.54))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy 2.54 -2.54) (xy 6.35 -2.54))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy 2.54 2.54) (xy 6.35 2.54))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ )
+ (symbol "XFMR_1_1"
+ (pin passive line (at -7.62 -2.54 0) (length 1.27)
+ (name "~" (effects (font (size 1.27 1.27))))
+ (number "1" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at -7.62 2.54 0) (length 1.27)
+ (name "~" (effects (font (size 1.27 1.27))))
+ (number "2" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at 7.62 -2.54 180) (length 1.27)
+ (name "~" (effects (font (size 1.27 1.27))))
+ (number "3" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at 7.62 2.54 180) (length 1.27)
+ (name "~" (effects (font (size 1.27 1.27))))
+ (number "4" (effects (font (size 1.27 1.27)))))
+ )
+ )
+ (symbol "loopdet:OPTO"
+ (pin_numbers hide) (pin_names (offset 0))
+ (in_bom yes)
+ (on_board yes)
+ (property "Reference" "U" (at -7.62 5.08 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Value" "U" (at -7.62 -5.08 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Footprint" "" (at 0 0 0) (effects (font (size 1.27 1.27)) hide))
+ (property "Datasheet" "" (at 0 0 0) (effects (font (size 1.27 1.27)) hide))
+ (symbol "OPTO_0_1"
+ (rectangle (start -5.08 -3.81) (end 5.08 3.81)
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (text "OPTO" (at 0 0 0) (effects (font (size 1.27 1.27))))
+ (polyline (pts (xy -6.35 -2.54) (xy -4.32 -2.54))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy -4.32 -2.54) (xy -3.3 -2.54) (xy -3.81 -1.4) (xy -4.32 -2.54))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy -6.35 2.54) (xy -3.81 2.54) (xy -3.81 -1.4))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (circle (center 2.54 0) (radius 1.27)
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy 2.54 0) (xy 3.81 -1.27) (xy 3.81 -2.54) (xy 6.35 -2.54))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy 2.54 0) (xy 3.81 1.27) (xy 3.81 2.54) (xy 6.35 2.54))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy -1.9 -0.9) (xy -0.6 0.3))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy -1.9 -0.3) (xy -0.6 0.9))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ )
+ (symbol "OPTO_1_1"
+ (pin passive line (at -7.62 -2.54 0) (length 1.27)
+ (name "A" (effects (font (size 1.27 1.27))))
+ (number "1" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at -7.62 2.54 0) (length 1.27)
+ (name "K" (effects (font (size 1.27 1.27))))
+ (number "2" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at 7.62 -2.54 180) (length 1.27)
+ (name "C" (effects (font (size 1.27 1.27))))
+ (number "4" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at 7.62 2.54 180) (length 1.27)
+ (name "E" (effects (font (size 1.27 1.27))))
+ (number "3" (effects (font (size 1.27 1.27)))))
+ )
+ )
+ (symbol "loopdet:COMP"
+ (pin_numbers hide) (pin_names (offset 0))
+ (in_bom yes)
+ (on_board yes)
+ (property "Reference" "U" (at -7.62 5.08 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Value" "U" (at -7.62 -5.08 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Footprint" "" (at 0 0 0) (effects (font (size 1.27 1.27)) hide))
+ (property "Datasheet" "" (at 0 0 0) (effects (font (size 1.27 1.27)) hide))
+ (symbol "COMP_0_1"
+ (polyline (pts (xy -6.35 -2.54) (xy -6.35 2.54) (xy 6.35 0) (xy -6.35 -2.54))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (text "+" (at -5.7 -2.29 0) (effects (font (size 1.27 1.27))))
+ (text "-" (at -5.7 1.4 0) (effects (font (size 1.27 1.27))))
+ )
+ (symbol "COMP_1_1"
+ (pin passive line (at -7.62 -2.54 0) (length 1.27)
+ (name "+" (effects (font (size 1.27 1.27))))
+ (number "+" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at -7.62 2.54 0) (length 1.27)
+ (name "-" (effects (font (size 1.27 1.27))))
+ (number "-" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at 7.62 0 180) (length 1.27)
+ (name "OUT" (effects (font (size 1.27 1.27))))
+ (number "OUT" (effects (font (size 1.27 1.27)))))
+ )
+ )
+ (symbol "loopdet:MCU"
+ (pin_numbers hide) (pin_names (offset 0))
+ (in_bom yes)
+ (on_board yes)
+ (property "Reference" "U" (at 0 12.7 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Value" "U" (at 0 -12.7 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Footprint" "" (at 0 0 0) (effects (font (size 1.27 1.27)) hide))
+ (property "Datasheet" "" (at 0 0 0) (effects (font (size 1.27 1.27)) hide))
+ (symbol "MCU_0_1"
+ (rectangle (start -12.7 -10.16) (end 12.7 10.16)
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (text "MCU" (at 0 -5.08 0) (effects (font (size 1.27 1.27))))
+ (text "STM32/GD32" (at 0 -2.54 0) (effects (font (size 1.27 1.27))))
+ )
+ (symbol "MCU_1_1"
+ (pin passive line (at -12.7 -5.08 0) (length 1.27)
+ (name "PA0" (effects (font (size 1.27 1.27))))
+ (number "PA0" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at -12.7 5.08 0) (length 1.27)
+ (name "GND" (effects (font (size 1.27 1.27))))
+ (number "GND" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at 12.7 -5.08 180) (length 1.27)
+ (name "PA1" (effects (font (size 1.27 1.27))))
+ (number "PA1" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at 12.7 0 180) (length 1.27)
+ (name "PA2" (effects (font (size 1.27 1.27))))
+ (number "PA2" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at 12.7 5.08 180) (length 1.27)
+ (name "VDD" (effects (font (size 1.27 1.27))))
+ (number "VDD" (effects (font (size 1.27 1.27)))))
+ )
+ )
+ (symbol "loopdet:RELAY_SPDT"
+ (pin_numbers hide) (pin_names (offset 0))
+ (in_bom yes)
+ (on_board yes)
+ (property "Reference" "K" (at -7.62 6.35 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Value" "K" (at -7.62 -6.35 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Footprint" "" (at 0 0 0) (effects (font (size 1.27 1.27)) hide))
+ (property "Datasheet" "" (at 0 0 0) (effects (font (size 1.27 1.27)) hide))
+ (symbol "RELAY_SPDT_0_1"
+ (rectangle (start -5.08 -2.54) (end 2.54 2.54)
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy -5.08 -1.9) (xy 2.54 1.9))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy -6.35 -2.54) (xy -5.08 -2.54))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy -6.35 2.54) (xy -5.08 2.54))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy 2.54 0) (xy 5.08 0))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy 5.08 0) (xy 5.08 5.08))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy 5.08 5.08) (xy 6.35 5.08))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy 5.08 -5.08) (xy 6.35 -5.08))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (circle (center 5.08 0) (radius 0.4)
+ (stroke (width 0.254) (type default)) (fill (type outline)))
+ (circle (center 5.08 -5.08) (radius 0.4)
+ (stroke (width 0.254) (type default)) (fill (type outline)))
+ (circle (center 5.08 5.08) (radius 0.4)
+ (stroke (width 0.254) (type default)) (fill (type outline)))
+ )
+ (symbol "RELAY_SPDT_1_1"
+ (pin passive line (at -7.62 -2.54 0) (length 1.27)
+ (name "A1" (effects (font (size 1.27 1.27))))
+ (number "A1" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at -7.62 2.54 0) (length 1.27)
+ (name "A2" (effects (font (size 1.27 1.27))))
+ (number "A2" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at 7.62 0 180) (length 1.27)
+ (name "COM" (effects (font (size 1.27 1.27))))
+ (number "COM" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at 7.62 -5.08 180) (length 1.27)
+ (name "NO" (effects (font (size 1.27 1.27))))
+ (number "NO" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at 7.62 5.08 180) (length 1.27)
+ (name "NC" (effects (font (size 1.27 1.27))))
+ (number "NC" (effects (font (size 1.27 1.27)))))
+ )
+ )
+ (symbol "loopdet:CONN2"
+ (pin_numbers hide) (pin_names (offset 0))
+ (in_bom yes)
+ (on_board yes)
+ (property "Reference" "J" (at -2.54 5.08 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Value" "J" (at -2.54 -5.08 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Footprint" "" (at 0 0 0) (effects (font (size 1.27 1.27)) hide))
+ (property "Datasheet" "" (at 0 0 0) (effects (font (size 1.27 1.27)) hide))
+ (symbol "CONN2_0_1"
+ (polyline (pts (xy -3.81 -3.81) (xy -3.81 3.81))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (circle (center -2.54 -2.54) (radius 1.27)
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (circle (center -2.54 2.54) (radius 1.27)
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ )
+ (symbol "CONN2_1_1"
+ (pin passive line (at -2.54 -2.54 0) (length 1.27)
+ (name "~" (effects (font (size 1.27 1.27))))
+ (number "1" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at -2.54 2.54 0) (length 1.27)
+ (name "~" (effects (font (size 1.27 1.27))))
+ (number "2" (effects (font (size 1.27 1.27)))))
+ )
+ )
+)
+
+ (symbol
+ (lib_id "loopdet:CONN2")
+ (at 40 130 0)
+ (unit 1)
+ (in_bom yes)
+ (on_board yes)
+ (dnp no)
+ (uuid 01046d86-af27-4167-b252-c68ba92c0bda)
+ (property "Reference" "J1" (at 40 136 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Value" "CONN_2P" (at 40 124 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Footprint" "" (at 40 130 0) (effects (font (size 1.27 1.27)) hide))
+ (property "Datasheet" "" (at 40 130 0) (effects (font (size 1.27 1.27)) hide))
+ (pin "1" (uuid 8b48ede8-977d-4004-8bc3-6275f142d33c))
+ (pin "2" (uuid e3d8749a-3afc-48f6-9132-313ec124f83b))
+ (instances
+ (project "loop-detector"
+ (path "/917e639c-8969-4741-a7cd-e315437b423c"
+ (reference "J1") (unit 1)
+ )
+ )
+ )
+ )
+ (symbol
+ (lib_id "loopdet:TVS_BI")
+ (at 62 130 0)
+ (unit 1)
+ (in_bom yes)
+ (on_board yes)
+ (dnp no)
+ (uuid 4591721c-3bec-4e0a-b7c0-bbc1735dddde)
+ (property "Reference" "TVS1" (at 62 136 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Value" "TVS_BIDI" (at 62 124 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Footprint" "" (at 62 130 0) (effects (font (size 1.27 1.27)) hide))
+ (property "Datasheet" "" (at 62 130 0) (effects (font (size 1.27 1.27)) hide))
+ (pin "1" (uuid c304ae8b-e9e1-45e6-9886-b71e31d279c5))
+ (pin "2" (uuid f88f6887-b278-4850-bc3b-87c1540b7d17))
+ (instances
+ (project "loop-detector"
+ (path "/917e639c-8969-4741-a7cd-e315437b423c"
+ (reference "TVS1") (unit 1)
+ )
+ )
+ )
+ )
+ (symbol
+ (lib_id "loopdet:XFMR")
+ (at 90 130 0)
+ (unit 1)
+ (in_bom yes)
+ (on_board yes)
+ (dnp no)
+ (uuid e3c9353e-019f-4197-a582-20f83278a09e)
+ (property "Reference" "T1" (at 90 138 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Value" "1:1" (at 90 120 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Footprint" "" (at 90 130 0) (effects (font (size 1.27 1.27)) hide))
+ (property "Datasheet" "" (at 90 130 0) (effects (font (size 1.27 1.27)) hide))
+ (pin "1" (uuid 9a2eb224-fc74-4a43-aa54-24bf9e205867))
+ (pin "2" (uuid d03f6cb4-11af-4cc6-a776-c5506b459e9d))
+ (pin "3" (uuid e2bb26b7-07bf-45de-9447-165a33013fc5))
+ (pin "4" (uuid de701d4a-cb1d-460c-945f-6960d6bd9be5))
+ (instances
+ (project "loop-detector"
+ (path "/917e639c-8969-4741-a7cd-e315437b423c"
+ (reference "T1") (unit 1)
+ )
+ )
+ )
+ )
+ (symbol
+ (lib_id "loopdet:C")
+ (at 107 130 90)
+ (unit 1)
+ (in_bom yes)
+ (on_board yes)
+ (dnp no)
+ (uuid bc885103-240e-4319-845d-383b7e6cb926)
+ (property "Reference" "C1" (at 113 136 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Value" "100~470p" (at 113 124 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Footprint" "" (at 107 130 0) (effects (font (size 1.27 1.27)) hide))
+ (property "Datasheet" "" (at 107 130 0) (effects (font (size 1.27 1.27)) hide))
+ (pin "1" (uuid dbfb3d82-6baa-4d46-a5c5-6efedcde19e3))
+ (pin "2" (uuid e6047de4-8348-4350-9caa-876ce8a64f2a))
+ (instances
+ (project "loop-detector"
+ (path "/917e639c-8969-4741-a7cd-e315437b423c"
+ (reference "C1") (unit 1)
+ )
+ )
+ )
+ )
+ (symbol
+ (lib_id "loopdet:Q_NPN")
+ (at 130 130 0)
+ (unit 1)
+ (in_bom yes)
+ (on_board yes)
+ (dnp no)
+ (uuid 8c58dd2f-468e-431b-8acc-ab83730df4ab)
+ (property "Reference" "Q1" (at 126.5 136 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Value" "S9018" (at 126.5 124 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Footprint" "" (at 130 130 0) (effects (font (size 1.27 1.27)) hide))
+ (property "Datasheet" "" (at 130 130 0) (effects (font (size 1.27 1.27)) hide))
+ (pin "B" (uuid 16a195a4-3c70-4412-aebb-25e65c2b310e))
+ (pin "C" (uuid a8dfd8b7-fd80-4c31-a33e-e59fa7dde2da))
+ (pin "E" (uuid 2af69a0d-5b53-46e3-9a9c-4806934f086e))
+ (instances
+ (project "loop-detector"
+ (path "/917e639c-8969-4741-a7cd-e315437b423c"
+ (reference "Q1") (unit 1)
+ )
+ )
+ )
+ )
+ (symbol
+ (lib_id "loopdet:R")
+ (at 138 126.19 0)
+ (unit 1)
+ (in_bom yes)
+ (on_board yes)
+ (dnp no)
+ (uuid 59a28a21-33ec-4e39-868f-771dcddb9260)
+ (property "Reference" "Rc" (at 134.5 132 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Value" "2.2k" (at 134.5 120 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Footprint" "" (at 138 126.19 0) (effects (font (size 1.27 1.27)) hide))
+ (property "Datasheet" "" (at 138 126.19 0) (effects (font (size 1.27 1.27)) hide))
+ (pin "1" (uuid 112d4bad-ba84-4ecd-983a-e168e6839843))
+ (pin "2" (uuid c700f3c2-3890-42c4-b00c-51e4f045e546))
+ (instances
+ (project "loop-detector"
+ (path "/917e639c-8969-4741-a7cd-e315437b423c"
+ (reference "Rc") (unit 1)
+ )
+ )
+ )
+ )
+ (symbol
+ (lib_id "loopdet:R")
+ (at 124.92 121.5 90)
+ (unit 1)
+ (in_bom yes)
+ (on_board yes)
+ (dnp no)
+ (uuid 1a3ff4f3-4206-4355-8345-4e9ca70db1fa)
+ (property "Reference" "Rb1" (at 131 121.5 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Value" "100k" (at 131 117 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Footprint" "" (at 124.92 121.5 0) (effects (font (size 1.27 1.27)) hide))
+ (property "Datasheet" "" (at 124.92 121.5 0) (effects (font (size 1.27 1.27)) hide))
+ (pin "1" (uuid b5c7f263-a320-4b0c-aa94-f98cdbb1ce7d))
+ (pin "2" (uuid c139d282-71ab-4782-b07f-7c2aaa781f33))
+ (instances
+ (project "loop-detector"
+ (path "/917e639c-8969-4741-a7cd-e315437b423c"
+ (reference "Rb1") (unit 1)
+ )
+ )
+ )
+ )
+ (symbol
+ (lib_id "loopdet:R")
+ (at 124.92 137.5 90)
+ (unit 1)
+ (in_bom yes)
+ (on_board yes)
+ (dnp no)
+ (uuid 2be15983-251d-4658-a3f2-dcb5c49d7177)
+ (property "Reference" "Rb2" (at 131 137.5 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Value" "47k" (at 131 133 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Footprint" "" (at 124.92 137.5 0) (effects (font (size 1.27 1.27)) hide))
+ (property "Datasheet" "" (at 124.92 137.5 0) (effects (font (size 1.27 1.27)) hide))
+ (pin "1" (uuid aee94ef4-a731-43d9-8760-8da8ef06b460))
+ (pin "2" (uuid 69fa797d-62be-40e8-b2ba-d62b3fb34965))
+ (instances
+ (project "loop-detector"
+ (path "/917e639c-8969-4741-a7cd-e315437b423c"
+ (reference "Rb2") (unit 1)
+ )
+ )
+ )
+ )
+ (symbol
+ (lib_id "loopdet:R")
+ (at 132.54 139.5 90)
+ (unit 1)
+ (in_bom yes)
+ (on_board yes)
+ (dnp no)
+ (uuid efaced13-7255-4efa-a919-9717c3e6001a)
+ (property "Reference" "Re" (at 138.5 139.5 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Value" "1k" (at 138.5 135 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Footprint" "" (at 132.54 139.5 0) (effects (font (size 1.27 1.27)) hide))
+ (property "Datasheet" "" (at 132.54 139.5 0) (effects (font (size 1.27 1.27)) hide))
+ (pin "1" (uuid 1ba36158-170d-4eba-a385-678d617e661c))
+ (pin "2" (uuid b6fcd8ce-5077-4171-87c9-d6b68c525732))
+ (instances
+ (project "loop-detector"
+ (path "/917e639c-8969-4741-a7cd-e315437b423c"
+ (reference "Re") (unit 1)
+ )
+ )
+ )
+ )
+ (symbol
+ (lib_id "loopdet:C")
+ (at 138 135.5 90)
+ (unit 1)
+ (in_bom yes)
+ (on_board yes)
+ (dnp no)
+ (uuid d1ee6b38-791a-46f5-ae25-8227d71c855f)
+ (property "Reference" "C2" (at 144 135.5 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Value" "100p" (at 144 131 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Footprint" "" (at 138 135.5 0) (effects (font (size 1.27 1.27)) hide))
+ (property "Datasheet" "" (at 138 135.5 0) (effects (font (size 1.27 1.27)) hide))
+ (pin "1" (uuid ddce6d6d-9aa7-4998-b0e9-24f6e18ede1c))
+ (pin "2" (uuid 19dcb023-dac9-45a8-9ee7-d05b403191a9))
+ (instances
+ (project "loop-detector"
+ (path "/917e639c-8969-4741-a7cd-e315437b423c"
+ (reference "C2") (unit 1)
+ )
+ )
+ )
+ )
+ (symbol
+ (lib_id "loopdet:C")
+ (at 148 126.19 0)
+ (unit 1)
+ (in_bom yes)
+ (on_board yes)
+ (dnp no)
+ (uuid 69a97627-f353-4432-b886-dbdce9b2b1a0)
+ (property "Reference" "Cc2" (at 148 132 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Value" "10p" (at 148 120 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Footprint" "" (at 148 126.19 0) (effects (font (size 1.27 1.27)) hide))
+ (property "Datasheet" "" (at 148 126.19 0) (effects (font (size 1.27 1.27)) hide))
+ (pin "1" (uuid 3c57ee68-69a6-4bc2-b727-59c3f1123ffb))
+ (pin "2" (uuid 16472ee1-b07e-4cc2-b472-390998a61ee8))
+ (instances
+ (project "loop-detector"
+ (path "/917e639c-8969-4741-a7cd-e315437b423c"
+ (reference "Cc2") (unit 1)
+ )
+ )
+ )
+ )
+ (symbol
+ (lib_id "loopdet:COMP")
+ (at 170 130 0)
+ (unit 1)
+ (in_bom yes)
+ (on_board yes)
+ (dnp no)
+ (uuid 9c62d887-f8d8-436d-86aa-16464dea9461)
+ (property "Reference" "U1" (at 170 137 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Value" "LM393" (at 170 123 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Footprint" "" (at 170 130 0) (effects (font (size 1.27 1.27)) hide))
+ (property "Datasheet" "" (at 170 130 0) (effects (font (size 1.27 1.27)) hide))
+ (pin "+" (uuid 6e1b6fa1-29c2-4508-8bbc-c0e1996de265))
+ (pin "-" (uuid 980ce6ce-8acc-468b-998a-1e762374fc61))
+ (pin "OUT" (uuid 647641fb-d480-4ac7-9b92-9db7ac664ea7))
+ (instances
+ (project "loop-detector"
+ (path "/917e639c-8969-4741-a7cd-e315437b423c"
+ (reference "U1") (unit 1)
+ )
+ )
+ )
+ )
+ (symbol
+ (lib_id "loopdet:R")
+ (at 150 124 90)
+ (unit 1)
+ (in_bom yes)
+ (on_board yes)
+ (dnp no)
+ (uuid 6bba5e54-bd27-49e9-82e4-cbc291b3eefc)
+ (property "Reference" "R3" (at 156 124 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Value" "10k" (at 156 119.5 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Footprint" "" (at 150 124 0) (effects (font (size 1.27 1.27)) hide))
+ (property "Datasheet" "" (at 150 124 0) (effects (font (size 1.27 1.27)) hide))
+ (pin "1" (uuid f388e2a3-eddc-4efd-a6f6-2aeaed90c39c))
+ (pin "2" (uuid d165542e-4b95-4c66-9002-e9426fa7f938))
+ (instances
+ (project "loop-detector"
+ (path "/917e639c-8969-4741-a7cd-e315437b423c"
+ (reference "R3") (unit 1)
+ )
+ )
+ )
+ )
+ (symbol
+ (lib_id "loopdet:R")
+ (at 150 138.5 90)
+ (unit 1)
+ (in_bom yes)
+ (on_board yes)
+ (dnp no)
+ (uuid afe2663b-7257-41e7-a3f5-853655634a69)
+ (property "Reference" "R4" (at 156 138.5 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Value" "10k" (at 156 134 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Footprint" "" (at 150 138.5 0) (effects (font (size 1.27 1.27)) hide))
+ (property "Datasheet" "" (at 150 138.5 0) (effects (font (size 1.27 1.27)) hide))
+ (pin "1" (uuid b9c55aeb-4919-41ba-9232-45b6b8907176))
+ (pin "2" (uuid f021e72e-3b6b-47c8-b85a-3ec7f84e8636))
+ (instances
+ (project "loop-detector"
+ (path "/917e639c-8969-4741-a7cd-e315437b423c"
+ (reference "R4") (unit 1)
+ )
+ )
+ )
+ )
+ (symbol
+ (lib_id "loopdet:MCU")
+ (at 215 130 0)
+ (unit 1)
+ (in_bom yes)
+ (on_board yes)
+ (dnp no)
+ (uuid d712d6e3-b30f-4971-9ded-c0299a15af6b)
+ (property "Reference" "MCU1" (at 215 143 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Value" "STM32F103C8" (at 215 117 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Footprint" "" (at 215 130 0) (effects (font (size 1.27 1.27)) hide))
+ (property "Datasheet" "" (at 215 130 0) (effects (font (size 1.27 1.27)) hide))
+ (pin "PA0" (uuid d6d0307d-a5aa-4af8-8255-2df2ffee7beb))
+ (pin "GND" (uuid 48b49d28-6fb5-4c4a-8617-9c10711199a7))
+ (pin "PA1" (uuid 3d3b3488-2cbd-45b8-8df5-d497e75d98b5))
+ (pin "PA2" (uuid e797aaab-8b4d-4e46-93ce-73642e4af72a))
+ (pin "VDD" (uuid a08af161-b09a-4b78-b1c8-bdddb4b33135))
+ (instances
+ (project "loop-detector"
+ (path "/917e639c-8969-4741-a7cd-e315437b423c"
+ (reference "MCU1") (unit 1)
+ )
+ )
+ )
+ )
+ (symbol
+ (lib_id "loopdet:R")
+ (at 245 124.92 0)
+ (unit 1)
+ (in_bom yes)
+ (on_board yes)
+ (dnp no)
+ (uuid b4ce073d-1701-4695-8688-15808ae5f049)
+ (property "Reference" "R5" (at 245 131 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Value" "1k" (at 245 119 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Footprint" "" (at 245 124.92 0) (effects (font (size 1.27 1.27)) hide))
+ (property "Datasheet" "" (at 245 124.92 0) (effects (font (size 1.27 1.27)) hide))
+ (pin "1" (uuid 4e2a9854-aaa0-43f7-947e-6ccc5f728205))
+ (pin "2" (uuid 3af6f78f-3ed3-4f95-a7a7-169bec56b47d))
+ (instances
+ (project "loop-detector"
+ (path "/917e639c-8969-4741-a7cd-e315437b423c"
+ (reference "R5") (unit 1)
+ )
+ )
+ )
+ )
+ (symbol
+ (lib_id "loopdet:OPTO")
+ (at 265 124.92 0)
+ (unit 1)
+ (in_bom yes)
+ (on_board yes)
+ (dnp no)
+ (uuid b99e826d-ec66-4bde-9e15-6a6d2700f29a)
+ (property "Reference" "U2" (at 265 131 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Value" "PC817" (at 265 119 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Footprint" "" (at 265 124.92 0) (effects (font (size 1.27 1.27)) hide))
+ (property "Datasheet" "" (at 265 124.92 0) (effects (font (size 1.27 1.27)) hide))
+ (pin "1" (uuid b8386cc1-4913-4c32-86bd-212e0dcd24e3))
+ (pin "2" (uuid 3e38d597-fec2-456c-bd3d-b25bef43d2e3))
+ (pin "4" (uuid d657f13c-5a8f-4e41-935c-68c68eb49109))
+ (pin "3" (uuid 2354e975-31cc-46e0-a3bb-96eda20a6a92))
+ (instances
+ (project "loop-detector"
+ (path "/917e639c-8969-4741-a7cd-e315437b423c"
+ (reference "U2") (unit 1)
+ )
+ )
+ )
+ )
+ (symbol
+ (lib_id "loopdet:MOS_N")
+ (at 300 126.19 0)
+ (unit 1)
+ (in_bom yes)
+ (on_board yes)
+ (dnp no)
+ (uuid dd4a1440-ec4d-4f8e-bd8d-d3a2a89aea69)
+ (property "Reference" "Q2" (at 296.5 132 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Value" "N-MOS" (at 296.5 120 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Footprint" "" (at 300 126.19 0) (effects (font (size 1.27 1.27)) hide))
+ (property "Datasheet" "" (at 300 126.19 0) (effects (font (size 1.27 1.27)) hide))
+ (pin "G" (uuid f9f9dff7-7c42-4513-97d0-06811a17790d))
+ (pin "D" (uuid 3b01aa45-94ef-44e2-91c8-25943d36ad6a))
+ (pin "S" (uuid 2a88d91f-979e-4468-8ff4-81061d38ef2a))
+ (instances
+ (project "loop-detector"
+ (path "/917e639c-8969-4741-a7cd-e315437b423c"
+ (reference "Q2") (unit 1)
+ )
+ )
+ )
+ )
+ (symbol
+ (lib_id "loopdet:RELAY_SPDT")
+ (at 325 122.38 0)
+ (unit 1)
+ (in_bom yes)
+ (on_board yes)
+ (dnp no)
+ (uuid 31314a73-08a0-4298-bbd2-9020d1bbd40a)
+ (property "Reference" "K1" (at 325 130 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Value" "SPDT 12V" (at 325 116 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Footprint" "" (at 325 122.38 0) (effects (font (size 1.27 1.27)) hide))
+ (property "Datasheet" "" (at 325 122.38 0) (effects (font (size 1.27 1.27)) hide))
+ (pin "A1" (uuid 9e626a50-d7c4-4885-90ec-5483a8cca57b))
+ (pin "A2" (uuid 75cb38a6-4d3d-4dcb-b8bb-ce8faf3d5d30))
+ (pin "COM" (uuid 9b7d4f72-368e-4861-8cdf-db85825335ae))
+ (pin "NO" (uuid 0eabbed2-aec6-4aae-8a15-f3652f14d8a0))
+ (pin "NC" (uuid ee791c92-8373-4214-befe-0dd4ba6721aa))
+ (instances
+ (project "loop-detector"
+ (path "/917e639c-8969-4741-a7cd-e315437b423c"
+ (reference "K1") (unit 1)
+ )
+ )
+ )
+ )
+ (symbol
+ (lib_id "loopdet:R")
+ (at 245 130 0)
+ (unit 1)
+ (in_bom yes)
+ (on_board yes)
+ (dnp no)
+ (uuid 644d70a5-b21f-4d9c-a4fa-91b10e7f4f88)
+ (property "Reference" "R6" (at 245 136 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Value" "1k" (at 245 124 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Footprint" "" (at 245 130 0) (effects (font (size 1.27 1.27)) hide))
+ (property "Datasheet" "" (at 245 130 0) (effects (font (size 1.27 1.27)) hide))
+ (pin "1" (uuid 1f1dc9e3-9b26-4ca3-9f50-a193a9934240))
+ (pin "2" (uuid e21c7faf-3dfc-4d3d-bb2a-b9d01ef2fbb7))
+ (instances
+ (project "loop-detector"
+ (path "/917e639c-8969-4741-a7cd-e315437b423c"
+ (reference "R6") (unit 1)
+ )
+ )
+ )
+ )
+ (symbol
+ (lib_id "loopdet:LED")
+ (at 280 130 0)
+ (unit 1)
+ (in_bom yes)
+ (on_board yes)
+ (dnp no)
+ (uuid 42686a82-f471-41ba-925c-54b522ffd643)
+ (property "Reference" "D2" (at 280 136 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Value" "LED" (at 280 124 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Footprint" "" (at 280 130 0) (effects (font (size 1.27 1.27)) hide))
+ (property "Datasheet" "" (at 280 130 0) (effects (font (size 1.27 1.27)) hide))
+ (pin "A" (uuid efd219e3-269d-49b5-bb31-2ab361d50612))
+ (pin "K" (uuid 5724bbc4-3883-4574-b2d6-052aff2a9622))
+ (instances
+ (project "loop-detector"
+ (path "/917e639c-8969-4741-a7cd-e315437b423c"
+ (reference "D2") (unit 1)
+ )
+ )
+ )
+ )
+
+ (wire
+ (pts (xy 37.46 127.46) (xy 82.38 127.46))
+ (stroke (width 0) (type default))
+ (uuid 545ae53f-15b6-43a9-9c76-a6842bd6d3da)
+ )
+ (wire
+ (pts (xy 59.46 127.46) (xy 59.46 130))
+ (stroke (width 0) (type default))
+ (uuid 2bf29a38-165e-4ac3-8b25-8c5d41fe876b)
+ )
+ (wire
+ (pts (xy 37.46 132.54) (xy 82.38 132.54))
+ (stroke (width 0) (type default))
+ (uuid d49026db-0152-4f34-baf2-712570fba1cb)
+ )
+ (wire
+ (pts (xy 64.54 132.54) (xy 64.54 130))
+ (stroke (width 0) (type default))
+ (uuid eb28d488-d1aa-4aa1-9921-e8b7ca3248d6)
+ )
+ (wire
+ (pts (xy 97.62 127.46) (xy 110 127.46))
+ (stroke (width 0) (type default))
+ (uuid ab210182-6476-4991-a63e-271628889bac)
+ )
+ (wire
+ (pts (xy 110 127.46) (xy 110 130))
+ (stroke (width 0) (type default))
+ (uuid 01a584d8-7895-4627-a64c-8929b989ccfe)
+ )
+ (wire
+ (pts (xy 110 130) (xy 124.92 130))
+ (stroke (width 0) (type default))
+ (uuid 58bbaddc-13b6-4073-a58c-74be719f0a90)
+ )
+ (wire
+ (pts (xy 97.62 132.54) (xy 107 132.54))
+ (stroke (width 0) (type default))
+ (uuid 64e51751-3c82-4ecf-9f6b-3cc96e815457)
+ )
+ (wire
+ (pts (xy 107 132.54) (xy 107 145))
+ (stroke (width 0) (type default))
+ (uuid 44d2c10a-4808-4273-a1d3-44ec48d9616a)
+ )
+ (wire
+ (pts (xy 100 115) (xy 320 115))
+ (stroke (width 0) (type default))
+ (uuid 152a69e0-7718-4a0d-8387-ed92ab5a35dd)
+ )
+ (wire
+ (pts (xy 140.54 126.19) (xy 140.54 115))
+ (stroke (width 0) (type default))
+ (uuid 4b87bc3f-fa02-442d-840b-6ed8d271df9c)
+ )
+ (wire
+ (pts (xy 124.92 118.96) (xy 124.92 115))
+ (stroke (width 0) (type default))
+ (uuid 004cd83a-4e6a-45b5-a678-d2ae145d3766)
+ )
+ (wire
+ (pts (xy 150 121.46) (xy 150 115))
+ (stroke (width 0) (type default))
+ (uuid ce2f697f-01d5-4854-b435-719c0c80b131)
+ )
+ (wire
+ (pts (xy 317.38 119.84) (xy 317.38 115))
+ (stroke (width 0) (type default))
+ (uuid 89c99768-749f-4a9d-bc78-d3c52ea4d7e7)
+ )
+ (wire
+ (pts (xy 100 145) (xy 340 145))
+ (stroke (width 0) (type default))
+ (uuid b298bd84-86a8-419d-b3ba-94fcb0bcb439)
+ )
+ (wire
+ (pts (xy 124.92 140.04) (xy 124.92 145))
+ (stroke (width 0) (type default))
+ (uuid 1646131f-e409-4277-84e7-3c218a310d34)
+ )
+ (wire
+ (pts (xy 132.54 142.04) (xy 132.54 145))
+ (stroke (width 0) (type default))
+ (uuid 5167a147-a906-4fd2-851c-a0b4617a1e70)
+ )
+ (wire
+ (pts (xy 138 138.04) (xy 138 145))
+ (stroke (width 0) (type default))
+ (uuid 24c6cea4-3b74-4812-8690-0a9d55b5b200)
+ )
+ (wire
+ (pts (xy 257.38 127.46) (xy 257.38 145))
+ (stroke (width 0) (type default))
+ (uuid 4a0e66ab-a43c-46d5-ac15-6cd5f1e5dbcf)
+ )
+ (wire
+ (pts (xy 302.54 130) (xy 302.54 145))
+ (stroke (width 0) (type default))
+ (uuid e385b62f-816e-4646-87f0-d71edf3e6b9b)
+ )
+ (wire
+ (pts (xy 282.54 130) (xy 282.54 145))
+ (stroke (width 0) (type default))
+ (uuid 7d81b15e-1ffa-4edb-8d42-29932f49dd60)
+ )
+ (wire
+ (pts (xy 124.92 124.04) (xy 124.92 134.96))
+ (stroke (width 0) (type default))
+ (uuid 49abd69e-c376-43df-90fb-c781c8ceadf6)
+ )
+ (wire
+ (pts (xy 132.54 126.19) (xy 145.46 126.19))
+ (stroke (width 0) (type default))
+ (uuid 5f6ebd92-54c9-4ec0-b00b-ea04d1364a12)
+ )
+ (wire
+ (pts (xy 138 126.19) (xy 138 132.96))
+ (stroke (width 0) (type default))
+ (uuid 7ec6a395-906f-4219-b85e-9e7e3b3addd6)
+ )
+ (wire
+ (pts (xy 132.54 133.81) (xy 132.54 136.96))
+ (stroke (width 0) (type default))
+ (uuid fa99a1d3-bc54-437b-bd12-770e24655273)
+ )
+ (wire
+ (pts (xy 150.54 126.19) (xy 162.38 126.19))
+ (stroke (width 0) (type default))
+ (uuid 944a9fd3-7ee1-4aa2-ba7e-9a425921f9dc)
+ )
+ (wire
+ (pts (xy 162.38 126.19) (xy 162.38 127.46))
+ (stroke (width 0) (type default))
+ (uuid dcc6a66d-9143-4ba8-ae0c-145adadf83e2)
+ )
+ (wire
+ (pts (xy 150 126.54) (xy 150 135.96))
+ (stroke (width 0) (type default))
+ (uuid 24e02206-181f-4e08-9d83-07012eaa584c)
+ )
+ (wire
+ (pts (xy 150 132.54) (xy 162.38 132.54))
+ (stroke (width 0) (type default))
+ (uuid c3aa4a74-8c79-4e16-af67-41523a996897)
+ )
+ (wire
+ (pts (xy 177.62 130) (xy 177.62 124.92))
+ (stroke (width 0) (type default))
+ (uuid 94fc71ad-b846-4f6b-a81f-5406659feb5f)
+ )
+ (wire
+ (pts (xy 177.62 124.92) (xy 202.3 124.92))
+ (stroke (width 0) (type default))
+ (uuid 92d6501b-4a8c-4089-9754-38bfe4f10811)
+ )
+ (wire
+ (pts (xy 227.7 124.92) (xy 242.46 124.92))
+ (stroke (width 0) (type default))
+ (uuid f1b07593-61e1-4b7b-911c-25a017fc3802)
+ )
+ (wire
+ (pts (xy 247.54 124.92) (xy 257.38 124.92))
+ (stroke (width 0) (type default))
+ (uuid a1fe5a34-282b-4866-83c9-f51c24a2c01c)
+ )
+ (wire
+ (pts (xy 257.38 124.92) (xy 257.38 122.38))
+ (stroke (width 0) (type default))
+ (uuid 83e24ced-1b8c-46c5-8d4f-3aa39e108c24)
+ )
+ (wire
+ (pts (xy 272.62 122.38) (xy 294.92 122.38))
+ (stroke (width 0) (type default))
+ (uuid fe1ac683-926b-4ecc-880e-a797fae47ac1)
+ )
+ (wire
+ (pts (xy 294.92 122.38) (xy 294.92 126.19))
+ (stroke (width 0) (type default))
+ (uuid 764e00be-eee8-4b57-bc7b-e272a0c9b747)
+ )
+ (wire
+ (pts (xy 302.54 122.38) (xy 317.38 122.38))
+ (stroke (width 0) (type default))
+ (uuid 90b971f4-e0c3-42a9-be1a-81256ac35460)
+ )
+ (wire
+ (pts (xy 317.38 122.38) (xy 317.38 124.92))
+ (stroke (width 0) (type default))
+ (uuid 00f5499d-60c8-49f3-b99c-b091ed0d29ec)
+ )
+ (wire
+ (pts (xy 227.7 130) (xy 242.46 130))
+ (stroke (width 0) (type default))
+ (uuid c3049bf0-ca09-41a3-9372-2c10fca7b823)
+ )
+ (wire
+ (pts (xy 247.54 130) (xy 277.46 130))
+ (stroke (width 0) (type default))
+ (uuid 224e0e3c-0a3a-4534-9569-6a277d0c42c3)
+ )
+
+ (label
+ "VCC" (at 100 115 0)
+ (effects (font (size 1.27 1.27)) (justify left bottom))
+ (uuid 74f632a4-1fbe-48fc-9886-d6a3375aa4de)
+ )
+ (label
+ "GND" (at 100 145 0)
+ (effects (font (size 1.27 1.27)) (justify left bottom))
+ (uuid 8ef7f55e-dddf-41cc-942e-a060b480ab65)
+ )
+ (label
+ "VCC" (at 227.7 135.08 0)
+ (effects (font (size 1.27 1.27)) (justify left bottom))
+ (uuid 95678c0e-0fd7-43eb-9614-0a9b83f27832)
+ )
+ (label
+ "GND" (at 202.3 135.08 0)
+ (effects (font (size 1.27 1.27)) (justify left bottom))
+ (uuid 92e67b83-cfc2-47c8-9bd1-5a9ff24e1843)
+ )
+ (label
+ "COM" (at 332.62 122.38 0)
+ (effects (font (size 1.27 1.27)) (justify left bottom))
+ (uuid 184d364e-9a44-4362-9275-abb857f78c67)
+ )
+ (label
+ "NO" (at 332.62 117.3 0)
+ (effects (font (size 1.27 1.27)) (justify left bottom))
+ (uuid 135b1e62-d8e5-4920-82a0-00cb6917a778)
+ )
+ (label
+ "NC" (at 332.62 127.46 0)
+ (effects (font (size 1.27 1.27)) (justify left bottom))
+ (uuid 3edffab5-5b15-4574-a4ca-585d6137d6ce)
+ )
+
+ (text
+ "环路车检器原理图 — LC 振荡 + 频率计数方案(推荐①)" (at 20 20 0)
+ (effects (font (size 3.5 3.5)))
+ (uuid c18dcf24-ecc9-4b28-8795-4bf8404d7147)
+ )
+ (text
+ "信号链:环形线圈 → T1 匹配变压器 → 考毕兹振荡 → 比较器整形 → MCU 测频判车 → 光耦隔离 → 继电器输出" (at 20 30 0)
+ (effects (font (size 1.5 1.5)))
+ (uuid 216d793d-02f3-43b3-8150-0512a6f87663)
+ )
+ (text
+ "接路面环形线圈(3~5匝,双绞屏蔽线 ≤20m)" (at 20 108 0)
+ (effects (font (size 1.27 1.27)))
+ (uuid 1bc1031e-e9d9-42d4-8a1d-38a25d8c914d)
+ )
+ (text
+ "→ 道闸控制器 / PLC 输入" (at 340 114 0)
+ (effects (font (size 1.27 1.27)))
+ (uuid c30f0055-618b-46ce-a954-f84ee2fcdf30)
+ )
+ (text
+ "【设计说明】" (at 20 165 0)
+ (effects (font (size 1.5 1.5)))
+ (uuid 716ac27f-c7c9-41cf-abee-6ec850144056)
+ )
+ (text
+ "1) 线圈经 T1 匹配变压器隔离耦合,抗地环路干扰;" (at 20 173 0)
+ (effects (font (size 1.27 1.27)))
+ (uuid 466022c9-0df0-4a84-876e-af5a979ed464)
+ )
+ (text
+ "2) 谐振频率 f0 ≈ 1/(2π√(L·C1)),建议 20~150kHz(待现场验证);" (at 20 181 0)
+ (effects (font (size 1.27 1.27)))
+ (uuid 3e92821d-56fd-4e1a-b271-edb9e09db336)
+ )
+ (text
+ "3) MCU 周期法测频(输入捕获),灵敏度阈值多档可调 + 回差防抖;" (at 20 189 0)
+ (effects (font (size 1.27 1.27)))
+ (uuid a5add007-733d-4812-a824-d1e1eb1b14a4)
+ )
+ (text
+ "4) 基准频率上电自学习 + 慢速跟踪,抗温漂(雨雪/昼夜温差);" (at 20 197 0)
+ (effects (font (size 1.27 1.27)))
+ (uuid 11047f29-7fa5-4a76-94b9-2ac58c004f15)
+ )
+ (text
+ "5) 输出经光耦 U2 隔离驱动继电器 K1,防浪涌反灌烧 MCU;" (at 20 205 0)
+ (effects (font (size 1.27 1.27)))
+ (uuid 764d62f8-21b8-4fb2-88a1-6b2880a4f675)
+ )
+ (text
+ "6) 软件加看门狗;继电器粘连/掉线检测;" (at 20 213 0)
+ (effects (font (size 1.27 1.27)))
+ (uuid 8762c434-11f7-4859-99d8-3491ab4fe71f)
+ )
+ (text
+ "7) 电源:VIN 12~24V → 防反接 + TVS → LDO 5V → LDO 3.3V(本页未画出);" (at 20 221 0)
+ (effects (font (size 1.27 1.27)))
+ (uuid 1faa7b11-3033-4c6c-b14e-4beaf4d77a72)
+ )
+ (text
+ "8) 相邻车道串扰:线圈间距 ≥1m,必要时交替频率;" (at 20 229 0)
+ (effects (font (size 1.27 1.27)))
+ (uuid 544998ca-23ba-4374-8dd4-8bb627106041)
+ )
+ (text
+ "【关键参数(参考值,待现场验证)】" (at 240 165 0)
+ (effects (font (size 1.5 1.5)))
+ (uuid 2f75e06f-1eac-4b1b-b759-19712d260214)
+ )
+ (text
+ "C1: 100~470pF C2: 100pF" (at 240 173 0)
+ (effects (font (size 1.27 1.27)))
+ (uuid ce3ae00b-1922-47b3-9513-f04b4fc04513)
+ )
+ (text
+ "Rb1: 100k Rb2: 47k" (at 240 181 0)
+ (effects (font (size 1.27 1.27)))
+ (uuid 6a3aa436-06ff-43ce-b15e-398c30610362)
+ )
+ (text
+ "Rc: 2.2k Re: 1k" (at 240 189 0)
+ (effects (font (size 1.27 1.27)))
+ (uuid e515c8ed-69b4-44de-ad33-9fe55c9d17e5)
+ )
+ (text
+ "Q1: S9018/2N3904 Q2: N-MOS" (at 240 197 0)
+ (effects (font (size 1.27 1.27)))
+ (uuid f38ae584-c37c-4a63-8981-5265db26b4c1)
+ )
+ (text
+ "U1: LM393 比较器 U2: PC817 光耦" (at 240 205 0)
+ (effects (font (size 1.27 1.27)))
+ (uuid ceebcb08-164e-4367-98f7-adbefd012ea4)
+ )
+ (text
+ "K1: SPDT 12V/24V 继电器" (at 240 213 0)
+ (effects (font (size 1.27 1.27)))
+ (uuid d04562bd-c750-4ce7-8239-cfee6a365ac5)
+ )
+ (text
+ "MCU: STM32F103/GD32F103" (at 240 221 0)
+ (effects (font (size 1.27 1.27)))
+ (uuid 2924f0f4-a864-48b8-9aa7-d5dd2eb7b2f5)
+ )
+
+ (sheet_instances
+ (path "/" (page "1"))
+ )
+)
diff --git a/loop-detector/loop-detector-kicad/loop-detector.pdf b/loop-detector/loop-detector-kicad/loop-detector.pdf
new file mode 100644
index 0000000..14de51f
Binary files /dev/null and b/loop-detector/loop-detector-kicad/loop-detector.pdf differ
diff --git a/loop-detector/loop-detector-kicad/loopdet.kicad_sym b/loop-detector/loop-detector-kicad/loopdet.kicad_sym
new file mode 100644
index 0000000..9a2f791
--- /dev/null
+++ b/loop-detector/loop-detector-kicad/loopdet.kicad_sym
@@ -0,0 +1,392 @@
+(kicad_symbol_lib
+ (version 20220914)
+ (generator "xde")
+ (symbol "R"
+ (pin_numbers hide) (pin_names (offset 0))
+ (in_bom yes)
+ (on_board yes)
+ (property "Reference" "R" (at 0 2.54 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Value" "R" (at 0 -2.54 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Footprint" "" (at 0 0 0) (effects (font (size 1.27 1.27)) hide))
+ (property "Datasheet" "" (at 0 0 0) (effects (font (size 1.27 1.27)) hide))
+ (symbol "R_0_1"
+ (rectangle (start -1.27 -1.27) (end 1.27 1.27)
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ )
+ (symbol "R_1_1"
+ (pin passive line (at -2.54 0 0) (length 1.27)
+ (name "~" (effects (font (size 1.27 1.27))))
+ (number "1" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at 2.54 0 0) (length 1.27)
+ (name "~" (effects (font (size 1.27 1.27))))
+ (number "2" (effects (font (size 1.27 1.27)))))
+ )
+ )
+ (symbol "C"
+ (pin_numbers hide) (pin_names (offset 0))
+ (in_bom yes)
+ (on_board yes)
+ (property "Reference" "C" (at 0 2.54 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Value" "C" (at 0 -2.54 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Footprint" "" (at 0 0 0) (effects (font (size 1.27 1.27)) hide))
+ (property "Datasheet" "" (at 0 0 0) (effects (font (size 1.27 1.27)) hide))
+ (symbol "C_0_1"
+ (polyline (pts (xy -0.635 -1.905) (xy -0.635 1.905))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy 0.635 -1.905) (xy 0.635 1.905))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ )
+ (symbol "C_1_1"
+ (pin passive line (at -2.54 0 0) (length 1.27)
+ (name "~" (effects (font (size 1.27 1.27))))
+ (number "1" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at 2.54 0 0) (length 1.27)
+ (name "~" (effects (font (size 1.27 1.27))))
+ (number "2" (effects (font (size 1.27 1.27)))))
+ )
+ )
+ (symbol "Q_NPN"
+ (pin_numbers hide) (pin_names (offset 0))
+ (in_bom yes)
+ (on_board yes)
+ (property "Reference" "Q" (at -5.08 6.35 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Value" "Q" (at -5.08 -6.35 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Footprint" "" (at 0 0 0) (effects (font (size 1.27 1.27)) hide))
+ (property "Datasheet" "" (at 0 0 0) (effects (font (size 1.27 1.27)) hide))
+ (symbol "Q_NPN_0_1"
+ (circle (center 0 0) (radius 1.27)
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy -3.81 0) (xy -1.27 0))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy 0 0) (xy 1.27 -2.54) (xy 1.27 -3.81))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy 0 0) (xy 1.27 2.54) (xy 1.27 3.81))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy 1.02 1.78) (xy 1.45 1.65) (xy 1.35 2.2))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ )
+ (symbol "Q_NPN_1_1"
+ (pin passive line (at -5.08 0 0) (length 1.27)
+ (name "B" (effects (font (size 1.27 1.27))))
+ (number "B" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at 2.54 -3.81 90) (length 1.27)
+ (name "C" (effects (font (size 1.27 1.27))))
+ (number "C" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at 2.54 3.81 270) (length 1.27)
+ (name "E" (effects (font (size 1.27 1.27))))
+ (number "E" (effects (font (size 1.27 1.27)))))
+ )
+ )
+ (symbol "MOS_N"
+ (pin_numbers hide) (pin_names (offset 0))
+ (in_bom yes)
+ (on_board yes)
+ (property "Reference" "Q" (at -5.08 6.35 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Value" "Q" (at -5.08 -6.35 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Footprint" "" (at 0 0 0) (effects (font (size 1.27 1.27)) hide))
+ (property "Datasheet" "" (at 0 0 0) (effects (font (size 1.27 1.27)) hide))
+ (symbol "MOS_N_0_1"
+ (polyline (pts (xy -3.81 0) (xy -1.27 0))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy -1.27 -3.81) (xy -1.27 3.81))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy 0 -3.81) (xy 0 3.81))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy 0 -3.81) (xy 2.54 -3.81))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy 0 3.81) (xy 2.54 3.81))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy 1.27 1.2) (xy 0.45 0) (xy 1.27 -1.2))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ )
+ (symbol "MOS_N_1_1"
+ (pin passive line (at -5.08 0 0) (length 1.27)
+ (name "G" (effects (font (size 1.27 1.27))))
+ (number "G" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at 2.54 -3.81 90) (length 1.27)
+ (name "D" (effects (font (size 1.27 1.27))))
+ (number "D" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at 2.54 3.81 270) (length 1.27)
+ (name "S" (effects (font (size 1.27 1.27))))
+ (number "S" (effects (font (size 1.27 1.27)))))
+ )
+ )
+ (symbol "LED"
+ (pin_numbers hide) (pin_names (offset 0))
+ (in_bom yes)
+ (on_board yes)
+ (property "Reference" "D" (at 0 2.54 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Value" "D" (at 0 -2.54 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Footprint" "" (at 0 0 0) (effects (font (size 1.27 1.27)) hide))
+ (property "Datasheet" "" (at 0 0 0) (effects (font (size 1.27 1.27)) hide))
+ (symbol "LED_0_1"
+ (polyline (pts (xy -1.27 -1.27) (xy -1.27 1.27) (xy 1.27 0) (xy -1.27 -1.27))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy 1.27 -1.27) (xy 1.27 1.27))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy 1.27 0) (xy 2.54 0))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy -2.29 -1.02) (xy -1.52 -0.51))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy -2.29 -1.4) (xy -1.52 -0.89))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ )
+ (symbol "LED_1_1"
+ (pin passive line (at -2.54 0 0) (length 1.27)
+ (name "A" (effects (font (size 1.27 1.27))))
+ (number "A" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at 2.54 0 0) (length 1.27)
+ (name "K" (effects (font (size 1.27 1.27))))
+ (number "K" (effects (font (size 1.27 1.27)))))
+ )
+ )
+ (symbol "TVS_BI"
+ (pin_numbers hide) (pin_names (offset 0))
+ (in_bom yes)
+ (on_board yes)
+ (property "Reference" "TVS" (at 0 2.54 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Value" "TVS" (at 0 -2.54 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Footprint" "" (at 0 0 0) (effects (font (size 1.27 1.27)) hide))
+ (property "Datasheet" "" (at 0 0 0) (effects (font (size 1.27 1.27)) hide))
+ (symbol "TVS_BI_0_1"
+ (polyline (pts (xy -1.27 -1.27) (xy -1.27 1.27) (xy 0 0) (xy -1.27 -1.27))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy 1.27 -1.27) (xy 1.27 1.27) (xy 0 0) (xy 1.27 -1.27))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy -3.81 0) (xy -1.27 0))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy 1.27 0) (xy 3.81 0))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ )
+ (symbol "TVS_BI_1_1"
+ (pin passive line (at -2.54 0 0) (length 1.27)
+ (name "~" (effects (font (size 1.27 1.27))))
+ (number "1" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at 2.54 0 0) (length 1.27)
+ (name "~" (effects (font (size 1.27 1.27))))
+ (number "2" (effects (font (size 1.27 1.27)))))
+ )
+ )
+ (symbol "XFMR"
+ (pin_numbers hide) (pin_names (offset 0))
+ (in_bom yes)
+ (on_board yes)
+ (property "Reference" "T" (at -7.62 5.08 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Value" "T" (at -7.62 -5.08 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Footprint" "" (at 0 0 0) (effects (font (size 1.27 1.27)) hide))
+ (property "Datasheet" "" (at 0 0 0) (effects (font (size 1.27 1.27)) hide))
+ (symbol "XFMR_0_1"
+ (polyline (pts (xy -2.54 -2.54) (xy -1.27 -1.27) (xy -3.81 -1.27) (xy -1.27 1.27) (xy -3.81 1.27) (xy -2.54 2.54))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy 2.54 -2.54) (xy 1.27 -1.27) (xy 3.81 -1.27) (xy 1.27 1.27) (xy 3.81 1.27) (xy 2.54 2.54))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy -0.635 -2.54) (xy -0.635 2.54))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy 0.635 -2.54) (xy 0.635 2.54))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (circle (center -2.54 -2.54) (radius 0.4)
+ (stroke (width 0.254) (type default)) (fill (type outline)))
+ (circle (center 2.54 -2.54) (radius 0.4)
+ (stroke (width 0.254) (type default)) (fill (type outline)))
+ (polyline (pts (xy -6.35 -2.54) (xy -2.54 -2.54))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy -6.35 2.54) (xy -2.54 2.54))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy 2.54 -2.54) (xy 6.35 -2.54))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy 2.54 2.54) (xy 6.35 2.54))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ )
+ (symbol "XFMR_1_1"
+ (pin passive line (at -7.62 -2.54 0) (length 1.27)
+ (name "~" (effects (font (size 1.27 1.27))))
+ (number "1" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at -7.62 2.54 0) (length 1.27)
+ (name "~" (effects (font (size 1.27 1.27))))
+ (number "2" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at 7.62 -2.54 180) (length 1.27)
+ (name "~" (effects (font (size 1.27 1.27))))
+ (number "3" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at 7.62 2.54 180) (length 1.27)
+ (name "~" (effects (font (size 1.27 1.27))))
+ (number "4" (effects (font (size 1.27 1.27)))))
+ )
+ )
+ (symbol "OPTO"
+ (pin_numbers hide) (pin_names (offset 0))
+ (in_bom yes)
+ (on_board yes)
+ (property "Reference" "U" (at -7.62 5.08 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Value" "U" (at -7.62 -5.08 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Footprint" "" (at 0 0 0) (effects (font (size 1.27 1.27)) hide))
+ (property "Datasheet" "" (at 0 0 0) (effects (font (size 1.27 1.27)) hide))
+ (symbol "OPTO_0_1"
+ (rectangle (start -5.08 -3.81) (end 5.08 3.81)
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (text "OPTO" (at 0 0 0) (effects (font (size 1.27 1.27))))
+ (polyline (pts (xy -6.35 -2.54) (xy -4.32 -2.54))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy -4.32 -2.54) (xy -3.3 -2.54) (xy -3.81 -1.4) (xy -4.32 -2.54))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy -6.35 2.54) (xy -3.81 2.54) (xy -3.81 -1.4))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (circle (center 2.54 0) (radius 1.27)
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy 2.54 0) (xy 3.81 -1.27) (xy 3.81 -2.54) (xy 6.35 -2.54))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy 2.54 0) (xy 3.81 1.27) (xy 3.81 2.54) (xy 6.35 2.54))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy -1.9 -0.9) (xy -0.6 0.3))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy -1.9 -0.3) (xy -0.6 0.9))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ )
+ (symbol "OPTO_1_1"
+ (pin passive line (at -7.62 -2.54 0) (length 1.27)
+ (name "A" (effects (font (size 1.27 1.27))))
+ (number "1" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at -7.62 2.54 0) (length 1.27)
+ (name "K" (effects (font (size 1.27 1.27))))
+ (number "2" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at 7.62 -2.54 180) (length 1.27)
+ (name "C" (effects (font (size 1.27 1.27))))
+ (number "4" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at 7.62 2.54 180) (length 1.27)
+ (name "E" (effects (font (size 1.27 1.27))))
+ (number "3" (effects (font (size 1.27 1.27)))))
+ )
+ )
+ (symbol "COMP"
+ (pin_numbers hide) (pin_names (offset 0))
+ (in_bom yes)
+ (on_board yes)
+ (property "Reference" "U" (at -7.62 5.08 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Value" "U" (at -7.62 -5.08 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Footprint" "" (at 0 0 0) (effects (font (size 1.27 1.27)) hide))
+ (property "Datasheet" "" (at 0 0 0) (effects (font (size 1.27 1.27)) hide))
+ (symbol "COMP_0_1"
+ (polyline (pts (xy -6.35 -2.54) (xy -6.35 2.54) (xy 6.35 0) (xy -6.35 -2.54))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (text "+" (at -5.7 -2.29 0) (effects (font (size 1.27 1.27))))
+ (text "-" (at -5.7 1.4 0) (effects (font (size 1.27 1.27))))
+ )
+ (symbol "COMP_1_1"
+ (pin passive line (at -7.62 -2.54 0) (length 1.27)
+ (name "+" (effects (font (size 1.27 1.27))))
+ (number "+" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at -7.62 2.54 0) (length 1.27)
+ (name "-" (effects (font (size 1.27 1.27))))
+ (number "-" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at 7.62 0 180) (length 1.27)
+ (name "OUT" (effects (font (size 1.27 1.27))))
+ (number "OUT" (effects (font (size 1.27 1.27)))))
+ )
+ )
+ (symbol "MCU"
+ (pin_numbers hide) (pin_names (offset 0))
+ (in_bom yes)
+ (on_board yes)
+ (property "Reference" "U" (at 0 12.7 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Value" "U" (at 0 -12.7 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Footprint" "" (at 0 0 0) (effects (font (size 1.27 1.27)) hide))
+ (property "Datasheet" "" (at 0 0 0) (effects (font (size 1.27 1.27)) hide))
+ (symbol "MCU_0_1"
+ (rectangle (start -12.7 -10.16) (end 12.7 10.16)
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (text "MCU" (at 0 -5.08 0) (effects (font (size 1.27 1.27))))
+ (text "STM32/GD32" (at 0 -2.54 0) (effects (font (size 1.27 1.27))))
+ )
+ (symbol "MCU_1_1"
+ (pin passive line (at -12.7 -5.08 0) (length 1.27)
+ (name "PA0" (effects (font (size 1.27 1.27))))
+ (number "PA0" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at -12.7 5.08 0) (length 1.27)
+ (name "GND" (effects (font (size 1.27 1.27))))
+ (number "GND" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at 12.7 -5.08 180) (length 1.27)
+ (name "PA1" (effects (font (size 1.27 1.27))))
+ (number "PA1" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at 12.7 0 180) (length 1.27)
+ (name "PA2" (effects (font (size 1.27 1.27))))
+ (number "PA2" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at 12.7 5.08 180) (length 1.27)
+ (name "VDD" (effects (font (size 1.27 1.27))))
+ (number "VDD" (effects (font (size 1.27 1.27)))))
+ )
+ )
+ (symbol "RELAY_SPDT"
+ (pin_numbers hide) (pin_names (offset 0))
+ (in_bom yes)
+ (on_board yes)
+ (property "Reference" "K" (at -7.62 6.35 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Value" "K" (at -7.62 -6.35 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Footprint" "" (at 0 0 0) (effects (font (size 1.27 1.27)) hide))
+ (property "Datasheet" "" (at 0 0 0) (effects (font (size 1.27 1.27)) hide))
+ (symbol "RELAY_SPDT_0_1"
+ (rectangle (start -5.08 -2.54) (end 2.54 2.54)
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy -5.08 -1.9) (xy 2.54 1.9))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy -6.35 -2.54) (xy -5.08 -2.54))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy -6.35 2.54) (xy -5.08 2.54))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy 2.54 0) (xy 5.08 0))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy 5.08 0) (xy 5.08 5.08))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy 5.08 5.08) (xy 6.35 5.08))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (polyline (pts (xy 5.08 -5.08) (xy 6.35 -5.08))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (circle (center 5.08 0) (radius 0.4)
+ (stroke (width 0.254) (type default)) (fill (type outline)))
+ (circle (center 5.08 -5.08) (radius 0.4)
+ (stroke (width 0.254) (type default)) (fill (type outline)))
+ (circle (center 5.08 5.08) (radius 0.4)
+ (stroke (width 0.254) (type default)) (fill (type outline)))
+ )
+ (symbol "RELAY_SPDT_1_1"
+ (pin passive line (at -7.62 -2.54 0) (length 1.27)
+ (name "A1" (effects (font (size 1.27 1.27))))
+ (number "A1" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at -7.62 2.54 0) (length 1.27)
+ (name "A2" (effects (font (size 1.27 1.27))))
+ (number "A2" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at 7.62 0 180) (length 1.27)
+ (name "COM" (effects (font (size 1.27 1.27))))
+ (number "COM" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at 7.62 -5.08 180) (length 1.27)
+ (name "NO" (effects (font (size 1.27 1.27))))
+ (number "NO" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at 7.62 5.08 180) (length 1.27)
+ (name "NC" (effects (font (size 1.27 1.27))))
+ (number "NC" (effects (font (size 1.27 1.27)))))
+ )
+ )
+ (symbol "CONN2"
+ (pin_numbers hide) (pin_names (offset 0))
+ (in_bom yes)
+ (on_board yes)
+ (property "Reference" "J" (at -2.54 5.08 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Value" "J" (at -2.54 -5.08 0) (effects (font (size 1.27 1.27)) (justify left)))
+ (property "Footprint" "" (at 0 0 0) (effects (font (size 1.27 1.27)) hide))
+ (property "Datasheet" "" (at 0 0 0) (effects (font (size 1.27 1.27)) hide))
+ (symbol "CONN2_0_1"
+ (polyline (pts (xy -3.81 -3.81) (xy -3.81 3.81))
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (circle (center -2.54 -2.54) (radius 1.27)
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ (circle (center -2.54 2.54) (radius 1.27)
+ (stroke (width 0.254) (type default)) (fill (type none)))
+ )
+ (symbol "CONN2_1_1"
+ (pin passive line (at -2.54 -2.54 0) (length 1.27)
+ (name "~" (effects (font (size 1.27 1.27))))
+ (number "1" (effects (font (size 1.27 1.27)))))
+ (pin passive line (at -2.54 2.54 0) (length 1.27)
+ (name "~" (effects (font (size 1.27 1.27))))
+ (number "2" (effects (font (size 1.27 1.27)))))
+ )
+ )
+)
diff --git a/loop-detector/loop-detector-kicad/sym-lib-table b/loop-detector/loop-detector-kicad/sym-lib-table
new file mode 100644
index 0000000..55f1de1
--- /dev/null
+++ b/loop-detector/loop-detector-kicad/sym-lib-table
@@ -0,0 +1,4 @@
+(sym_lib_table
+ (version 7)
+ (lib (name "loopdet")(type "KiCad")(uri "${KIPRJMOD}/loopdet.kicad_sym")(options "")(descr "Loop detector custom symbols"))
+)
diff --git a/loop-detector/loop-detector-principle.html b/loop-detector/loop-detector-principle.html
new file mode 100644
index 0000000..1b51247
--- /dev/null
+++ b/loop-detector/loop-detector-principle.html
@@ -0,0 +1,474 @@
+
+
+
+环路车检器:检测方法推荐 + 原理图
+
+
+
+
+
+
+
+
+
+
diff --git a/memory/2026-08-21.md b/memory/2026-08-21.md
new file mode 100644
index 0000000..e66024a
--- /dev/null
+++ b/memory/2026-08-21.md
@@ -0,0 +1,38 @@
+# 2026-08-21 工作日志
+
+## 环路车检器方案 + 原理图
+
+- 老大咨询环路车检器检测方法选型与原理图绘制
+- 输出:检测方法对比(LC振荡+频率计数 主推 / PLL 高灵敏 / 电桥 不推荐 / 多频扫频 抗变频器干扰旗舰)+ LC振荡频率计数方案完整原理图
+- 文件:`/root/.openclaw/workspace/loop-detector/`
+ - `loop-detector-principle.html`(源文件,含图1方法对比 + 图2原理图)
+ - `fig1-methods.svg/.png`、`fig2-schematic.svg/.png`
+ - `inline_svg.py`(SVG 样式内联转换脚本,librsvg 不支持 CSS 变量)
+- 关键设计点:匹配变压器隔离耦合、谐振 20~150kHz、周期法测频、基准频率自适应抗温漂、光耦隔离输出、回差阈值
+
+## 服务器安装 KiCad
+
+- **KiCad 7.0.11** 安装完成(apt 官方源,35 个包,库占 363MB)
+- 组件:kicad / kicad-cli / eeschema / pcbnew,符号库+封装库完整
+- 无 GPU:3D 查看器软渲染慢,原理图/PCB 编辑不受影响
+- 图形界面走向日葵远程桌面使用
+
+## KiCad 环路车检器原理图工程(已交付)
+
+- 目录:`/root/.openclaw/workspace/loop-detector/loop-detector-kicad/`
+ - `loopdet.kicad_sym` — 自定义符号库(R/C/Q_NPN/MOS_N/LED/TVS_BI/XFMR/OPTO/COMP/MCU/RELAY_SPDT/CONN2)
+ - `loop-detector.kicad_sch` — 原理图(A3,LC振荡+频率计数完整信号链)
+ - `loop-detector.kicad_pro` — 工程文件
+ - `loop-detector.pdf` — 导出的 PDF
+ - `loop-detector-preview.png` — 预览图
+ - `gen_sch.py` — 程序化生成脚本(改参数后重跑即可)
+ - `sym-lib-table` — 工程级符号库表;全局表在 `~/.config/kicad/7.0/sym-lib-table`
+- **KiCad 7 文件格式踩坑记录(重要!)**:
+ 1. 文件头 `(kicad_sch (version 20230121) (generator eeschema)`,uuid/generator 都不带引号
+ 2. 内嵌 lib_symbols 符号名必须带库前缀(`"loopdet:C"`),与 lib_id 一致才能解析
+ 3. pin 必须带电气/图形类型:`(pin passive line (at ...) (length ...) (name "~" ...) (number "1" ...))`
+ 4. symbol 实例必须有 `(instances (project ... (path ... (reference ...) (unit 1))))` 块
+ 5. 网络标签是 `(label "VCC" (at ...) (effects ...) (uuid ...))`,不是 net_label
+ 6. 顶层文本是 `(text "内容" (at ...) ...)`,字符串前置,不是 (string ...) 子块
+- 调试方法:kicad-cli sch export pdf 验证;用 top_children 拆分文件做二分测试定位解析错误
+- 经验:kicad-cli 查库表加载缺失库会段错误(t11 测试),尽量内嵌符号
diff --git a/pcb/README.md b/pcb/README.md
new file mode 100644
index 0000000..62e226f
--- /dev/null
+++ b/pcb/README.md
@@ -0,0 +1,18 @@
+# pcb/ — PCB 设计文档目录
+
+> 本目录存放 PCB 设计相关文档(原理图、布局、Gerber、评审记录等)。
+> 由硬件同事**唐磊**提交的文档统一归档于此,随 xdeSpace 每日自动同步(每天 02:30)。
+
+## 归档约定
+
+- 原理图 / 布局文件:KiCad 工程(`.kicad_sch` / `.kicad_pcb`)或嘉立创EDA 导出文件
+- 评审记录:Markdown,命名建议 `YYYY-MM-DD-主题.md`
+- 生产文件:Gerber / BOM / 坐标文件,按项目子目录存放
+
+## 当前项目
+
+(待补充——环路检测板 / 道闸控制板方案落地后按项目建子目录)
+
+---
+
+_维护:小德(自动归档)_