hrithik18k/quad-sensor-conditioner
A 4-channel analog sensor-conditioning PCB using an MCP6004 quad unity-gain buffer, per-channel RC filtering and selectable slow outputs, 5 V decoupling, and power indication.
- Version
- 1.0.1
- License
- unset
- Stars
- 0
scripts/prepare-fabrication.py
import csv, json
from pathlib import Path
root=Path(__file__).resolve().parents[1]
source=json.loads((root/'dist/index/circuit.json').read_text())
# This design uses conventional through-hole assembly, not pin-in-paste.
removed=[e for e in source if e['type']=='pcb_solder_paste' and not e.get('pcb_smtpad_id')]
clean=[e for e in source if e not in removed]
(root/'dist/fabrication.circuit.json').write_text(json.dumps(clean,indent=2))
with (root/'dist/assembly-bom.csv').open('w',newline='') as f:
writer=csv.writer(f);writer.writerow(['Designator','ManufacturerPartNumber','Value','Footprint'])
for e in source:
if e['type']!='source_component':continue
pcb=next((p for p in source if p['type']=='pcb_component' and p.get('source_component_id')==e['source_component_id']),{})
cad=next((p for p in source if p['type']=='cad_component' and p.get('pcb_component_id')==pcb.get('pcb_component_id')),{})
writer.writerow([e['name'],e.get('manufacturer_part_number',''),e.get('resistance',e.get('capacitance','')),cad.get('footprinter_string','')])
print(f'Removed {len(removed)} unintended through-hole paste apertures; retained {sum(e["type"]=="pcb_solder_paste" for e in clean)} SMT apertures.')