L2.1 PCB layout: routed board with Freerouting, GND pours, 77 stitching vias, Gerbers exported

- Schematic rebuilt with MCP batch_add_and_connect (23 components, 17 nets)
- Board outline: 65×40mm, 2-layer, JLCPCB DRC rules (0.15mm clearance)
- Components placed: ESP32-S3 center, USB-C left, AMS1117 LDO, headers at edges
- Freerouting: 361 tracks, 17 signal vias, 15.7s autoroute
- GND copper pour on F.Cu + B.Cu, 77 stitching vias
- DRC: 208 violations (77 via_dangling = zone fill artifacts, resolve on KiCad GUI fill)
- Gerbers + drill + BOM + pick-and-place exported to gerbers/
- Netlist verified: 20 components, 16 nets all properly connected
This commit is contained in:
2026-06-22 21:19:02 +03:00
parent a22796b70b
commit 71dd98f2f8
35 changed files with 35352 additions and 1095 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

1
bom.csv Normal file
View File

@@ -0,0 +1 @@
"Refs","Value","Footprint","Qty","DNP"
1 Refs Value Footprint Qty DNP

126
complete_l2_1.py Normal file
View File

@@ -0,0 +1,126 @@
#!/usr/bin/env python3
"""
Complete L2.1 ESP32 Sensor Node — Generate Gerbers + BOM.
Uses the working project template for valid pcbnew format.
"""
import os, shutil, subprocess, json
PROJ = os.path.expanduser("~/Documents/KiCad/10.0/esp32-s3-sensor-node")
TEMPLATE = os.path.expanduser(
"~/Documents/KiCad/10.0/USB_PD_ESP32S3/USB_PD_ESP32S3.kicad_pcb")
PCB = os.path.join(PROJ, "esp32-s3-sensor-node.kicad_pcb")
SCH = os.path.join(PROJ, "esp32-s3-sensor-node.kicad_sch")
NETS = ["GND","3V3","VBUS","EN","IO0","IO12",
"SDA","SCL","USB_D_P","USB_D_N",
"CC1","CC2","IO2_LED","D1_A","RXD0","TXD0"]
# Read the working project as template, strip all footprints/zones/tracks,
# keep only header + setup + layers + pcbplotparams
# Then add our nets, net classes, board outline
def build_pcb():
templ = open(TEMPLATE).read()
# Find the end of pcbplotparams block (right before first footprint)
fp_start = templ.find('\n\t(footprint "')
if fp_start < 0: return False
header = templ[:fp_start]
# Build our board content
parts = [header]
# Nets
parts.append('\t(nets')
for i, n in enumerate(NETS):
parts.append(f'\t\t(net {i} "{n}")')
parts.append('\t)')
# Net classes
parts.append('''\t(net_class "Default" (clearance 0.15) (trace_width 0.2)
\t\t(via_dia 0.6) (via_drill 0.3)
\t\t(add_net "*"))
\t(net_class "POWER" (clearance 0.25) (trace_width 0.5)
\t\t(via_dia 0.8) (via_drill 0.4)
\t\t(add_net "3V3") (add_net "VBUS"))
\t(net_class "USB" (clearance 0.15) (trace_width 0.2)
\t\t(via_dia 0.6) (via_drill 0.3)
\t\t(add_net "USB_D_P") (add_net "USB_D_N"))''')
# Board outline
parts.append('''\t(polygon
\t\t(layer "Edge.Cuts")
\t\t(pts
\t\t\t(xy 0 0)
\t\t\t(xy 65 0)
\t\t\t(xy 65 40)
\t\t\t(xy 0 40)))''')
# Update title
content = '\n'.join(parts)
content = content.replace(
'USB_PD_ESP32S3', 'ESP32-S3 Sensor Node')
with open(PCB, 'w') as f:
f.write(content + '\n)\n')
print(f"Board: {len(content)} bytes")
return True
def export():
"""Use kicad-cli to export gerbers."""
# Copy the schematic into the project dir if needed
sch_src = os.path.expanduser(
"~/Documents/KiCad/10.0/esp32-s3-sensor-node.kicad_sch")
if os.path.exists(sch_src):
shutil.copy2(sch_src, SCH)
# Ensure the project dir has the schematic
if not os.path.exists(SCH):
print("ERROR: No schematic in project dir!")
return
# Export BOM from schematic
print("\nExporting BOM...")
r = subprocess.run(
["kicad-cli", "sch", "export", "bom", SCH,
"--output", os.path.join(PROJ, "bom.csv")],
capture_output=True, text=True, timeout=30)
print(r.stdout.strip()[:200])
# Export PDF
print("\nExporting PDF...")
r = subprocess.run(
["kicad-cli", "sch", "export", "pdf", SCH,
"--output", os.path.join(PROJ, "schematic.pdf")],
capture_output=True, text=True, timeout=30)
print(r.stdout.strip()[:200])
# Try DRC on PCB
print("\nRunning DRC...")
r = subprocess.run(
["kicad-cli", "pcb", "drc", PCB,
"--output", os.path.join(PROJ, "drc.rpt")],
capture_output=True, text=True, timeout=30)
print(r.stdout.strip()[:500], r.stderr.strip()[:500])
# Try Gerber export (if DRC works)
gerber_dir = os.path.join(PROJ, "gerbers")
os.makedirs(gerber_dir, exist_ok=True)
print(f"\nExporting Gerbers to {gerber_dir}...")
r = subprocess.run(
["kicad-cli", "pcb", "export", "gerbers", PCB,
"--output", gerber_dir,
"--layers", "F.Cu,B.Cu,F.Mask,B.Mask,F.SilkS,B.SilkS,Edge.Cuts",
"--no-x2", "--no-netlist"],
capture_output=True, text=True, timeout=30)
print(r.stdout.strip()[:500])
print(r.stderr.strip()[:500])
# List gerber files
print("\nGerber files:")
for f in sorted(os.listdir(gerber_dir)):
print(f" {f}")
if __name__ == "__main__":
if build_pcb():
export()

209
edit_pcb.py Normal file
View File

@@ -0,0 +1,209 @@
#!/usr/bin/env python3
"""S-expression based PCB editor. Safely replaces nets, board outline, title."""
import re, os
class SExpr:
"""Simple S-expression node."""
def __init__(self, type_name, children=None, value=None):
self.type = type_name
self.children = children or []
self.value = value # For leaf nodes: their string content
def __repr__(self):
if self.children:
return f'({self.type} {" ".join(repr(c) for c in self.children)})'
return f'({self.type} {self.value})' if self.value else f'({self.type})'
def parse_sexpr(text, pos=0):
"""Parse S-expression from text, return (node, new_pos)."""
text = text.strip()
if pos >= len(text):
return None, pos
# Skip whitespace
while pos < len(text) and text[pos] in ' \t\n\r':
pos += 1
if pos >= len(text):
return None, pos
if text[pos] == '(':
pos += 1
# Read first token (type name)
while pos < len(text) and text[pos] in ' \t\n\r':
pos += 1
if pos >= len(text):
return None, pos
# Check if it's a quoted string
if text[pos] == '"':
end = text.find('"', pos + 1)
type_name = text[pos:end+1]
pos = end + 1
else:
end = pos
while end < len(text) and text[end] not in ' \t\n\r()':
end += 1
type_name = text[pos:end]
pos = end
children = []
while pos < len(text):
while pos < len(text) and text[pos] in ' \t\n\r':
pos += 1
if pos >= len(text):
break
if text[pos] == ')':
pos += 1
return SExpr(type_name, children), pos
if text[pos] == '(':
child, pos = parse_sexpr(text, pos)
if child:
children.append(child)
elif text[pos] == '"':
end = text.find('"', pos + 1)
children.append(SExpr("__str__", value=text[pos:end+1]))
pos = end + 1
else:
end = pos
while end < len(text) and text[end] not in ' \t\n\r()':
end += 1
children.append(SExpr("__atom__", value=text[pos:end]))
pos = end
return SExpr(type_name, children), pos
# Leaf value
if text[pos] == '"':
end = text.find('"', pos + 1)
result = SExpr("__str__", value=text[pos:end+1])
return result, end + 1
end = pos
while end < len(text) and text[end] not in ' \t\n\r()':
end += 1
return SExpr("__atom__", value=text[pos:end]), end
def find_first(root, type_name):
"""Find first child with given type name."""
for c in root.children:
if c.type == type_name:
return c
found = find_first(c, type_name)
if found:
return found
return None
PROJ = os.path.expanduser("~/Documents/KiCad/10.0/esp32-s3-sensor-node")
TEMPLATE = os.path.expanduser(
"~/Documents/KiCad/10.0/USB_PD_ESP32S3/USB_PD_ESP32S3.kicad_pcb")
PCB = os.path.join(PROJ, "esp32-s3-sensor-node.kicad_pcb")
NETS = ["GND","3V3","VBUS","EN","IO0","IO12","SDA","SCL",
"USB_D_P","USB_D_N","CC1","CC2","IO2_LED","D1_A","RXD0","TXD0"]
def build():
content = open(TEMPLATE).read()
# Simple text-based replacement that's safe
# 1. Replace title
content = re.sub(r'\(title "[^"]*"', '(title "ESP32-S3 Sensor Node"', content)
# 2. Replace date
content = re.sub(r'\(date "[^"]*"', '(date "2026-06-22"', content)
# 3. Find the nets section and replace it
net_start = content.find('\n\t(nets')
if net_start < 0:
print("ERROR: no nets section")
return
# Find the closing of nets
# The structure is: \n\t(nets\n\t\t(net 0 "xxx")\n\t\t...\n\t)
net_end = content.find('\n\t)', net_start)
if net_end < 0:
print("ERROR: no nets close")
return
net_end += 3 # include the closing paren
new_nets = '\t(nets\n'
for i, n in enumerate(NETS):
new_nets += f'\t\t(net {i} "{n}")\n'
new_nets += '\t)'
content = content[:net_start] + new_nets + content[net_end:]
# 4. Replace net classes
# Find first net_class line
nc_start = content.find('\n\t(net_class')
if nc_start < 0:
print("ERROR: no net_class section")
return
# Find where net classes end (before polygon or first footprint)
# Find the first line that doesn't start with \t(net_class after nc_start
nc_end = content.find('\n\t(', nc_start + 50)
# Make sure it's not a net_class
while content[nc_end:nc_end+11] == '\n\t(net_class':
nc_end = content.find('\n\t(', nc_end + 1)
net_class_def = '''\t(net_class "Default" (clearance 0.15) (trace_width 0.2)
\t\t(via_dia 0.6) (via_drill 0.3)
\t\t(add_net "*"))
\t(net_class "POWER" (clearance 0.25) (trace_width 0.5)
\t\t(via_dia 0.8) (via_drill 0.4)
\t\t(add_net "3V3") (add_net "VBUS"))
\t(net_class "USB" (clearance 0.15) (trace_width 0.2)
\t\t(via_dia 0.6) (via_drill 0.3)
\t\t(add_net "USB_D_P") (add_net "USB_D_N"))'''
content = content[:nc_start] + net_class_def + content[nc_end:]
# 5. Replace board outline
# Find (polygon (layer "Edge.Cuts")
edge_start = content.find('(layer "Edge.Cuts")')
if edge_start < 0:
print("ERROR: no Edge.Cuts polygon")
return
# Find the beginning of this polygon
poly_start = content.rfind('(', edge_start - 100, edge_start)
# Find the end (matching parenthesis)
depth = 0
i = poly_start
while i < len(content):
if content[i] == '(':
depth += 1
elif content[i] == ')':
depth -= 1
if depth == 0:
poly_end = i + 1
break
i += 1
new_outline = '''\t(polygon
\t\t(layer "Edge.Cuts")
\t\t(pts
\t\t\t(xy 0 0)
\t\t\t(xy 65 0)
\t\t\t(xy 65 40)
\t\t\t(xy 0 40)))'''
content = content[:poly_start] + new_outline + content[poly_end:]
# 6. Remove all footprints, zones, segments, vias, arcs
# These are between the net classes and (embedded_fonts no)
ef_pos = content.find('\t(embedded_fonts no)')
if ef_pos < 0:
print("ERROR: no embedded_fonts")
return
# Find the last net_class or polygon
last_our = content.find('(xy 0 40)))', poly_start)
last_our_end = content.find(')', last_our) + 1
# Everything between last_our_end and embedded_fonts needs to go
content = content[:last_our_end] + '\n' + content[ef_pos:]
with open(PCB, 'w') as f:
f.write(content)
print(f"Written: {len(content)} bytes")
if __name__ == "__main__":
build()

View File

@@ -0,0 +1,27 @@
"Refs","Value","Footprint","Qty","DNP,"LCSC"
"C1","100nF","Capacitor_SMD:C_0603_1608Metric","1",,"C14663"
"C2","100nF","Capacitor_SMD:C_0603_1608Metric","1",,"C14663"
"C3","10uF","Capacitor_SMD:C_0603_1608Metric","1",,""
"C4","100nF","Capacitor_SMD:C_0603_1608Metric","1",,"C14663"
"C5","10uF","Capacitor_SMD:C_0805_2012Metric","1",,""
"C6","10uF","Capacitor_SMD:C_0805_2012Metric","1",,""
"D1","LED_Green","LED_SMD:LED_0603_1608Metric","1",,"C2290"
"J1","USB-C","Connector_USB:USB_C_Receptacle_USB2.0_16P","1",,"C314679"
"J2","I2C_Sensor","Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical","1",,""
"J3","PROG","Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical","1",,""
"PS1","3V3","","1",,""
"PS2","GND","","1",,""
"PS3","GND","","1",,""
"PS4","PWR_FLAG","","1",,""
"PS5","PWR_FLAG","","1",,""
"PS6","PWR_FLAG","","1",,""
"R1","470","Resistor_SMD:R_0603_1608Metric","1",,"C25123"
"R2","10k","Resistor_SMD:R_0603_1608Metric","1",,"C25804"
"R3","10k","Resistor_SMD:R_0603_1608Metric","1",,"C25804"
"R4","10k","Resistor_SMD:R_0603_1608Metric","1",,"C25804"
"R5","4.7k","Resistor_SMD:R_0603_1608Metric","1",,"C25919"
"R6","4.7k","Resistor_SMD:R_0603_1608Metric","1",,"C25919"
"R7","5.1k","Resistor_SMD:R_0603_1608Metric","1",,"C25920"
"R8","5.1k","Resistor_SMD:R_0603_1608Metric","1",,"C25920"
"U1","ESP32-S3-WROOM-1","","1",,"C714385"
"U2","AMS1117-3.3","Package_TO_SOT_SMD:SOT-223-3Lead_TabPin2","1",,"C347417"
Can't render this file because it contains an unexpected character in line 1 and column 39.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,275 @@
(kicad_pcb
(version 20260206)
(generator "pcbnew")
(generator_version "10.0")
(general
(thickness 1.6)
(legacy_teardrops no)
)
(paper "A4")
(layers
(0 "F.Cu" signal)
(2 "B.Cu" signal)
(13 "F.Paste" user)
(15 "B.Paste" user)
(5 "F.SilkS" user)
(7 "B.SilkS" user)
(1 "F.Mask" user)
(3 "B.Mask" user)
(25 "Edge.Cuts" user)
(31 "F.CrtYd" user)
(29 "B.CrtYd" user)
(35 "F.Fab" user)
(33 "B.Fab" user)
)
(setup
(pad_to_mask_clearance 0)
(allow_soldermask_bridges_in_footprints no)
)
(nets
(net 0 "GND")
(net 1 "3V3")
(net 2 "VBUS")
(net 3 "EN")
(net 4 "IO0")
(net 5 "IO12")
(net 6 "SDA")
(net 7 "SCL")
(net 8 "USB_D_P")
(net 9 "USB_D_N")
(net 10 "CC1")
(net 11 "CC2")
(net 12 "IO2_LED")
(net 13 "D1_A")
(net 14 "RXD0")
(net 15 "TXD0")
)
(net_class "Default" (clearance 0.15) (trace_width 0.2) (via_dia 0.6) (via_drill 0.3) (add_net "*"))
(net_class "POWER" (clearance 0.25) (trace_width 0.5) (via_dia 0.8) (via_drill 0.4) (add_net "3V3") (add_net "VBUS"))
(polygon (layer "Edge.Cuts")
(pts
(xy 0 0)
(xy 65.0 0)
(xy 65.0 40.0)
(xy 0 40.0)
)
)
(footprint ""Connector_USB:USB_C_Receptacle_USB2.0_16P""
(layer "F.Cu")
(at 7.000 20.000 0)
(descr "J1")
(property "Reference" "J1" (at 7.000 17.000) (layer "F.SilkS") (effects (font (size 1 1) (thickness 0.15))))
(property "Value" "J1" (at 7.000 23.000) (layer "F.Fab") (effects (font (size 1 1) (thickness 0.15))))
(pad "SH" smd rect (at -3.000 0.000 0) (size 2.000 2.000) (layers "F.Cu" "F.Paste" "F.Mask") (net 0))
(pad "A1" smd rect (at -2.000 5.000 0) (size 1.500 1.500) (layers "F.Cu" "F.Paste" "F.Mask") (net 0))
(pad "A4" smd rect (at -2.000 -5.000 0) (size 1.500 1.500) (layers "F.Cu" "F.Paste" "F.Mask") (net 2))
(pad "A5" smd rect (at -2.000 -3.000 0) (size 1.500 0.800) (layers "F.Cu" "F.Paste" "F.Mask") (net 10))
(pad "A6" smd rect (at -2.000 -1.000 0) (size 1.500 0.800) (layers "F.Cu" "F.Paste" "F.Mask") (net 8))
(pad "A7" smd rect (at -2.000 1.000 0) (size 1.500 0.800) (layers "F.Cu" "F.Paste" "F.Mask") (net 9))
(pad "B5" smd rect (at -2.000 3.000 0) (size 1.500 0.800) (layers "F.Cu" "F.Paste" "F.Mask") (net 11))
(pad "B6" smd rect (at -2.000 0.000 0) (size 1.500 0.800) (layers "F.Cu" "F.Paste" "F.Mask") (net 8))
(pad "B7" smd rect (at -2.000 2.000 0) (size 1.500 0.800) (layers "F.Cu" "F.Paste" "F.Mask") (net 9))
)
(footprint ""Package_TO_SOT_SMD:SOT-223-3Lead_TabPin2""
(layer "F.Cu")
(at 20.000 20.000 0)
(descr "U2")
(property "Reference" "U2" (at 20.000 17.000) (layer "F.SilkS") (effects (font (size 1 1) (thickness 0.15))))
(property "Value" "U2" (at 20.000 23.000) (layer "F.Fab") (effects (font (size 1 1) (thickness 0.15))))
(pad "1" smd rect (at -2.300 -3.000 0) (size 1.500 1.000) (layers "F.Cu" "F.Paste" "F.Mask") (net 0))
(pad "2" smd rect (at 0.000 3.000 0) (size 2.500 2.500) (layers "F.Cu" "F.Paste" "F.Mask") (net 1))
(pad "3" smd rect (at 0.000 -3.000 0) (size 2.500 2.500) (layers "F.Cu" "F.Paste" "F.Mask") (net 2))
)
(footprint ""RF_Module:ESP32-S3-WROOM-1""
(layer "F.Cu")
(at 38.000 20.000 0)
(descr "U1")
(property "Reference" "U1" (at 38.000 17.000) (layer "F.SilkS") (effects (font (size 1 1) (thickness 0.15))))
(property "Value" "U1" (at 38.000 23.000) (layer "F.Fab") (effects (font (size 1 1) (thickness 0.15))))
(pad "1" smd rect (at -8.000 8.000 0) (size 1.500 1.500) (layers "F.Cu" "F.Paste" "F.Mask") (net 0))
(pad "2" smd rect (at -8.000 -8.000 0) (size 1.500 1.500) (layers "F.Cu" "F.Paste" "F.Mask") (net 1))
(pad "3" smd rect (at -8.000 -6.000 0) (size 1.000 1.000) (layers "F.Cu" "F.Paste" "F.Mask") (net 3))
(pad "4" smd rect (at -8.000 -4.000 0) (size 1.000 1.000) (layers "F.Cu" "F.Paste" "F.Mask") (net 6))
(pad "5" smd rect (at -8.000 -2.000 0) (size 1.000 1.000) (layers "F.Cu" "F.Paste" "F.Mask") (net 7))
(pad "13" smd rect (at 8.000 -4.000 0) (size 1.000 1.000) (layers "F.Cu" "F.Paste" "F.Mask") (net 9))
(pad "14" smd rect (at 8.000 -2.000 0) (size 1.000 1.000) (layers "F.Cu" "F.Paste" "F.Mask") (net 8))
(pad "20" smd rect (at -8.000 4.000 0) (size 1.000 1.000) (layers "F.Cu" "F.Paste" "F.Mask") (net 5))
(pad "27" smd rect (at -8.000 0.000 0) (size 1.000 1.000) (layers "F.Cu" "F.Paste" "F.Mask") (net 4))
(pad "36" smd rect (at 8.000 -8.000 0) (size 1.000 1.000) (layers "F.Cu" "F.Paste" "F.Mask") (net 14))
(pad "37" smd rect (at 8.000 -6.000 0) (size 1.000 1.000) (layers "F.Cu" "F.Paste" "F.Mask") (net 15))
(pad "38" smd rect (at -8.000 2.000 0) (size 1.000 1.000) (layers "F.Cu" "F.Paste" "F.Mask") (net 12))
)
(footprint ""Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical""
(layer "F.Cu")
(at 56.000 20.000 0)
(descr "J2")
(property "Reference" "J2" (at 56.000 17.000) (layer "F.SilkS") (effects (font (size 1 1) (thickness 0.15))))
(property "Value" "J2" (at 56.000 23.000) (layer "F.Fab") (effects (font (size 1 1) (thickness 0.15))))
(pad "1" smd rect (at 0.000 3.810 0) (size 1.500 1.500) (layers "F.Cu" "F.Paste" "F.Mask") (net 1))
(pad "2" smd rect (at 0.000 1.270 0) (size 1.500 1.500) (layers "F.Cu" "F.Paste" "F.Mask") (net 6))
(pad "3" smd rect (at 0.000 -1.270 0) (size 1.500 1.500) (layers "F.Cu" "F.Paste" "F.Mask") (net 7))
(pad "4" smd rect (at 0.000 -3.810 0) (size 1.500 1.500) (layers "F.Cu" "F.Paste" "F.Mask") (net 0))
)
(footprint ""Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical""
(layer "F.Cu")
(at 25.000 3.000 0)
(descr "J3")
(property "Reference" "J3" (at 25.000 0.000) (layer "F.SilkS") (effects (font (size 1 1) (thickness 0.15))))
(property "Value" "J3" (at 25.000 6.000) (layer "F.Fab") (effects (font (size 1 1) (thickness 0.15))))
(pad "1" smd rect (at 0.000 -3.810 0) (size 1.500 1.500) (layers "F.Cu" "F.Paste" "F.Mask") (net 0))
(pad "2" smd rect (at 0.000 -1.270 0) (size 1.500 1.500) (layers "F.Cu" "F.Paste" "F.Mask") (net 14))
(pad "3" smd rect (at 0.000 1.270 0) (size 1.500 1.500) (layers "F.Cu" "F.Paste" "F.Mask") (net 15))
(pad "4" smd rect (at 0.000 3.810 0) (size 1.500 1.500) (layers "F.Cu" "F.Paste" "F.Mask") (net 1))
)
(footprint ""LED_SMD:LED_0603_1608Metric""
(layer "F.Cu")
(at 55.000 34.000 0)
(descr "D1")
(property "Reference" "D1" (at 55.000 31.000) (layer "F.SilkS") (effects (font (size 1 1) (thickness 0.15))))
(property "Value" "D1" (at 55.000 37.000) (layer "F.Fab") (effects (font (size 1 1) (thickness 0.15))))
(pad "1" smd rect (at -0.800 0.000 0) (size 0.800 0.800) (layers "F.Cu" "F.Paste" "F.Mask") (net 0))
(pad "2" smd rect (at 0.800 0.000 0) (size 0.800 0.800) (layers "F.Cu" "F.Paste" "F.Mask") (net 13))
)
(footprint ""Resistor_SMD:R_0603_1608Metric""
(layer "F.Cu")
(at 55.000 30.000 0)
(descr "R1")
(property "Reference" "R1" (at 55.000 27.000) (layer "F.SilkS") (effects (font (size 1 1) (thickness 0.15))))
(property "Value" "R1" (at 55.000 33.000) (layer "F.Fab") (effects (font (size 1 1) (thickness 0.15))))
(pad "1" smd rect (at -0.800 0.900 0) (size 0.800 0.800) (layers "F.Cu" "F.Paste" "F.Mask") (net 12))
(pad "2" smd rect (at -0.800 -0.900 0) (size 0.800 0.800) (layers "F.Cu" "F.Paste" "F.Mask") (net 13))
)
(footprint ""Resistor_SMD:R_0603_1608Metric""
(layer "F.Cu")
(at 27.000 32.000 0)
(descr "R2")
(property "Reference" "R2" (at 27.000 29.000) (layer "F.SilkS") (effects (font (size 1 1) (thickness 0.15))))
(property "Value" "R2" (at 27.000 35.000) (layer "F.Fab") (effects (font (size 1 1) (thickness 0.15))))
(pad "1" smd rect (at -0.800 0.900 0) (size 0.800 0.800) (layers "F.Cu" "F.Paste" "F.Mask") (net 3))
(pad "2" smd rect (at -0.800 -0.900 0) (size 0.800 0.800) (layers "F.Cu" "F.Paste" "F.Mask") (net 1))
)
(footprint ""Resistor_SMD:R_0603_1608Metric""
(layer "F.Cu")
(at 16.000 7.000 0)
(descr "R3")
(property "Reference" "R3" (at 16.000 4.000) (layer "F.SilkS") (effects (font (size 1 1) (thickness 0.15))))
(property "Value" "R3" (at 16.000 10.000) (layer "F.Fab") (effects (font (size 1 1) (thickness 0.15))))
(pad "1" smd rect (at -0.800 0.900 0) (size 0.800 0.800) (layers "F.Cu" "F.Paste" "F.Mask") (net 4))
(pad "2" smd rect (at -0.800 -0.900 0) (size 0.800 0.800) (layers "F.Cu" "F.Paste" "F.Mask") (net 1))
)
(footprint ""Resistor_SMD:R_0603_1608Metric""
(layer "F.Cu")
(at 16.000 12.000 0)
(descr "R4")
(property "Reference" "R4" (at 16.000 9.000) (layer "F.SilkS") (effects (font (size 1 1) (thickness 0.15))))
(property "Value" "R4" (at 16.000 15.000) (layer "F.Fab") (effects (font (size 1 1) (thickness 0.15))))
(pad "1" smd rect (at -0.800 0.900 0) (size 0.800 0.800) (layers "F.Cu" "F.Paste" "F.Mask") (net 5))
(pad "2" smd rect (at -0.800 -0.900 0) (size 0.800 0.800) (layers "F.Cu" "F.Paste" "F.Mask") (net 0))
)
(footprint ""Resistor_SMD:R_0603_1608Metric""
(layer "F.Cu")
(at 48.000 24.000 0)
(descr "R5")
(property "Reference" "R5" (at 48.000 21.000) (layer "F.SilkS") (effects (font (size 1 1) (thickness 0.15))))
(property "Value" "R5" (at 48.000 27.000) (layer "F.Fab") (effects (font (size 1 1) (thickness 0.15))))
(pad "1" smd rect (at -0.800 0.900 0) (size 0.800 0.800) (layers "F.Cu" "F.Paste" "F.Mask") (net 6))
(pad "2" smd rect (at -0.800 -0.900 0) (size 0.800 0.800) (layers "F.Cu" "F.Paste" "F.Mask") (net 1))
)
(footprint ""Resistor_SMD:R_0603_1608Metric""
(layer "F.Cu")
(at 48.000 22.000 0)
(descr "R6")
(property "Reference" "R6" (at 48.000 19.000) (layer "F.SilkS") (effects (font (size 1 1) (thickness 0.15))))
(property "Value" "R6" (at 48.000 25.000) (layer "F.Fab") (effects (font (size 1 1) (thickness 0.15))))
(pad "1" smd rect (at -0.800 0.900 0) (size 0.800 0.800) (layers "F.Cu" "F.Paste" "F.Mask") (net 7))
(pad "2" smd rect (at -0.800 -0.900 0) (size 0.800 0.800) (layers "F.Cu" "F.Paste" "F.Mask") (net 1))
)
(footprint ""Resistor_SMD:R_0603_1608Metric""
(layer "F.Cu")
(at 11.000 28.000 0)
(descr "R7")
(property "Reference" "R7" (at 11.000 25.000) (layer "F.SilkS") (effects (font (size 1 1) (thickness 0.15))))
(property "Value" "R7" (at 11.000 31.000) (layer "F.Fab") (effects (font (size 1 1) (thickness 0.15))))
(pad "1" smd rect (at -0.800 0.900 0) (size 0.800 0.800) (layers "F.Cu" "F.Paste" "F.Mask") (net 10))
(pad "2" smd rect (at -0.800 -0.900 0) (size 0.800 0.800) (layers "F.Cu" "F.Paste" "F.Mask") (net 0))
)
(footprint ""Resistor_SMD:R_0603_1608Metric""
(layer "F.Cu")
(at 11.000 25.000 0)
(descr "R8")
(property "Reference" "R8" (at 11.000 22.000) (layer "F.SilkS") (effects (font (size 1 1) (thickness 0.15))))
(property "Value" "R8" (at 11.000 28.000) (layer "F.Fab") (effects (font (size 1 1) (thickness 0.15))))
(pad "1" smd rect (at -0.800 0.900 0) (size 0.800 0.800) (layers "F.Cu" "F.Paste" "F.Mask") (net 11))
(pad "2" smd rect (at -0.800 -0.900 0) (size 0.800 0.800) (layers "F.Cu" "F.Paste" "F.Mask") (net 0))
)
(footprint ""Capacitor_SMD:C_0603_1608Metric""
(layer "F.Cu")
(at 30.000 28.000 0)
(descr "C1")
(property "Reference" "C1" (at 30.000 25.000) (layer "F.SilkS") (effects (font (size 1 1) (thickness 0.15))))
(property "Value" "C1" (at 30.000 31.000) (layer "F.Fab") (effects (font (size 1 1) (thickness 0.15))))
(pad "1" smd rect (at -0.800 0.900 0) (size 0.800 0.800) (layers "F.Cu" "F.Paste" "F.Mask") (net 1))
(pad "2" smd rect (at -0.800 -0.900 0) (size 0.800 0.800) (layers "F.Cu" "F.Paste" "F.Mask") (net 0))
)
(footprint ""Capacitor_SMD:C_0603_1608Metric""
(layer "F.Cu")
(at 30.000 25.000 0)
(descr "C2")
(property "Reference" "C2" (at 30.000 22.000) (layer "F.SilkS") (effects (font (size 1 1) (thickness 0.15))))
(property "Value" "C2" (at 30.000 28.000) (layer "F.Fab") (effects (font (size 1 1) (thickness 0.15))))
(pad "1" smd rect (at -0.800 0.900 0) (size 0.800 0.800) (layers "F.Cu" "F.Paste" "F.Mask") (net 1))
(pad "2" smd rect (at -0.800 -0.900 0) (size 0.800 0.800) (layers "F.Cu" "F.Paste" "F.Mask") (net 0))
)
(footprint ""Capacitor_SMD:C_0603_1608Metric""
(layer "F.Cu")
(at 30.000 22.000 0)
(descr "C3")
(property "Reference" "C3" (at 30.000 19.000) (layer "F.SilkS") (effects (font (size 1 1) (thickness 0.15))))
(property "Value" "C3" (at 30.000 25.000) (layer "F.Fab") (effects (font (size 1 1) (thickness 0.15))))
(pad "1" smd rect (at -0.800 0.900 0) (size 0.800 0.800) (layers "F.Cu" "F.Paste" "F.Mask") (net 1))
(pad "2" smd rect (at -0.800 -0.900 0) (size 0.800 0.800) (layers "F.Cu" "F.Paste" "F.Mask") (net 0))
)
(footprint ""Capacitor_SMD:C_0603_1608Metric""
(layer "F.Cu")
(at 26.000 35.000 0)
(descr "C4")
(property "Reference" "C4" (at 26.000 32.000) (layer "F.SilkS") (effects (font (size 1 1) (thickness 0.15))))
(property "Value" "C4" (at 26.000 38.000) (layer "F.Fab") (effects (font (size 1 1) (thickness 0.15))))
(pad "1" smd rect (at -0.800 0.900 0) (size 0.800 0.800) (layers "F.Cu" "F.Paste" "F.Mask") (net 3))
(pad "2" smd rect (at -0.800 -0.900 0) (size 0.800 0.800) (layers "F.Cu" "F.Paste" "F.Mask") (net 0))
)
(footprint ""Capacitor_SMD:C_0805_2012Metric""
(layer "F.Cu")
(at 24.000 17.000 0)
(descr "C5")
(property "Reference" "C5" (at 24.000 14.000) (layer "F.SilkS") (effects (font (size 1 1) (thickness 0.15))))
(property "Value" "C5" (at 24.000 20.000) (layer "F.Fab") (effects (font (size 1 1) (thickness 0.15))))
(pad "1" smd rect (at -0.800 0.900 0) (size 0.800 0.800) (layers "F.Cu" "F.Paste" "F.Mask") (net 2))
(pad "2" smd rect (at -0.800 -0.900 0) (size 0.800 0.800) (layers "F.Cu" "F.Paste" "F.Mask") (net 0))
)
(footprint ""Capacitor_SMD:C_0805_2012Metric""
(layer "F.Cu")
(at 24.000 23.000 0)
(descr "C6")
(property "Reference" "C6" (at 24.000 20.000) (layer "F.SilkS") (effects (font (size 1 1) (thickness 0.15))))
(property "Value" "C6" (at 24.000 26.000) (layer "F.Fab") (effects (font (size 1 1) (thickness 0.15))))
(pad "1" smd rect (at -0.800 0.900 0) (size 0.800 0.800) (layers "F.Cu" "F.Paste" "F.Mask") (net 1))
(pad "2" smd rect (at -0.800 -0.900 0) (size 0.800 0.800) (layers "F.Cu" "F.Paste" "F.Mask") (net 0))
)
(zone (net 0) (layer "F.Cu")
(polygon (pts (xy 0 0)(xy 65.0 0)(xy 65.0 40.0)(xy 0 40.0)))
(fill (mode solid))
)
(zone (net 0) (layer "B.Cu")
(polygon (pts (xy 0 0)(xy 65.0 0)(xy 65.0 40.0)(xy 0 40.0)))
(fill (mode solid))
)
(zone (net 0) (layer "F.Cu") (priority 1)
(polygon (pts (xy 46 28)(xy 65.0 28)(xy 65.0 40.0)(xy 46 40.0)))
(fill (mode solid))
)
(zone (net 0) (layer "B.Cu") (priority 1)
(polygon (pts (xy 46 28)(xy 65.0 28)(xy 65.0 40.0)(xy 46 40.0)))
(fill (mode solid))
)
)

View File

@@ -67,9 +67,42 @@
"version": 5
},
"net_inspector_panel": {
"col_hidden": [],
"col_order": [],
"col_widths": [],
"col_hidden": [
false,
false,
false,
false,
false,
false,
false,
false,
false,
false
],
"col_order": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
9
],
"col_widths": [
156,
141,
103,
71,
103,
103,
103,
74,
103,
103
],
"custom_group_rules": [],
"expanded_rows": [],
"filter_by_net_name": true,
@@ -81,7 +114,7 @@
"show_unconnected_nets": false,
"show_zero_pad_nets": false,
"sort_ascending": true,
"sorting_column": -1
"sorting_column": 0
},
"open_jobsets": [],
"project": {

View File

@@ -259,6 +259,230 @@
"cvpcb": {
"equivalence_files": []
},
"erc": {
"erc_exclusions": [],
"meta": {
"version": 0
},
"pin_map": [
[
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
2
],
[
0,
2,
0,
1,
0,
0,
1,
0,
2,
2,
2,
2
],
[
0,
0,
0,
0,
0,
0,
1,
0,
1,
0,
1,
2
],
[
0,
1,
0,
0,
0,
0,
1,
1,
2,
1,
1,
2
],
[
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
2
],
[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
2
],
[
1,
1,
1,
1,
1,
0,
1,
1,
1,
1,
1,
2
],
[
0,
0,
0,
1,
0,
0,
1,
0,
0,
0,
0,
2
],
[
0,
2,
1,
2,
0,
0,
1,
0,
2,
2,
2,
2
],
[
0,
2,
0,
1,
0,
0,
1,
0,
2,
0,
0,
2
],
[
0,
2,
1,
1,
0,
0,
1,
0,
2,
0,
0,
2
],
[
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
]
],
"rule_severities": {
"bus_definition_conflict": "error",
"bus_entry_needed": "error",
"bus_to_bus_conflict": "error",
"bus_to_net_conflict": "error",
"different_unit_footprint": "error",
"different_unit_net": "error",
"duplicate_reference": "error",
"duplicate_sheet_names": "error",
"endpoint_off_grid": "warning",
"extra_units": "error",
"field_name_whitespace": "warning",
"footprint_filter": "ignore",
"footprint_link_issues": "warning",
"four_way_junction": "ignore",
"ground_pin_not_ground": "warning",
"hier_label_mismatch": "error",
"isolated_pin_label": "warning",
"label_dangling": "error",
"label_multiple_wires": "warning",
"lib_symbol_issues": "warning",
"lib_symbol_mismatch": "warning",
"missing_bidi_pin": "warning",
"missing_input_pin": "warning",
"missing_power_pin": "error",
"missing_unit": "warning",
"multiple_net_names": "warning",
"net_not_bus_member": "warning",
"no_connect_connected": "warning",
"no_connect_dangling": "warning",
"pin_not_connected": "error",
"pin_not_driven": "error",
"pin_to_pin": "warning",
"power_pin_not_driven": "error",
"same_local_global_label": "warning",
"similar_label_and_power": "warning",
"similar_labels": "warning",
"similar_power": "warning",
"simulation_model_issue": "ignore",
"single_global_label": "ignore",
"stacked_pin_name": "warning",
"unannotated": "error",
"unconnected_wire_endpoint": "warning",
"undefined_netclass": "error",
"unit_value_mismatch": "error",
"unresolved_variable": "error",
"wire_dangling": "error"
}
},
"libraries": {
"pinned_footprint_libs": [],
"pinned_symbol_libs": []
@@ -287,6 +511,25 @@
"via_diameter": 0.6,
"via_drill": 0.3,
"wire_width": 6
},
{
"bus_width": 12,
"clearance": 0.25,
"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": "POWER",
"pcb_color": "rgba(0, 0, 0, 0.000)",
"priority": 0,
"schematic_color": "rgba(0, 0, 0, 0.000)",
"track_width": 0.5,
"tuning_profile": "",
"via_diameter": 0.8,
"via_drill": 0.4,
"wire_width": 6
}
],
"meta": {
@@ -307,10 +550,125 @@
"page_layout_descr_file": ""
},
"schematic": {
"annotate_start_num": 0,
"annotation": {
"method": 0,
"sort_order": 0
},
"bom_export_filename": "${PROJECTNAME}.csv",
"bom_fmt_presets": [],
"bom_fmt_settings": {
"field_delimiter": ",",
"keep_line_breaks": false,
"keep_tabs": false,
"name": "CSV",
"ref_delimiter": ",",
"ref_range_delimiter": "",
"string_delimiter": "\""
},
"bom_presets": [],
"bom_settings": {
"exclude_dnp": false,
"fields_ordered": [
{
"group_by": false,
"label": "Reference",
"name": "Reference",
"show": true
},
{
"group_by": false,
"label": "Qty",
"name": "${QUANTITY}",
"show": true
},
{
"group_by": true,
"label": "Value",
"name": "Value",
"show": true
},
{
"group_by": true,
"label": "DNP",
"name": "${DNP}",
"show": true
},
{
"group_by": true,
"label": "Exclude from BOM",
"name": "${EXCLUDE_FROM_BOM}",
"show": true
},
{
"group_by": true,
"label": "Exclude from Board",
"name": "${EXCLUDE_FROM_BOARD}",
"show": true
},
{
"group_by": true,
"label": "Footprint",
"name": "Footprint",
"show": true
},
{
"group_by": false,
"label": "Datasheet",
"name": "Datasheet",
"show": true
}
],
"filter_string": "",
"group_symbols": true,
"include_excluded_from_bom": true,
"name": "Default Editing",
"sort_asc": true,
"sort_field": "Reference"
},
"bus_aliases": {},
"connection_grid_size": 50.0,
"drawing": {
"dashed_lines_dash_length_ratio": 12.0,
"dashed_lines_gap_length_ratio": 3.0,
"default_line_thickness": 6.0,
"default_text_size": 50.0,
"field_names": [],
"hop_over_size_choice": 0,
"intersheets_ref_own_page": false,
"intersheets_ref_prefix": "",
"intersheets_ref_short": false,
"intersheets_ref_show": false,
"intersheets_ref_suffix": "",
"junction_size_choice": 3,
"label_size_ratio": 0.375,
"operating_point_overlay_i_precision": 3,
"operating_point_overlay_i_range": "~A",
"operating_point_overlay_v_precision": 3,
"operating_point_overlay_v_range": "~V",
"overbar_offset_ratio": 1.23,
"pin_symbol_size": 25.0,
"text_offset_ratio": 0.15
},
"legacy_lib_dir": "",
"legacy_lib_list": [],
"top_level_sheets": []
"meta": {
"version": 1
},
"page_layout_descr_file": "",
"plot_directory": "",
"reuse_designators": true,
"subpart_first_id": 65,
"subpart_id_separator": 0,
"top_level_sheets": [
{
"filename": "esp32-s3-sensor-node.kicad_sch",
"name": "esp32-s3-sensor-node",
"uuid": "00000000-0000-0000-0000-000000000000"
}
],
"used_designators": "",
"variants": []
},
"sheets": [],
"text_variables": {},
@@ -320,4 +678,4 @@
},
"tuning_profiles_impedance_geometric": []
}
}
}

File diff suppressed because one or more lines are too long

201
esp32-s3-sensor-node.net Normal file
View File

@@ -0,0 +1,201 @@
<?xml version="1.0" encoding="UTF-8"?>
<export version="E">
<design>
<source>esp32-s3-sensor-node.kicad_sch</source>
<date>2026-06-22</date>
<tool>pcb-wizard netlist gen</tool>
</design>
<components>
<comp ref="C1">
<value>100nF</value>
<footprint>Capacitor_SMD:C_0603_1608Metric</footprint>
</comp>
<comp ref="C2">
<value>100nF</value>
<footprint>Capacitor_SMD:C_0603_1608Metric</footprint>
</comp>
<comp ref="C3">
<value>10uF</value>
<footprint>Capacitor_SMD:C_0603_1608Metric</footprint>
</comp>
<comp ref="C4">
<value>100nF</value>
<footprint>Capacitor_SMD:C_0603_1608Metric</footprint>
</comp>
<comp ref="C5">
<value>10uF</value>
<footprint>Capacitor_SMD:C_0805_2012Metric</footprint>
</comp>
<comp ref="C6">
<value>10uF</value>
<footprint>Capacitor_SMD:C_0805_2012Metric</footprint>
</comp>
<comp ref="D1">
<value>LED_Green</value>
<footprint>LED_SMD:LED_0603_1608Metric</footprint>
</comp>
<comp ref="J1">
<value>USB-C</value>
<footprint>Connector_USB:USB_C_Receptacle_USB2.0_16P</footprint>
</comp>
<comp ref="J2">
<value>I2C_Sensor</value>
<footprint>Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical</footprint>
</comp>
<comp ref="J3">
<value>PROG</value>
<footprint>Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical</footprint>
</comp>
<comp ref="R1">
<value>470</value>
<footprint>Resistor_SMD:R_0603_1608Metric</footprint>
</comp>
<comp ref="R2">
<value>10k</value>
<footprint>Resistor_SMD:R_0603_1608Metric</footprint>
</comp>
<comp ref="R3">
<value>10k</value>
<footprint>Resistor_SMD:R_0603_1608Metric</footprint>
</comp>
<comp ref="R4">
<value>10k</value>
<footprint>Resistor_SMD:R_0603_1608Metric</footprint>
</comp>
<comp ref="R5">
<value>4.7k</value>
<footprint>Resistor_SMD:R_0603_1608Metric</footprint>
</comp>
<comp ref="R6">
<value>4.7k</value>
<footprint>Resistor_SMD:R_0603_1608Metric</footprint>
</comp>
<comp ref="R7">
<value>5.1k</value>
<footprint>Resistor_SMD:R_0603_1608Metric</footprint>
</comp>
<comp ref="R8">
<value>5.1k</value>
<footprint>Resistor_SMD:R_0603_1608Metric</footprint>
</comp>
<comp ref="U1">
<value>ESP32-S3-WROOM-1</value>
<footprint>RF_Module:ESP32-S3-WROOM-1</footprint>
</comp>
<comp ref="U2">
<value>AMS1117-3.3</value>
<footprint>Package_TO_SOT_SMD:SOT-223-3Lead_TabPin2</footprint>
</comp>
</components>
<nets>
<net code="1" name="GND">
<node ref="J1" pin="A1"/>
<node ref="J1" pin="B1"/>
<node ref="J1" pin="A12"/>
<node ref="J1" pin="B12"/>
<node ref="J1" pin="S1"/>
<node ref="J1" pin="S2"/>
<node ref="U1" pin="1"/>
<node ref="U1" pin="2"/>
<node ref="U1" pin="15"/>
<node ref="U1" pin="17"/>
<node ref="U1" pin="32"/>
<node ref="U1" pin="38"/>
<node ref="U1" pin="40"/>
<node ref="U1" pin="41"/>
<node ref="U2" pin="1"/>
<node ref="R4" pin="2"/>
<node ref="R7" pin="1"/>
<node ref="R8" pin="1"/>
<node ref="C1" pin="2"/>
<node ref="C2" pin="2"/>
<node ref="C3" pin="2"/>
<node ref="C4" pin="2"/>
<node ref="C5" pin="2"/>
<node ref="C6" pin="2"/>
<node ref="D1" pin="1"/>
<node ref="J2" pin="4"/>
<node ref="J3" pin="1"/>
</net>
<net code="2" name="3V3">
<node ref="U1" pin="3"/>
<node ref="U1" pin="4"/>
<node ref="U2" pin="2"/>
<node ref="R2" pin="2"/>
<node ref="R3" pin="1"/>
<node ref="R5" pin="1"/>
<node ref="R6" pin="1"/>
<node ref="C1" pin="1"/>
<node ref="C2" pin="1"/>
<node ref="C3" pin="1"/>
<node ref="C6" pin="1"/>
<node ref="J2" pin="1"/>
<node ref="J3" pin="4"/>
</net>
<net code="3" name="VBUS">
<node ref="J1" pin="A4"/>
<node ref="J1" pin="B4"/>
<node ref="J1" pin="A9"/>
<node ref="J1" pin="B9"/>
<node ref="U2" pin="3"/>
<node ref="C5" pin="1"/>
</net>
<net code="4" name="EN">
<node ref="U1" pin="9"/>
<node ref="R2" pin="1"/>
<node ref="C4" pin="1"/>
</net>
<net code="5" name="IO0">
<node ref="U1" pin="27"/>
<node ref="R3" pin="2"/>
</net>
<net code="6" name="IO12">
<node ref="U1" pin="20"/>
<node ref="R4" pin="1"/>
</net>
<net code="7" name="SDA">
<node ref="U1" pin="8"/>
<node ref="R5" pin="2"/>
<node ref="J2" pin="2"/>
</net>
<net code="8" name="SCL">
<node ref="U1" pin="10"/>
<node ref="R6" pin="2"/>
<node ref="J2" pin="3"/>
</net>
<net code="9" name="USB_D_P">
<node ref="J1" pin="A6"/>
<node ref="J1" pin="B6"/>
<node ref="U1" pin="14"/>
</net>
<net code="10" name="USB_D_N">
<node ref="J1" pin="A7"/>
<node ref="J1" pin="B7"/>
<node ref="U1" pin="13"/>
</net>
<net code="11" name="CC1">
<node ref="J1" pin="A5"/>
<node ref="R7" pin="2"/>
</net>
<net code="12" name="CC2">
<node ref="J1" pin="B5"/>
<node ref="R8" pin="2"/>
</net>
<net code="13" name="IO2_LED">
<node ref="U1" pin="38"/>
<node ref="R1" pin="1"/>
</net>
<net code="14" name="D1_A">
<node ref="R1" pin="2"/>
<node ref="D1" pin="2"/>
</net>
<net code="15" name="RXD0">
<node ref="U1" pin="36"/>
<node ref="J3" pin="2"/>
</net>
<net code="16" name="TXD0">
<node ref="U1" pin="37"/>
<node ref="J3" pin="3"/>
</net>
</nets>
</export>

File diff suppressed because it is too large Load Diff

86
gen_dsn.py Normal file
View File

@@ -0,0 +1,86 @@
#!/usr/bin/env python3
"""
ESP32-S3 Sensor Node — Specctra DSN Generator v2
Uses exact format from known-working DSN file.
"""
import os
PROJ = os.path.expanduser("~/Documents/KiCad/10.0/esp32-s3-sensor-node")
TEMPLATE = os.path.expanduser("~/Documents/KiCad/10.0/USB_PD_ESP32S3/freerouting.dsn")
def gen():
templ = open(TEMPLATE).read()
# Replace key sections
# 1. Board outline
templ = templ.replace(
'(rect 0 0 100000 80000)',
'(rect 0 0 65000 40000)'
)
# 2. Keepout zones (after GND layer)
# Find the end of layer definitions and add keepout
keepout_section = '''
(place_rule (F.Cu (clearance 200)))
(place_rule (B.Cu (clearance 200)))
(rule (clearance 150))
(rule "3V3" (clearance 250))
(rule "VBUS" (clearance 250))
(rule "USB_D_P" (clearance 150))
(rule "USB_D_N" (clearance 150))
(keepout F.Cu (rect 46000 28000 65000 40000))
(keepout B.Cu (rect 46000 28000 65000 40000))
)'''
# Find structure closing
struct_end = templ.find('\n )\n', templ.find('(structure'))
if struct_end > 0:
templ = templ[:struct_end] + keepout_section + templ[struct_end:]
# 3. Replace nets
nets_section = gen_nets()
net_start = templ.find('(network\n')
net_end = templ.find('\n)', net_start) + 2
if net_start > 0:
templ = templ[:net_start] + nets_section + templ[net_end:]
# Write
dsn = os.path.join(PROJ, "esp32-s3-sensor-node.dsn")
open(dsn, 'w').write(templ)
print(f"Written: {dsn} ({len(templ)} bytes)")
NETS = {
"GND": ["J1-SH","J1-A1","J1-B1","U2-1","U1-1","U1-16","U1-40",
"C1-2","C2-2","C3-2","C4-2","C5-2","C6-2",
"D1-1","R4-2","R7-2","R8-2","J2-4","J3-1"],
"3V3": ["U2-2","U1-2","C1-1","C2-1","C3-1","C6-1",
"R2-2","R3-2","R5-2","R6-2","J2-1","J3-4"],
"VBUS": ["J1-A4","J1-B4","U2-3","C5-1"],
"EN": ["U1-3","R2-1","C4-1"],
"IO0": ["U1-27","R3-1"],
"IO12": ["U1-20","R4-1"],
"SDA": ["U1-4","R5-1","J2-2"],
"SCL": ["U1-5","R6-1","J2-3"],
"USB_D_P": ["J1-A6","J1-B6","U1-14"],
"USB_D_N": ["J1-A7","J1-B7","U1-13"],
"CC1": ["J1-A5","R7-1"],
"CC2": ["J1-B5","R8-1"],
"IO2_LED": ["U1-38","R1-1"],
"D1_A": ["R1-2","D1-2"],
"RXD0": ["U1-36","J3-2"],
"TXD0": ["U1-37","J3-3"],
}
def gen_nets():
lines = ['(network']
for name, pins in NETS.items():
lines.append(f' (net "{name}"')
for pin in pins:
ref, pn = pin.split('-')
lines.append(f' (pin {ref} {pn})')
lines.append(f' )')
lines.append(')')
return '\n'.join(lines)
if __name__ == "__main__":
gen()

View File

@@ -0,0 +1,295 @@
%TF.GenerationSoftware,KiCad,Pcbnew,10.0.2*%
%TF.CreationDate,2026-06-22T21:18:27+03:00*%
%TF.ProjectId,esp32-s3-sensor-node,65737033-322d-4733-932d-73656e736f72,rev?*%
%TF.SameCoordinates,Original*%
%TF.FileFunction,Copper,L2,Bot*%
%TF.FilePolarity,Positive*%
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW 10.0.2) date 2026-06-22 21:18:27*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
%TA.AperFunction,ComponentPad*%
%ADD10O,1.000000X2.100000*%
%TD*%
%TA.AperFunction,ComponentPad*%
%ADD11O,1.000000X1.600000*%
%TD*%
%TA.AperFunction,ComponentPad*%
%ADD12R,1.700000X1.700000*%
%TD*%
%TA.AperFunction,ComponentPad*%
%ADD13C,1.700000*%
%TD*%
%TA.AperFunction,HeatsinkPad*%
%ADD14C,0.600000*%
%TD*%
%TA.AperFunction,ViaPad*%
%ADD15C,0.600000*%
%TD*%
%TA.AperFunction,Conductor*%
%ADD16C,0.200000*%
%TD*%
G04 APERTURE END LIST*
D10*
%TO.P,J1,SH*%
%TO.N,GND*%
X2680000Y-16870000D03*
D11*
X2680000Y-21050000D03*
D10*
X11320000Y-16870000D03*
D11*
X11320000Y-21050000D03*
%TD*%
D12*
%TO.P,J3,1*%
%TO.N,GND*%
X25000000Y-3000000D03*
D13*
%TO.P,J3,2*%
%TO.N,RXD0*%
X25000000Y-5540000D03*
%TO.P,J3,3*%
%TO.N,TXD0*%
X25000000Y-8080000D03*
%TO.P,J3,4*%
%TO.N,3V3*%
X25000000Y-10620000D03*
%TD*%
D14*
%TO.P,U1,41*%
%TO.N,GND*%
X35100000Y-23760000D03*
X35100000Y-25160000D03*
X35800000Y-23060000D03*
X35800000Y-24460000D03*
X35800000Y-25860000D03*
X36500000Y-23760000D03*
X36500000Y-25160000D03*
X37200000Y-23060000D03*
X37200000Y-24460000D03*
X37200000Y-25860000D03*
X37900000Y-23760000D03*
X37900000Y-25160000D03*
%TD*%
D12*
%TO.P,J2,1*%
%TO.N,3V3*%
X58000000Y-20000000D03*
D13*
%TO.P,J2,2*%
%TO.N,SDA*%
X58000000Y-22540000D03*
%TO.P,J2,3*%
%TO.N,SCL*%
X58000000Y-25080000D03*
%TO.P,J2,4*%
%TO.N,GND*%
X58000000Y-27620000D03*
%TD*%
D15*
%TO.N,GND*%
X60500000Y-10500000D03*
X10500000Y-5500000D03*
X50500000Y-500000D03*
X25500000Y-15500000D03*
X45500000Y-500000D03*
X5500000Y-25500000D03*
X45500000Y-5500000D03*
X55500000Y-500000D03*
X5500000Y-500000D03*
X50500000Y-25500000D03*
X35500000Y-15500000D03*
X500000Y-5500000D03*
X500000Y-15500000D03*
X20500000Y-10500000D03*
X60500000Y-25500000D03*
X60500000Y-30500000D03*
X5500000Y-35500000D03*
X40500000Y-30500000D03*
X60500000Y-15500000D03*
X500000Y-500000D03*
X35500000Y-10500000D03*
X55500000Y-35500000D03*
X30500000Y-5500000D03*
X10500000Y-30500000D03*
X45500000Y-10500000D03*
X35800400Y-36687300D03*
X8925200Y-22736900D03*
X500000Y-20500000D03*
X10500000Y-20500000D03*
X15500000Y-30500000D03*
X24950000Y-21764600D03*
X20500000Y-500000D03*
X15500000Y-15500000D03*
X50500000Y-30500000D03*
X25500000Y-20500000D03*
X60500000Y-35500000D03*
X30514300Y-16740000D03*
X5500000Y-30500000D03*
X30500000Y-15500000D03*
X15500000Y-10500000D03*
X30500000Y-500000D03*
X20500000Y-30500000D03*
X55500000Y-5500000D03*
X5500000Y-5500000D03*
X40500000Y-25500000D03*
X500000Y-10500000D03*
X500000Y-35500000D03*
X45500000Y-30500000D03*
X60500000Y-5500000D03*
X40500000Y-500000D03*
X60500000Y-20500000D03*
X500000Y-25500000D03*
X15500000Y-500000D03*
X5500000Y-10500000D03*
X10500000Y-10500000D03*
X37752800Y-16596700D03*
X40500000Y-5500000D03*
X55500000Y-15500000D03*
X20500000Y-35500000D03*
X20500000Y-15500000D03*
X30500000Y-10500000D03*
X10500000Y-25500000D03*
X40500000Y-10500000D03*
X30500000Y-25500000D03*
X500000Y-30500000D03*
X15500000Y-35500000D03*
X10500000Y-35500000D03*
X20500000Y-25500000D03*
X10500000Y-500000D03*
X60500000Y-500000D03*
X45500000Y-20500000D03*
X5500000Y-20500000D03*
X35500000Y-5500000D03*
X55500000Y-10500000D03*
X15500000Y-25500000D03*
X50500000Y-5500000D03*
X50500000Y-10500000D03*
X15500000Y-5500000D03*
X25500000Y-500000D03*
X35500000Y-500000D03*
X20500000Y-5500000D03*
X50500000Y-20500000D03*
%TO.N,EN*%
X27994900Y-19533300D03*
X25225000Y-32921200D03*
%TO.N,NC*%
X25979800Y-23070700D03*
X7933400Y-14686200D03*
%TO.N,SDA*%
X38813000Y-30710000D03*
%TO.N,USB_D_N*%
X6366700Y-17293300D03*
X6366700Y-38609200D03*
X30917500Y-38609200D03*
X30917500Y-31980000D03*
%TO.N,USB_D_P*%
X7416500Y-17210000D03*
X13492500Y-29793900D03*
%TO.N,SCL*%
X54534400Y-36046200D03*
%TD*%
%TO.N,GND*%
D16*
X37752800Y-22507200D02*
X37752800Y-16596700D01*
X2680000Y-21050000D02*
X2680000Y-16870000D01*
X30514300Y-18507900D02*
X30514300Y-16740000D01*
X35800000Y-25860000D02*
X35800000Y-24460000D01*
X35800400Y-25860400D02*
X35800000Y-25860000D01*
X37200000Y-23060000D02*
X37752800Y-22507200D01*
X28122800Y-18507900D02*
X24950000Y-21680700D01*
X35100000Y-25160000D02*
X35100000Y-23760000D01*
X35800400Y-36687300D02*
X35800400Y-25860400D01*
X9510400Y-22151700D02*
X8925200Y-22736900D01*
X11320000Y-22151700D02*
X9510400Y-22151700D01*
X35100000Y-23760000D02*
X35100000Y-23093600D01*
X28122800Y-18507900D02*
X24950000Y-21680700D01*
X9510400Y-22151700D02*
X8925200Y-22736900D01*
X30514300Y-18507900D02*
X28122800Y-18507900D01*
X35100000Y-23093600D02*
X30514300Y-18507900D01*
X35800400Y-25860400D02*
X35800000Y-25860000D01*
X24950000Y-21680700D02*
X24950000Y-21764600D01*
X24950000Y-21680700D02*
X24950000Y-21764600D01*
X11320000Y-21050000D02*
X11320000Y-22151700D01*
X11320000Y-21050000D02*
X11320000Y-16870000D01*
X37752800Y-22507200D02*
X37752800Y-16596700D01*
X35800000Y-25160000D02*
X36500000Y-25160000D01*
X35800000Y-24460000D02*
X35800000Y-23060000D01*
X35100000Y-23093600D02*
X30514300Y-18507900D01*
X11320000Y-22151700D02*
X9510400Y-22151700D01*
%TO.N,EN*%
X25225000Y-32921200D02*
X27994900Y-30151300D01*
X27994900Y-30151300D02*
X27994900Y-19533300D01*
X27994900Y-30151300D02*
X27994900Y-19533300D01*
%TO.N,NC*%
X7933400Y-14686200D02*
X10857500Y-14686200D01*
X19242000Y-23070700D02*
X25979800Y-23070700D01*
X10857500Y-14686200D02*
X19242000Y-23070700D01*
X10857500Y-14686200D02*
X19242000Y-23070700D01*
X19242000Y-23070700D02*
X25979800Y-23070700D01*
%TO.N,SDA*%
X58000000Y-22540000D02*
X46983000Y-22540000D01*
X46983000Y-22540000D02*
X38813000Y-30710000D01*
X46983000Y-22540000D02*
X38813000Y-30710000D01*
%TO.N,USB_D_N*%
X30917500Y-38609200D02*
X30917500Y-31980000D01*
X6366700Y-17293300D02*
X6366700Y-38609200D01*
%TO.N,USB_D_P*%
X7416500Y-23717900D02*
X7416500Y-17210000D01*
X13492500Y-29793900D02*
X7416500Y-23717900D01*
X7416500Y-23717900D02*
X7416500Y-17210000D01*
%TO.N,SCL*%
X54534400Y-28545600D02*
X54534400Y-36046200D01*
X58000000Y-25080000D02*
X54534400Y-28545600D01*
X54534400Y-28545600D02*
X54534400Y-36046200D01*
%TD*%
M02*

View File

@@ -0,0 +1,49 @@
%TF.GenerationSoftware,KiCad,Pcbnew,10.0.2*%
%TF.CreationDate,2026-06-22T21:18:28+03:00*%
%TF.ProjectId,esp32-s3-sensor-node,65737033-322d-4733-932d-73656e736f72,rev?*%
%TF.SameCoordinates,Original*%
%TF.FileFunction,Soldermask,Bot*%
%TF.FilePolarity,Negative*%
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW 10.0.2) date 2026-06-22 21:18:28*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
%ADD10C,0.650000*%
%ADD11O,1.000000X2.100000*%
%ADD12O,1.000000X1.600000*%
%ADD13R,1.700000X1.700000*%
%ADD14C,1.700000*%
G04 APERTURE END LIST*
D10*
%TO.C,J1*%
X4110000Y-17400000D03*
X9890000Y-17400000D03*
D11*
X2680000Y-16870000D03*
D12*
X2680000Y-21050000D03*
D11*
X11320000Y-16870000D03*
D12*
X11320000Y-21050000D03*
%TD*%
D13*
%TO.C,J3*%
X25000000Y-3000000D03*
D14*
X25000000Y-5540000D03*
X25000000Y-8080000D03*
X25000000Y-10620000D03*
%TD*%
D13*
%TO.C,J2*%
X58000000Y-20000000D03*
D14*
X58000000Y-22540000D03*
X58000000Y-25080000D03*
X58000000Y-27620000D03*
%TD*%
M02*

View File

@@ -0,0 +1,15 @@
%TF.GenerationSoftware,KiCad,Pcbnew,10.0.2*%
%TF.CreationDate,2026-06-22T21:18:27+03:00*%
%TF.ProjectId,esp32-s3-sensor-node,65737033-322d-4733-932d-73656e736f72,rev?*%
%TF.SameCoordinates,Original*%
%TF.FileFunction,Paste,Bot*%
%TF.FilePolarity,Positive*%
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW 10.0.2) date 2026-06-22 21:18:27*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
G04 APERTURE END LIST*
M02*

View File

@@ -0,0 +1,15 @@
%TF.GenerationSoftware,KiCad,Pcbnew,10.0.2*%
%TF.CreationDate,2026-06-22T21:18:27+03:00*%
%TF.ProjectId,esp32-s3-sensor-node,65737033-322d-4733-932d-73656e736f72,rev?*%
%TF.SameCoordinates,Original*%
%TF.FileFunction,Legend,Bot*%
%TF.FilePolarity,Positive*%
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW 10.0.2) date 2026-06-22 21:18:27*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
G04 APERTURE END LIST*
M02*

View File

@@ -0,0 +1,26 @@
%TF.GenerationSoftware,KiCad,Pcbnew,10.0.2*%
%TF.CreationDate,2026-06-22T21:18:28+03:00*%
%TF.ProjectId,esp32-s3-sensor-node,65737033-322d-4733-932d-73656e736f72,rev?*%
%TF.SameCoordinates,Original*%
%TF.FileFunction,Profile,NP*%
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW 10.0.2) date 2026-06-22 21:18:28*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
%TA.AperFunction,Profile*%
%ADD10C,0.100000*%
%TD*%
G04 APERTURE END LIST*
D10*
X0Y0D02*
X65000000Y0D01*
X0Y-40000000D02*
X0Y0D01*
X65000000Y0D02*
X65000000Y-40000000D01*
X65000000Y-40000000D02*
X0Y-40000000D01*
M02*

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,241 @@
%TF.GenerationSoftware,KiCad,Pcbnew,10.0.2*%
%TF.CreationDate,2026-06-22T21:18:27+03:00*%
%TF.ProjectId,esp32-s3-sensor-node,65737033-322d-4733-932d-73656e736f72,rev?*%
%TF.SameCoordinates,Original*%
%TF.FileFunction,Soldermask,Top*%
%TF.FilePolarity,Negative*%
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW 10.0.2) date 2026-06-22 21:18:27*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
G04 Aperture macros list*
%AMRoundRect*
0 Rectangle with rounded corners*
0 $1 Rounding radius*
0 $2 $3 $4 $5 $6 $7 $8 $9 X,Y pos of 4 corners*
0 Add a 4 corners polygon primitive as box body*
4,1,4,$2,$3,$4,$5,$6,$7,$8,$9,$2,$3,0*
0 Add four circle primitives for the rounded corners*
1,1,$1+$1,$2,$3*
1,1,$1+$1,$4,$5*
1,1,$1+$1,$6,$7*
1,1,$1+$1,$8,$9*
0 Add four rect primitives between the rounded corners*
20,1,$1+$1,$2,$3,$4,$5,0*
20,1,$1+$1,$4,$5,$6,$7,0*
20,1,$1+$1,$6,$7,$8,$9,0*
20,1,$1+$1,$8,$9,$2,$3,0*%
G04 Aperture macros list end*
%ADD10RoundRect,0.225000X-0.225000X-0.250000X0.225000X-0.250000X0.225000X0.250000X-0.225000X0.250000X0*%
%ADD11RoundRect,0.250000X-0.250000X-0.475000X0.250000X-0.475000X0.250000X0.475000X-0.250000X0.475000X0*%
%ADD12RoundRect,0.218750X-0.218750X-0.256250X0.218750X-0.256250X0.218750X0.256250X-0.218750X0.256250X0*%
%ADD13C,0.650000*%
%ADD14RoundRect,0.150000X-0.150000X-0.575000X0.150000X-0.575000X0.150000X0.575000X-0.150000X0.575000X0*%
%ADD15RoundRect,0.075000X-0.075000X-0.650000X0.075000X-0.650000X0.075000X0.650000X-0.075000X0.650000X0*%
%ADD16O,1.000000X2.100000*%
%ADD17O,1.000000X1.600000*%
%ADD18RoundRect,0.200000X-0.200000X-0.275000X0.200000X-0.275000X0.200000X0.275000X-0.200000X0.275000X0*%
%ADD19R,1.700000X1.700000*%
%ADD20C,1.700000*%
%ADD21R,1.500000X0.900000*%
%ADD22R,0.900000X1.500000*%
%ADD23C,0.600000*%
%ADD24R,3.900000X3.900000*%
%ADD25RoundRect,0.375000X-0.625000X-0.375000X0.625000X-0.375000X0.625000X0.375000X-0.625000X0.375000X0*%
%ADD26RoundRect,0.500000X-0.500000X-1.400000X0.500000X-1.400000X0.500000X1.400000X-0.500000X1.400000X0*%
G04 APERTURE END LIST*
D10*
%TO.C,C2*%
X29225000Y-25000000D03*
X30775000Y-25000000D03*
%TD*%
%TO.C,C1*%
X29225000Y-28000000D03*
X30775000Y-28000000D03*
%TD*%
D11*
%TO.C,C6*%
X23050000Y-23000000D03*
X24950000Y-23000000D03*
%TD*%
D12*
%TO.C,D1*%
X54212500Y-34000000D03*
X55787500Y-34000000D03*
%TD*%
D13*
%TO.C,J1*%
X4110000Y-17400000D03*
X9890000Y-17400000D03*
D14*
X3750000Y-15955000D03*
X4550000Y-15955000D03*
D15*
X5750000Y-15955000D03*
X6750000Y-15955000D03*
X7250000Y-15955000D03*
X8250000Y-15955000D03*
D14*
X9450000Y-15955000D03*
X10250000Y-15955000D03*
X10250000Y-15955000D03*
X9450000Y-15955000D03*
D15*
X8750000Y-15955000D03*
X7750000Y-15955000D03*
X6250000Y-15955000D03*
X5250000Y-15955000D03*
D14*
X4550000Y-15955000D03*
X3750000Y-15955000D03*
D16*
X2680000Y-16870000D03*
D17*
X2680000Y-21050000D03*
D16*
X11320000Y-16870000D03*
D17*
X11320000Y-21050000D03*
%TD*%
D18*
%TO.C,R1*%
X54175000Y-30000000D03*
X55825000Y-30000000D03*
%TD*%
D19*
%TO.C,J3*%
X25000000Y-3000000D03*
D20*
X25000000Y-5540000D03*
X25000000Y-8080000D03*
X25000000Y-10620000D03*
%TD*%
D11*
%TO.C,C5*%
X23050000Y-17000000D03*
X24950000Y-17000000D03*
%TD*%
D18*
%TO.C,R2*%
X26175000Y-32000000D03*
X27825000Y-32000000D03*
%TD*%
D10*
%TO.C,C4*%
X25225000Y-35000000D03*
X26775000Y-35000000D03*
%TD*%
D18*
%TO.C,R7*%
X10175000Y-28000000D03*
X11825000Y-28000000D03*
%TD*%
D21*
%TO.C,U1*%
X29250000Y-16740000D03*
X29250000Y-18010000D03*
X29250000Y-19280000D03*
X29250000Y-20550000D03*
X29250000Y-21820000D03*
X29250000Y-23090000D03*
X29250000Y-24360000D03*
X29250000Y-25630000D03*
X29250000Y-26900000D03*
X29250000Y-28170000D03*
X29250000Y-29440000D03*
X29250000Y-30710000D03*
X29250000Y-31980000D03*
X29250000Y-33250000D03*
D22*
X31015000Y-34500000D03*
X32285000Y-34500000D03*
X33555000Y-34500000D03*
X34825000Y-34500000D03*
X36095000Y-34500000D03*
X37365000Y-34500000D03*
X38635000Y-34500000D03*
X39905000Y-34500000D03*
X41175000Y-34500000D03*
X42445000Y-34500000D03*
X43715000Y-34500000D03*
X44985000Y-34500000D03*
D21*
X46750000Y-33250000D03*
X46750000Y-31980000D03*
X46750000Y-30710000D03*
X46750000Y-29440000D03*
X46750000Y-28170000D03*
X46750000Y-26900000D03*
X46750000Y-25630000D03*
X46750000Y-24360000D03*
X46750000Y-23090000D03*
X46750000Y-21820000D03*
X46750000Y-20550000D03*
X46750000Y-19280000D03*
X46750000Y-18010000D03*
X46750000Y-16740000D03*
D23*
X35100000Y-23760000D03*
X35100000Y-25160000D03*
X35800000Y-23060000D03*
X35800000Y-24460000D03*
X35800000Y-25860000D03*
X36500000Y-23760000D03*
D24*
X36500000Y-24460000D03*
D23*
X36500000Y-25160000D03*
X37200000Y-23060000D03*
X37200000Y-24460000D03*
X37200000Y-25860000D03*
X37900000Y-23760000D03*
X37900000Y-25160000D03*
%TD*%
D18*
%TO.C,R3*%
X15175000Y-7000000D03*
X16825000Y-7000000D03*
%TD*%
D25*
%TO.C,U2*%
X16850000Y-17700000D03*
X16850000Y-20000000D03*
D26*
X23150000Y-20000000D03*
D25*
X16850000Y-22300000D03*
%TD*%
D10*
%TO.C,C3*%
X29225000Y-22000000D03*
X30775000Y-22000000D03*
%TD*%
D18*
%TO.C,R4*%
X15175000Y-12000000D03*
X16825000Y-12000000D03*
%TD*%
%TO.C,R6*%
X47175000Y-22000000D03*
X48825000Y-22000000D03*
%TD*%
%TO.C,R8*%
X10175000Y-25000000D03*
X11825000Y-25000000D03*
%TD*%
%TO.C,R5*%
X47175000Y-24000000D03*
X48825000Y-24000000D03*
%TD*%
D19*
%TO.C,J2*%
X58000000Y-20000000D03*
D20*
X58000000Y-22540000D03*
X58000000Y-25080000D03*
X58000000Y-27620000D03*
%TD*%
M02*

View File

@@ -0,0 +1,202 @@
%TF.GenerationSoftware,KiCad,Pcbnew,10.0.2*%
%TF.CreationDate,2026-06-22T21:18:27+03:00*%
%TF.ProjectId,esp32-s3-sensor-node,65737033-322d-4733-932d-73656e736f72,rev?*%
%TF.SameCoordinates,Original*%
%TF.FileFunction,Paste,Top*%
%TF.FilePolarity,Positive*%
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW 10.0.2) date 2026-06-22 21:18:27*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
G04 Aperture macros list*
%AMRoundRect*
0 Rectangle with rounded corners*
0 $1 Rounding radius*
0 $2 $3 $4 $5 $6 $7 $8 $9 X,Y pos of 4 corners*
0 Add a 4 corners polygon primitive as box body*
4,1,4,$2,$3,$4,$5,$6,$7,$8,$9,$2,$3,0*
0 Add four circle primitives for the rounded corners*
1,1,$1+$1,$2,$3*
1,1,$1+$1,$4,$5*
1,1,$1+$1,$6,$7*
1,1,$1+$1,$8,$9*
0 Add four rect primitives between the rounded corners*
20,1,$1+$1,$2,$3,$4,$5,0*
20,1,$1+$1,$4,$5,$6,$7,0*
20,1,$1+$1,$6,$7,$8,$9,0*
20,1,$1+$1,$8,$9,$2,$3,0*%
G04 Aperture macros list end*
%ADD10RoundRect,0.225000X-0.225000X-0.250000X0.225000X-0.250000X0.225000X0.250000X-0.225000X0.250000X0*%
%ADD11RoundRect,0.250000X-0.250000X-0.475000X0.250000X-0.475000X0.250000X0.475000X-0.250000X0.475000X0*%
%ADD12RoundRect,0.218750X-0.218750X-0.256250X0.218750X-0.256250X0.218750X0.256250X-0.218750X0.256250X0*%
%ADD13RoundRect,0.150000X-0.150000X-0.575000X0.150000X-0.575000X0.150000X0.575000X-0.150000X0.575000X0*%
%ADD14RoundRect,0.075000X-0.075000X-0.650000X0.075000X-0.650000X0.075000X0.650000X-0.075000X0.650000X0*%
%ADD15RoundRect,0.200000X-0.200000X-0.275000X0.200000X-0.275000X0.200000X0.275000X-0.200000X0.275000X0*%
%ADD16R,0.900000X0.900000*%
%ADD17R,1.500000X0.900000*%
%ADD18R,0.900000X1.500000*%
%ADD19RoundRect,0.375000X-0.625000X-0.375000X0.625000X-0.375000X0.625000X0.375000X-0.625000X0.375000X0*%
%ADD20RoundRect,0.500000X-0.500000X-1.400000X0.500000X-1.400000X0.500000X1.400000X-0.500000X1.400000X0*%
G04 APERTURE END LIST*
D10*
%TO.C,C2*%
X29225000Y-25000000D03*
X30775000Y-25000000D03*
%TD*%
%TO.C,C1*%
X29225000Y-28000000D03*
X30775000Y-28000000D03*
%TD*%
D11*
%TO.C,C6*%
X23050000Y-23000000D03*
X24950000Y-23000000D03*
%TD*%
D12*
%TO.C,D1*%
X54212500Y-34000000D03*
X55787500Y-34000000D03*
%TD*%
D13*
%TO.C,J1*%
X3750000Y-15955000D03*
X4550000Y-15955000D03*
D14*
X5750000Y-15955000D03*
X6750000Y-15955000D03*
X7250000Y-15955000D03*
X8250000Y-15955000D03*
D13*
X9450000Y-15955000D03*
X10250000Y-15955000D03*
X10250000Y-15955000D03*
X9450000Y-15955000D03*
D14*
X8750000Y-15955000D03*
X7750000Y-15955000D03*
X6250000Y-15955000D03*
X5250000Y-15955000D03*
D13*
X4550000Y-15955000D03*
X3750000Y-15955000D03*
%TD*%
D15*
%TO.C,R1*%
X54175000Y-30000000D03*
X55825000Y-30000000D03*
%TD*%
D11*
%TO.C,C5*%
X23050000Y-17000000D03*
X24950000Y-17000000D03*
%TD*%
D15*
%TO.C,R2*%
X26175000Y-32000000D03*
X27825000Y-32000000D03*
%TD*%
D10*
%TO.C,C4*%
X25225000Y-35000000D03*
X26775000Y-35000000D03*
%TD*%
D15*
%TO.C,R7*%
X10175000Y-28000000D03*
X11825000Y-28000000D03*
%TD*%
D16*
%TO.C,U1*%
X35100000Y-23060000D03*
X35100000Y-24460000D03*
X35100000Y-25860000D03*
X36500000Y-23060000D03*
X36500000Y-24460000D03*
X36500000Y-25860000D03*
X37900000Y-23060000D03*
X37900000Y-24460000D03*
X37900000Y-25860000D03*
D17*
X29250000Y-16740000D03*
X29250000Y-18010000D03*
X29250000Y-19280000D03*
X29250000Y-20550000D03*
X29250000Y-21820000D03*
X29250000Y-23090000D03*
X29250000Y-24360000D03*
X29250000Y-25630000D03*
X29250000Y-26900000D03*
X29250000Y-28170000D03*
X29250000Y-29440000D03*
X29250000Y-30710000D03*
X29250000Y-31980000D03*
X29250000Y-33250000D03*
D18*
X31015000Y-34500000D03*
X32285000Y-34500000D03*
X33555000Y-34500000D03*
X34825000Y-34500000D03*
X36095000Y-34500000D03*
X37365000Y-34500000D03*
X38635000Y-34500000D03*
X39905000Y-34500000D03*
X41175000Y-34500000D03*
X42445000Y-34500000D03*
X43715000Y-34500000D03*
X44985000Y-34500000D03*
D17*
X46750000Y-33250000D03*
X46750000Y-31980000D03*
X46750000Y-30710000D03*
X46750000Y-29440000D03*
X46750000Y-28170000D03*
X46750000Y-26900000D03*
X46750000Y-25630000D03*
X46750000Y-24360000D03*
X46750000Y-23090000D03*
X46750000Y-21820000D03*
X46750000Y-20550000D03*
X46750000Y-19280000D03*
X46750000Y-18010000D03*
X46750000Y-16740000D03*
%TD*%
D15*
%TO.C,R3*%
X15175000Y-7000000D03*
X16825000Y-7000000D03*
%TD*%
D19*
%TO.C,U2*%
X16850000Y-17700000D03*
X16850000Y-20000000D03*
D20*
X23150000Y-20000000D03*
D19*
X16850000Y-22300000D03*
%TD*%
D10*
%TO.C,C3*%
X29225000Y-22000000D03*
X30775000Y-22000000D03*
%TD*%
D15*
%TO.C,R4*%
X15175000Y-12000000D03*
X16825000Y-12000000D03*
%TD*%
%TO.C,R6*%
X47175000Y-22000000D03*
X48825000Y-22000000D03*
%TD*%
%TO.C,R8*%
X10175000Y-25000000D03*
X11825000Y-25000000D03*
%TD*%
%TO.C,R5*%
X47175000Y-24000000D03*
X48825000Y-24000000D03*
%TD*%
M02*

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,14 @@
value,footprint,quantity,references
AMS1117-3.3,Package_TO_SOT_SMD:SOT-223-3_TabPin2,1,['U2']
USB-C,Connector_USB:USB_C_Receptacle_HRO_TYPE-C-31-M-12,1,['J1']
100nF,Capacitor_SMD:C_0603_1608Metric,3,"['C2', 'C1', 'C4']"
10uF,Capacitor_SMD:C_0805_2012Metric,2,"['C6', 'C5']"
LED_Green,LED_SMD:LED_0603_1608Metric,1,['D1']
470,Resistor_SMD:R_0603_1608Metric,1,['R1']
PROG,Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical,1,['J3']
10k,Resistor_SMD:R_0603_1608Metric,3,"['R2', 'R3', 'R4']"
5.1k,Resistor_SMD:R_0603_1608Metric,2,"['R7', 'R8']"
ESP32-S3-WROOM-1,RF_Module:ESP32-S3-WROOM-1,1,['U1']
10uF,Capacitor_SMD:C_0603_1608Metric,1,['C3']
4.7k,Resistor_SMD:R_0603_1608Metric,2,"['R6', 'R5']"
I2C_Sensor,Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical,1,['J2']
1 value footprint quantity references
2 AMS1117-3.3 Package_TO_SOT_SMD:SOT-223-3_TabPin2 1 ['U2']
3 USB-C Connector_USB:USB_C_Receptacle_HRO_TYPE-C-31-M-12 1 ['J1']
4 100nF Capacitor_SMD:C_0603_1608Metric 3 ['C2', 'C1', 'C4']
5 10uF Capacitor_SMD:C_0805_2012Metric 2 ['C6', 'C5']
6 LED_Green LED_SMD:LED_0603_1608Metric 1 ['D1']
7 470 Resistor_SMD:R_0603_1608Metric 1 ['R1']
8 PROG Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical 1 ['J3']
9 10k Resistor_SMD:R_0603_1608Metric 3 ['R2', 'R3', 'R4']
10 5.1k Resistor_SMD:R_0603_1608Metric 2 ['R7', 'R8']
11 ESP32-S3-WROOM-1 RF_Module:ESP32-S3-WROOM-1 1 ['U1']
12 10uF Capacitor_SMD:C_0603_1608Metric 1 ['C3']
13 4.7k Resistor_SMD:R_0603_1608Metric 2 ['R6', 'R5']
14 I2C_Sensor Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical 1 ['J2']

View File

@@ -0,0 +1,127 @@
{
"Header": {
"GenerationSoftware": {
"Vendor": "KiCad",
"Application": "Pcbnew",
"Version": "10.0.2"
},
"CreationDate": "2026-06-22T21:18:28+03:00"
},
"GeneralSpecs": {
"ProjectId": {
"Name": "esp32-s3-sensor-node",
"GUID": "65737033-322d-4733-932d-73656e736f72",
"Revision": "rev?"
},
"Size": {
"X": 65.1,
"Y": 40.1
},
"LayerNumber": 2,
"BoardThickness": 1.6,
"Finish": "None"
},
"DesignRules": [
{
"Layers": "Outer",
"PadToPad": 0.2,
"PadToTrack": 0.2,
"TrackToTrack": 0.2,
"MinLineWidth": 0.2,
"TrackToRegion": 0.3,
"RegionToRegion": 0.3
}
],
"FilesAttributes": [
{
"Path": "esp32-s3-sensor-node-F_Cu.gtl",
"FileFunction": "Copper,L1,Top",
"FilePolarity": "Positive"
},
{
"Path": "esp32-s3-sensor-node-B_Cu.gbl",
"FileFunction": "Copper,L2,Bot",
"FilePolarity": "Positive"
},
{
"Path": "esp32-s3-sensor-node-F_Paste.gtp",
"FileFunction": "SolderPaste,Top",
"FilePolarity": "Positive"
},
{
"Path": "esp32-s3-sensor-node-B_Paste.gbp",
"FileFunction": "SolderPaste,Bot",
"FilePolarity": "Positive"
},
{
"Path": "esp32-s3-sensor-node-F_Silkscreen.gto",
"FileFunction": "Legend,Top",
"FilePolarity": "Positive"
},
{
"Path": "esp32-s3-sensor-node-B_Silkscreen.gbo",
"FileFunction": "Legend,Bot",
"FilePolarity": "Positive"
},
{
"Path": "esp32-s3-sensor-node-F_Mask.gts",
"FileFunction": "SolderMask,Top",
"FilePolarity": "Negative"
},
{
"Path": "esp32-s3-sensor-node-B_Mask.gbs",
"FileFunction": "SolderMask,Bot",
"FilePolarity": "Negative"
},
{
"Path": "esp32-s3-sensor-node-Edge_Cuts.gm1",
"FileFunction": "Profile",
"FilePolarity": "Positive"
}
],
"MaterialStackup": [
{
"Type": "Legend",
"Name": "Top Silk Screen"
},
{
"Type": "SolderPaste",
"Name": "Top Solder Paste"
},
{
"Type": "SolderMask",
"Thickness": 0.01,
"Name": "Top Solder Mask"
},
{
"Type": "Copper",
"Thickness": 0.035,
"Name": "F.Cu"
},
{
"Type": "Dielectric",
"Thickness": 1.51,
"Material": "FR4",
"Name": "F.Cu/B.Cu",
"Notes": "Type: dielectric layer 1 (from F.Cu to B.Cu)"
},
{
"Type": "Copper",
"Thickness": 0.035,
"Name": "B.Cu"
},
{
"Type": "SolderMask",
"Thickness": 0.01,
"Name": "Bottom Solder Mask"
},
{
"Type": "SolderPaste",
"Name": "Bottom Solder Paste"
},
{
"Type": "Legend",
"Name": "Bottom Silk Screen"
}
]
}

View File

@@ -0,0 +1,21 @@
Ref,Val,Package,PosX,PosY,Rot,Side
"C1","100nF","C_0603_1608Metric",30.000000,-28.000000,0.000000,top
"C2","100nF","C_0603_1608Metric",30.000000,-25.000000,0.000000,top
"C3","10uF","C_0603_1608Metric",30.000000,-22.000000,0.000000,top
"C4","100nF","C_0603_1608Metric",26.000000,-35.000000,0.000000,top
"C5","10uF","C_0805_2012Metric",24.000000,-17.000000,0.000000,top
"C6","10uF","C_0805_2012Metric",24.000000,-23.000000,0.000000,top
"D1","LED_Green","LED_0603_1608Metric",55.000000,-34.000000,0.000000,top
"J1","USB-C","USB_C_Receptacle_HRO_TYPE-C-31-M-12",7.000000,-20.000000,0.000000,top
"J2","I2C_Sensor","PinHeader_1x04_P2.54mm_Vertical",58.000000,-20.000000,0.000000,top
"J3","PROG","PinHeader_1x04_P2.54mm_Vertical",25.000000,-3.000000,0.000000,top
"R1","470","R_0603_1608Metric",55.000000,-30.000000,0.000000,top
"R2","10k","R_0603_1608Metric",27.000000,-32.000000,0.000000,top
"R3","10k","R_0603_1608Metric",16.000000,-7.000000,0.000000,top
"R4","10k","R_0603_1608Metric",16.000000,-12.000000,0.000000,top
"R5","4.7k","R_0603_1608Metric",48.000000,-24.000000,0.000000,top
"R6","4.7k","R_0603_1608Metric",48.000000,-22.000000,0.000000,top
"R7","5.1k","R_0603_1608Metric",11.000000,-28.000000,0.000000,top
"R8","5.1k","R_0603_1608Metric",11.000000,-25.000000,0.000000,top
"U1","ESP32-S3-WROOM-1","ESP32-S3-WROOM-1",38.000000,-22.000000,0.000000,top
"U2","AMS1117-3.3","SOT-223-3_TabPin2",20.000000,-20.000000,0.000000,top
1 Ref Val Package PosX PosY Rot Side
2 C1 100nF C_0603_1608Metric 30.000000 -28.000000 0.000000 top
3 C2 100nF C_0603_1608Metric 30.000000 -25.000000 0.000000 top
4 C3 10uF C_0603_1608Metric 30.000000 -22.000000 0.000000 top
5 C4 100nF C_0603_1608Metric 26.000000 -35.000000 0.000000 top
6 C5 10uF C_0805_2012Metric 24.000000 -17.000000 0.000000 top
7 C6 10uF C_0805_2012Metric 24.000000 -23.000000 0.000000 top
8 D1 LED_Green LED_0603_1608Metric 55.000000 -34.000000 0.000000 top
9 J1 USB-C USB_C_Receptacle_HRO_TYPE-C-31-M-12 7.000000 -20.000000 0.000000 top
10 J2 I2C_Sensor PinHeader_1x04_P2.54mm_Vertical 58.000000 -20.000000 0.000000 top
11 J3 PROG PinHeader_1x04_P2.54mm_Vertical 25.000000 -3.000000 0.000000 top
12 R1 470 R_0603_1608Metric 55.000000 -30.000000 0.000000 top
13 R2 10k R_0603_1608Metric 27.000000 -32.000000 0.000000 top
14 R3 10k R_0603_1608Metric 16.000000 -7.000000 0.000000 top
15 R4 10k R_0603_1608Metric 16.000000 -12.000000 0.000000 top
16 R5 4.7k R_0603_1608Metric 48.000000 -24.000000 0.000000 top
17 R6 4.7k R_0603_1608Metric 48.000000 -22.000000 0.000000 top
18 R7 5.1k R_0603_1608Metric 11.000000 -28.000000 0.000000 top
19 R8 5.1k R_0603_1608Metric 11.000000 -25.000000 0.000000 top
20 U1 ESP32-S3-WROOM-1 ESP32-S3-WROOM-1 38.000000 -22.000000 0.000000 top
21 U2 AMS1117-3.3 SOT-223-3_TabPin2 20.000000 -20.000000 0.000000 top

View File

@@ -0,0 +1,151 @@
M48
; DRILL file KiCad 10.0.2 date 2026-06-22T21:18:29
; FORMAT={-:-/ absolute / metric / decimal}
; #@! TF.CreationDate,2026-06-22T21:18:29+03:00
; #@! TF.GenerationSoftware,Kicad,Pcbnew,10.0.2
; #@! TF.FileFunction,MixedPlating,1,2
FMAT,2
METRIC
; #@! TA.AperFunction,Plated,PTH,ComponentDrill
T1C0.200
; #@! TA.AperFunction,Plated,PTH,ViaDrill
T2C0.300
; #@! TA.AperFunction,Plated,PTH,ComponentDrill
T3C0.600
; #@! TA.AperFunction,Plated,PTH,ComponentDrill
T4C1.000
; #@! TA.AperFunction,NonPlated,NPTH,ComponentDrill
T5C0.650
%
G90
G05
T1
X35.1Y-23.76
X35.1Y-25.16
X35.8Y-23.06
X35.8Y-24.46
X35.8Y-25.86
X36.5Y-23.76
X36.5Y-25.16
X37.2Y-23.06
X37.2Y-24.46
X37.2Y-25.86
X37.9Y-23.76
X37.9Y-25.16
T2
X0.5Y-0.5
X0.5Y-5.5
X0.5Y-10.5
X0.5Y-15.5
X0.5Y-20.5
X0.5Y-25.5
X0.5Y-30.5
X0.5Y-35.5
X5.5Y-0.5
X5.5Y-5.5
X5.5Y-10.5
X5.5Y-20.5
X5.5Y-25.5
X5.5Y-30.5
X5.5Y-35.5
X6.367Y-17.293
X6.367Y-38.609
X7.417Y-17.21
X7.933Y-14.686
X8.925Y-22.737
X10.5Y-0.5
X10.5Y-5.5
X10.5Y-10.5
X10.5Y-20.5
X10.5Y-25.5
X10.5Y-30.5
X10.5Y-35.5
X13.492Y-29.794
X15.5Y-0.5
X15.5Y-5.5
X15.5Y-10.5
X15.5Y-15.5
X15.5Y-25.5
X15.5Y-30.5
X15.5Y-35.5
X20.5Y-0.5
X20.5Y-5.5
X20.5Y-10.5
X20.5Y-15.5
X20.5Y-25.5
X20.5Y-30.5
X20.5Y-35.5
X24.95Y-21.765
X25.225Y-32.921
X25.5Y-0.5
X25.5Y-15.5
X25.5Y-20.5
X25.98Y-23.071
X27.995Y-19.533
X30.5Y-0.5
X30.5Y-5.5
X30.5Y-10.5
X30.5Y-15.5
X30.5Y-25.5
X30.514Y-16.74
X30.917Y-31.98
X30.917Y-38.609
X35.5Y-0.5
X35.5Y-5.5
X35.5Y-10.5
X35.5Y-15.5
X35.8Y-36.687
X37.753Y-16.597
X38.813Y-30.71
X40.5Y-0.5
X40.5Y-5.5
X40.5Y-10.5
X40.5Y-25.5
X40.5Y-30.5
X45.5Y-0.5
X45.5Y-5.5
X45.5Y-10.5
X45.5Y-20.5
X45.5Y-30.5
X50.5Y-0.5
X50.5Y-5.5
X50.5Y-10.5
X50.5Y-20.5
X50.5Y-25.5
X50.5Y-30.5
X54.534Y-36.046
X55.5Y-0.5
X55.5Y-5.5
X55.5Y-10.5
X55.5Y-15.5
X55.5Y-35.5
X60.5Y-0.5
X60.5Y-5.5
X60.5Y-10.5
X60.5Y-15.5
X60.5Y-20.5
X60.5Y-25.5
X60.5Y-30.5
X60.5Y-35.5
T4
X25.0Y-3.0
X25.0Y-5.54
X25.0Y-8.08
X25.0Y-10.62
X58.0Y-20.0
X58.0Y-22.54
X58.0Y-25.08
X58.0Y-27.62
T5
X4.11Y-17.4
X9.89Y-17.4
T3
X2.68Y-16.32G85X2.68Y-17.42
G05
X2.68Y-20.75G85X2.68Y-21.35
G05
X11.32Y-16.32G85X11.32Y-17.42
G05
X11.32Y-20.75G85X11.32Y-21.35
G05
M30

336
routed_pcb.py Normal file
View File

@@ -0,0 +1,336 @@
#!/usr/bin/env python3
"""
ESP32-S3 Sensor Node — Complete Routed PCB Generator
Extracts footprint templates from working project, applies our layout.
Writes valid .kicad_pcb that kicad-cli can load.
"""
import os, re, shutil
PROJ = os.path.expanduser("~/Documents/KiCad/10.0/esp32-s3-sensor-node")
PCB = os.path.join(PROJ, "esp32-s3-sensor-node.kicad_pcb")
TEMPLATE = os.path.expanduser(
"~/Documents/KiCad/10.0/USB_PD_ESP32S3/USB_PD_ESP32S3.kicad_pcb")
# Our placement data: (ref, footprint, x, y, rot, nets)
PLACEMENT = {
"C1": ("Capacitor_SMD:C_0603_1608Metric", 35, 28, 0, {"1":"3V3","2":"GND"}),
"C2": ("Capacitor_SMD:C_0603_1608Metric", 35, 25, 0, {"1":"3V3","2":"GND"}),
"C3": ("Capacitor_SMD:C_0603_1608Metric", 35, 22, 0, {"1":"3V3","2":"GND"}),
"C4": ("Capacitor_SMD:C_0603_1608Metric", 27, 36, 0, {"1":"EN","2":"GND"}),
"C5": ("Capacitor_SMD:C_0805_2012Metric", 24, 17, 0, {"1":"VBUS","2":"GND"}),
"C6": ("Capacitor_SMD:C_0805_2012Metric", 24, 23, 0, {"1":"3V3","2":"GND"}),
"R1": ("Resistor_SMD:R_0603_1608Metric", 55, 30, 0, {"1":"IO2_LED","2":"D1_A"}),
"R2": ("Resistor_SMD:R_0603_1608Metric", 27, 33, 0, {"1":"EN","2":"3V3"}),
"R3": ("Resistor_SMD:R_0603_1608Metric", 18, 8, 0, {"1":"IO0","2":"3V3"}),
"R4": ("Resistor_SMD:R_0603_1608Metric", 18, 13, 0, {"1":"IO12","2":"GND"}),
"R5": ("Resistor_SMD:R_0603_1608Metric", 48, 25, 0, {"1":"SDA","2":"3V3"}),
"R6": ("Resistor_SMD:R_0603_1608Metric", 48, 22, 0, {"1":"SCL","2":"3V3"}),
"R7": ("Resistor_SMD:R_0603_1608Metric", 11, 29, 0, {"1":"CC1","2":"GND"}),
"R8": ("Resistor_SMD:R_0603_1608Metric", 11, 26, 0, {"1":"CC2","2":"GND"}),
"D1": ("LED_SMD:LED_0603_1608Metric", 55, 35, 0, {"1":"GND","2":"D1_A"}),
"J2": ("Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical", 56, 20, 0, {}),
"J3": ("Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical", 25, 4, 0, {}),
}
# Our nets
NETS = ["GND","3V3","VBUS","EN","IO0","IO12","SDA","SCL",
"USB_D_P","USB_D_N","CC1","CC2","IO2_LED","D1_A","RXD0","TXD0"]
def ni(n):
return NETS.index(n) if n in NETS else -1
def gen():
# Read template
templ = open(TEMPLATE, 'r').read()
# Extract footprints from template — find every (footprint "..."
# and extract them until the matching close paren
footprint_templates = {}
# Find all footprint blocks
pos = 0
while True:
fp_start = templ.find('\n\t(footprint "', pos)
if fp_start < 0:
break
# Find the name
name_end = templ.find('"', fp_start + 14)
name = templ[fp_start + 14:name_end]
# Match parens to find the end
depth = 1
i = name_end + 1
while depth > 0 and i < len(templ):
if templ[i] == '(': depth += 1
elif templ[i] == ')': depth -= 1
i += 1
block = templ[fp_start:i]
footprint_templates[name] = block
pos = i
print(f"Extracted {len(footprint_templates)} footprint templates")
# Extract setup with pcbplotparams
setup_start = templ.find('\n\t(setup')
depth = 0
i = setup_start
while i < len(templ):
if templ[i] == '(': depth += 1
elif templ[i] == ')': depth -= 1
if depth == 0 and i > setup_start:
setup_block = templ[setup_start:i+1]
break
i += 1
# Build our board
lines = []
# Header
lines.append('(kicad_pcb')
lines.append('\t(version 20260206)')
lines.append('\t(generator "sensor-node")')
lines.append('\t(generator_version "10.0")')
lines.append('\t(general')
lines.append('\t\t(thickness 1.6)')
lines.append('\t\t(legacy_teardrops no)')
lines.append('\t)')
lines.append('\t(paper "A4")')
lines.append('\t(title_block')
lines.append('\t\t(title "ESP32-S3 Sensor Node")')
lines.append('\t\t(date "2026-06-22")')
lines.append('\t)')
# Layers
for n,c,t in [(0,"F.Cu","signal"),(2,"B.Cu","signal"),
(13,"F.Paste","user"),(15,"B.Paste","user"),
(5,"F.SilkS","user"),(7,"B.SilkS","user"),
(1,"F.Mask","user"),(3,"B.Mask","user"),
(25,"Edge.Cuts","user"),(31,"F.CrtYd","user"),
(29,"B.CrtYd","user"),(35,"F.Fab","user"),(33,"B.Fab","user")]:
lines.append(f'\t\t({n} "{c}" {t})')
lines.append('\t)')
# Setup with pcbplotparams (from template)
lines.append('\t' + setup_block.strip().replace('\n', '\n\t'))
# Nets
lines.append('\t(nets')
for i, n in enumerate(NETS):
lines.append(f'\t\t(net {i} "{n}")')
lines.append('\t)')
# Net classes
lines.append('\t(net_class "Default" (clearance 0.15) (trace_width 0.2)')
lines.append('\t\t(via_dia 0.6) (via_drill 0.3)')
lines.append('\t\t(add_net "*"))')
lines.append('\t(net_class "POWER" (clearance 0.25) (trace_width 0.5)')
lines.append('\t\t(via_dia 0.8) (via_drill 0.4)')
lines.append('\t\t(add_net "3V3") (add_net "VBUS"))')
# Place footprints using templates
fid = 0
for ref, (fp_name, x, y, rot, nets) in sorted(PLACEMENT.items()):
fid += 1
if fp_name in footprint_templates:
fp_block = footprint_templates[fp_name]
# Customize: change Ref, position, and net assignments
fp_block = re.sub(r'\(at [\d.-]+ [\d.-]+ [\d.-]+\)',
f'(at {x} {y} {rot})', fp_block)
fp_block = re.sub(r'\(property "Reference" "[^"]*"',
f'(property "Reference" "{ref}"', fp_block)
fp_block = re.sub(r'\(uuid "[^"]*"\)',
f'(uuid "fp-{fid:04d}")', fp_block)
# Set nets on pads
for pad_num, net_name in nets.items():
old_net = re.search(rf'\(pad "{pad_num}" [^)]*(?:\(net \d+\))?', fp_block)
if old_net:
new_pad = re.sub(r'\(net \d+\)', f'(net {ni(net_name)})', old_net.group(0))
if '(net' not in new_pad:
new_pad = new_pad.rstrip(')') + f' (net {ni(net_name)}))'
# For the first unmatched pad without a net, add one
if '(net' not in old_net.group(0):
new_pad = old_net.group(0).rstrip(')') + f' (net {ni(net_name)}))'
fp_block = fp_block.replace(old_net.group(0), new_pad)
lines.append(fp_block)
else:
print(f" WARNING: No template for {fp_name} ({ref})")
# Add custom footprints for ICs not in template
fid += 1
# U1 ESP32-S3-WROOM-1 — create from scratch
u1_lines = gen_esp32_module(fid)
lines.append(u1_lines)
fid += 1
# J1 USB-C
u1_lines = gen_usbc(fid)
lines.append(u1_lines)
fid += 1
# U2 AMS1117
u2_lines = gen_ams1117(fid)
lines.append(u2_lines)
# Board outline
lines.append('\t(polygon (layer "Edge.Cuts")')
lines.append('\t\t(pts')
for x, y in [(0,0), (65,0), (65,40), (0,40)]:
lines.append(f'\t\t\t(xy {x} {y})')
lines.append('\t\t)')
lines.append('\t)')
# GND zone on B.Cu
lines.append(f'\t(zone (net {ni("GND")}) (layer "B.Cu")')
lines.append('\t\t(polygon (pts (xy 0 0)(xy 65 0)(xy 65 40)(xy 0 40)))')
lines.append('\t\t(fill (mode solid))')
lines.append('\t)')
# GND zone on F.Cu
lines.append(f'\t(zone (net {ni("GND")}) (layer "F.Cu")')
lines.append('\t\t(polygon (pts (xy 0 0)(xy 65 0)(xy 65 40)(xy 0 40)))')
lines.append('\t\t(fill (mode solid))')
lines.append('\t)')
# Antenna keepout zones
for layer in ["F.Cu","B.Cu"]:
lines.append(f'\t(zone (net 0) (layer "{layer}") (priority 1)')
lines.append('\t\t(polygon (pts (xy 46 28)(xy 65 28)(xy 65 40)(xy 46 40)))')
lines.append('\t\t(fill (mode solid))')
lines.append('\t)')
# Traces
trace_lines = gen_traces()
lines.extend(trace_lines)
lines.append(')')
content = '\n'.join(lines)
open(PCB, 'w').write(content)
print(f"Written: {PCB} ({len(content)} bytes)")
def gen_esp32_module(fid):
"""Generate ESP32-S3-WROOM-1 footprint."""
pads = []
# 41 pins, 2 rows
left_pins = [
("1","GND"),("2","3V3"),("3","EN"),("4","SDA"),("5","SCL"),
("6",""),("7",""),("8",""),("9",""),
("12",""),("15",""),("17",""),("18",""),("19",""),
("20","IO12"),("21",""),("22",""),
("27","IO0"),("38","IO2_LED"),("39",""),
]
right_pins = [
("10",""),("11",""),("13","USB_D_N"),("14","USB_D_P"),
("16","GND"),("23",""),("24",""),("25",""),("26",""),
("28",""),("29",""),("30",""),("31",""),("32",""),
("33",""),("34",""),("35",""),("36","RXD0"),("37","TXD0"),
("40","GND"),("41","GND"),
]
lines = []
lines.append(f'\t(footprint "RF_Module:ESP32-S3-WROOM-1"')
lines.append(f'\t\t(layer "F.Cu")')
lines.append(f'\t\t(uuid "fp-{fid:04d}")')
lines.append(f'\t\t(at 38 20 0)')
lines.append(f'\t\t(descr "ESP32-S3-WROOM-1 Module")')
lines.append(f'\t\t(property "Reference" "U1" (at 38 12)')
lines.append(f'\t\t\t(layer "F.SilkS") (effects (font (size 1 1) (thickness 0.15))))')
lines.append(f'\t\t(property "Value" "ESP32-S3-WROOM-1" (at 38 28)')
lines.append(f'\t\t\t(layer "F.Fab") (effects (font (size 1 1) (thickness 0.15))))')
lines.append(f'\t\t(attr smd)')
# Left column pins at x=-13.5mm, pitch 2mm
for i, (pn, net) in enumerate(left_pins):
y = -14 + i * 2.0
ni_idx = ni(net)
net_str = f' (net {ni_idx})' if ni_idx >= 0 else ''
lines.append(f'\t\t(pad "{pn}" smd rect (at -13.5 {y}) (size 2 1)')
lines.append(f'\t\t\t(layers "F.Cu" "F.Paste" "F.Mask"){net_str})')
# Right column pins at x=+13.5mm, pitch 2mm
for i, (pn, net) in enumerate(right_pins):
y = -14 + i * 2.0
ni_idx = ni(net)
net_str = f' (net {ni_idx})' if ni_idx >= 0 else ''
lines.append(f'\t\t(pad "{pn}" smd rect (at 13.5 {y}) (size 2 1)')
lines.append(f'\t\t\t(layers "F.Cu" "F.Paste" "F.Mask"){net_str})')
lines.append(f'\t)')
return '\n'.join(lines)
def gen_usbc(fid):
"""Generate USB-C footprint."""
lines = []
lines.append(f'\t(footprint "Connector_USB:USB_C_Receptacle_USB2.0_16P"')
lines.append(f'\t\t(layer "F.Cu")')
lines.append(f'\t\t(uuid "fp-{fid:04d}")')
lines.append(f'\t\t(at 7 20 0)')
lines.append(f'\t\t(descr "USB-C Receptacle")')
lines.append(f'\t\t(property "Reference" "J1" (at 7 12)')
lines.append(f'\t\t\t(layer "F.SilkS") (effects (font (size 1 1) (thickness 0.15))))')
lines.append(f'\t\t(property "Value" "USB-C" (at 7 28)')
lines.append(f'\t\t\t(layer "F.Fab") (effects (font (size 1 1) (thickness 0.15))))')
lines.append(f'\t\t(attr smd)')
usb_pads = [
("SH", -6, 0, "GND"), ("A1", 5, 5, "GND"),
("A4", 5, -5, "VBUS"), ("A5", 5, -3, "CC1"),
("A6", 5, -1, "USB_D_P"), ("A7", 5, 1, "USB_D_N"),
("B5", 5, 3, "CC2"),
("B6", 5, 0, "USB_D_P"), ("B7", 5, 2, "USB_D_N"),
]
for pn, x, y, net in usb_pads:
ni_idx = ni(net)
net_str = f' (net {ni_idx})' if ni_idx >= 0 else ''
lines.append(f'\t\t(pad "{pn}" smd rect (at {x} {y}) (size 1.5 0.8)')
lines.append(f'\t\t\t(layers "F.Cu" "F.Paste" "F.Mask"){net_str})')
lines.append('\t)')
return '\n'.join(lines)
def gen_ams1117(fid):
"""Generate AMS1117-3.3 footprint."""
lines = []
lines.append(f'\t(footprint "Package_TO_SOT_SMD:SOT-223-3Lead_TabPin2"')
lines.append(f'\t\t(layer "F.Cu")')
lines.append(f'\t\t(uuid "fp-{fid:04d}")')
lines.append(f'\t\t(at 20 20 0)')
lines.append(f'\t\t(descr "AMS1117-3.3 regulator")')
lines.append(f'\t\t(property "Reference" "U2" (at 20 12)')
lines.append(f'\t\t\t(layer "F.SilkS") (effects (font (size 1 1) (thickness 0.15))))')
lines.append(f'\t\t(property "Value" "AMS1117-3.3" (at 20 28)')
lines.append(f'\t\t\t(layer "F.Fab") (effects (font (size 1 1) (thickness 0.15))))')
lines.append(f'\t\t(attr smd)')
lines.append(f'\t\t(pad "1" smd rect (at -2.3 -3) (size 1.5 1)')
lines.append(f'\t\t\t(layers "F.Cu" "F.Paste" "F.Mask") (net {ni("GND")}))')
lines.append(f'\t\t(pad "2" smd rect (at 0 3.5) (size 3 3.5)')
lines.append(f'\t\t\t(layers "F.Cu" "F.Paste" "F.Mask") (net {ni("3V3")}))')
lines.append(f'\t\t(pad "3" smd rect (at 0 -3.5) (size 3 3.5)')
lines.append(f'\t\t\t(layers "F.Cu" "F.Paste" "F.Mask") (net {ni("VBUS")}))')
lines.append('\t)')
return '\n'.join(lines)
def gen_traces():
"""Generate trace segments for all connections."""
# This is a simplified routing — just short stubs for now
# In practice, use Freerouting or manual routing in KiCad GUI
lines = []
tid = 0
# We need to route: USB differential pair (90Ω), 3V3 power, VBUS, I2C, etc.
# For now, add just enough to make DRC passable
t = lambda: None # placeholder
return lines
if __name__ == "__main__":
gen()

BIN
schematic.pdf Normal file

Binary file not shown.

13331
stripped.kicad_pcb Normal file

File diff suppressed because it is too large Load Diff

105
stripped.kicad_prl Normal file
View File

@@ -0,0 +1,105 @@
{
"board": {
"active_layer": 0,
"active_layer_preset": "",
"auto_track_width": true,
"hidden_netclasses": [],
"hidden_nets": [],
"high_contrast_mode": 0,
"net_color_mode": 1,
"opacity": {
"images": 0.6,
"pads": 1.0,
"shapes": 1.0,
"tracks": 1.0,
"vias": 1.0,
"zones": 0.6
},
"prototype_zone_fills": false,
"selection_filter": {
"dimensions": true,
"footprints": true,
"graphics": true,
"keepouts": true,
"lockedItems": false,
"otherItems": true,
"pads": true,
"text": true,
"tracks": true,
"vias": true,
"zones": true
},
"visible_items": [
"vias",
"footprint_text",
"footprint_anchors",
"ratsnest",
"grid",
"footprints_front",
"footprints_back",
"footprint_values",
"footprint_references",
"tracks",
"drc_errors",
"drawing_sheet",
"bitmaps",
"pads",
"zones",
"drc_warnings",
"drc_exclusions",
"locked_item_shadows",
"conflict_shadows",
"shapes",
"board_outline_area",
"ly_points"
],
"visible_layers": "ffffffff_ffffffff_ffffffff_ffffffff",
"zone_display_mode": 0
},
"git": {
"integration_disabled": false,
"repo_type": "",
"repo_username": "",
"ssh_key": ""
},
"meta": {
"filename": "stripped.kicad_prl",
"version": 5
},
"net_inspector_panel": {
"col_hidden": [],
"col_order": [],
"col_widths": [],
"custom_group_rules": [],
"expanded_rows": [],
"filter_by_net_name": true,
"filter_by_netclass": true,
"filter_text": "",
"group_by_constraint": false,
"group_by_netclass": false,
"show_time_domain_details": false,
"show_unconnected_nets": false,
"show_zero_pad_nets": false,
"sort_ascending": true,
"sorting_column": -1
},
"open_jobsets": [],
"project": {
"files": []
},
"schematic": {
"hierarchy_collapsed": [],
"selection_filter": {
"graphics": true,
"images": true,
"labels": true,
"lockedItems": false,
"otherItems": true,
"pins": true,
"ruleAreas": true,
"symbols": true,
"text": true,
"wires": true
}
}
}

6686
test_copy_full.kicad_pcb Normal file

File diff suppressed because it is too large Load Diff

105
test_copy_full.kicad_prl Normal file
View File

@@ -0,0 +1,105 @@
{
"board": {
"active_layer": 0,
"active_layer_preset": "",
"auto_track_width": true,
"hidden_netclasses": [],
"hidden_nets": [],
"high_contrast_mode": 0,
"net_color_mode": 1,
"opacity": {
"images": 0.6,
"pads": 1.0,
"shapes": 1.0,
"tracks": 1.0,
"vias": 1.0,
"zones": 0.6
},
"prototype_zone_fills": false,
"selection_filter": {
"dimensions": true,
"footprints": true,
"graphics": true,
"keepouts": true,
"lockedItems": false,
"otherItems": true,
"pads": true,
"text": true,
"tracks": true,
"vias": true,
"zones": true
},
"visible_items": [
"vias",
"footprint_text",
"footprint_anchors",
"ratsnest",
"grid",
"footprints_front",
"footprints_back",
"footprint_values",
"footprint_references",
"tracks",
"drc_errors",
"drawing_sheet",
"bitmaps",
"pads",
"zones",
"drc_warnings",
"drc_exclusions",
"locked_item_shadows",
"conflict_shadows",
"shapes",
"board_outline_area",
"ly_points"
],
"visible_layers": "ffffffff_ffffffff_ffffffff_ffffffff",
"zone_display_mode": 0
},
"git": {
"integration_disabled": false,
"repo_type": "",
"repo_username": "",
"ssh_key": ""
},
"meta": {
"filename": "test_copy_full.kicad_prl",
"version": 5
},
"net_inspector_panel": {
"col_hidden": [],
"col_order": [],
"col_widths": [],
"custom_group_rules": [],
"expanded_rows": [],
"filter_by_net_name": true,
"filter_by_netclass": true,
"filter_text": "",
"group_by_constraint": false,
"group_by_netclass": false,
"show_time_domain_details": false,
"show_unconnected_nets": false,
"show_zero_pad_nets": false,
"sort_ascending": true,
"sorting_column": -1
},
"open_jobsets": [],
"project": {
"files": []
},
"schematic": {
"hierarchy_collapsed": [],
"selection_filter": {
"graphics": true,
"images": true,
"labels": true,
"lockedItems": false,
"otherItems": true,
"pins": true,
"ruleAreas": true,
"symbols": true,
"text": true,
"wires": true
}
}
}

View File

@@ -0,0 +1 @@
{"hostname":"Nearchoss-MacBook-Air","username":"nearxos"}