hrithik18k/metal-touch-panel

A PCB autorouting wrapper that corrects footprint-trace obstacle dimensions, solves routes with a preloaded trace-graph solver, and reports completed traces or routing errors.

Version
1.0.0
License
unset
Stars
0

README.md

# Metal Touch Panel — Rev A prototype

Project location: E:\project\tscircuit\metal-touch-panel

A new tscircuit implementation of the previously discussed metal-touch concept, not a copy of a supplied production board. Four printed inductors sense the small deflection of a metal faceplate. No mechanical switch is fitted. The panel still moves microscopically when pressed.

## Design

- 72 x 64 mm, two copper layers; proposed 1.6 mm FR-4, 1 oz copper.
- Four 18 mm square, 12-turn top-copper coils; 0.20 mm tracks and approximately 0.20 mm spacing.
- Coil centers in top-view PCB coordinates: key 1 (+18,-15), key 2 (+18,+15), key 3 (-18,+15), key 4 (-18,-15), in mm.
- TI LDC1614RGHR, 4 x 4 mm WQFN-16 with grounded exposed pad; exact imported footprint, pinout cross-checked against TI.
- Bottom-side IC, capacitors, pullups and host connector leave the sensing face free of component bodies.
- Four 1 nF C0G/NP0 resonant capacitors. Approximately 3 uH per coil is an analytical estimate, not a measurement. Nominal resonance would be around 2.9 MHz; the metal target changes it.
- Regulated 3.3 V supply and external 3.3 V I2C controller required. No regulator, MCU, USB interface or haptic motor driver is included.
- Address 0x2A (ADDR low), SD low, internal reference clock (CLKIN grounded). INTB is push-pull and is exposed to the host.
- Four 3.2 mm mounting holes centered at (+/-32,+/-28) mm. Use nonmetallic mounting hardware near sensors.
- No copper planes beneath the coils. Narrow return/sensor routes exist on the opposite layer; quantify their effect during calibration.

## Host connector J1

| Pin | Signal | Top-view X at Y=-28 mm |
| --- | --- | --- |
| 1 | 3.3 V | +5.08 |
| 2 | GND | +2.54 |
| 3 | SDA | 0 |
| 4 | SCL | -2.54 |
| 5 | INTB | -5.08 |

J1 is installed on the bottom. Do not infer its pin order from a mirrored bottom-view picture. Use the pin numbers and top-view coordinate table. Pullups are 4.7 kohm to 3.3 V. Do not attach 5 V logic.

## Files

- `index.circuit.tsx`: editable electrical design and printed coil geometry.
- `imports/LDC1614RGHR.tsx`: imported component and footprint.
- `coil-aware-router.ts`: narrow workaround for incorrect winding obstacle widths in core.
- `scripts/audit-coil-clearance.mjs`: checks winding count, top interconnect-to-coil geometry and recorded circuit errors.
- `scripts/associate-coil-copper.mjs`: applies source-net ownership after routing without changing copper geometry.
- `dist/index/circuit.json`: original routed output.
- `dist/metal-touch-panel.circuit.json`: normalized output for checking/export. Never autoroute this file again.
- `dist/index/pcb.png`, `dist/index/schematic.png`: rendered previews.
- `dist/metal-touch-panel-gerbers.zip`: prototype fabrication data once exported.
- `BOM.csv`: assembly specifications; coils are printed copper, not purchased inductors.
- `HIGH_PRIORITY_ISSUES.md` and `evidence/`: findings, failure inputs and validation logs.

## Rebuild

Install Bun, then run `bun install --frozen-lockfile` in this directory. If the lockfile requests a manifest refresh after version pinning, run `bun install` once and retain the resulting lockfile.

```powershell
bun node_modules/tscircuit/cli.mjs check netlist index.circuit.tsx
bun node_modules/tscircuit/cli.mjs check schematic-placement index.circuit.tsx
bun node_modules/tscircuit/cli.mjs check placement index.circuit.tsx
bun node_modules/tscircuit/cli.mjs build index.circuit.tsx --pcb-png --schematic-png
node scripts/audit-coil-clearance.mjs
node scripts/associate-coil-copper.mjs
bun node_modules/tscircuit/cli.mjs check shorts dist/metal-touch-panel.circuit.json
bun node_modules/tscircuit/cli.mjs export dist/metal-touch-panel.circuit.json -f gerbers -o metal-touch-panel-gerbers.zip
```

The CLI resolves a relative export filename beneath `dist`; do not use `-o dist/...` or it becomes dist/dist. Always specify the entrypoint when building: evidence files intentionally include old reproduction circuits.

## Mechanical prototype and calibration

1. Build an insulating spacer/frame with four independently supported button regions aligned to the coils. Start experiments with roughly 0.2–0.5 mm aluminium sheet and a 0.3–0.8 mm air gap. These are experiment ranges, not validated mechanical dimensions. Panel stiffness depends strongly on material, thickness and unsupported span.
2. Fit a dielectric barrier and mechanical stops so pressing cannot bring the metal into contact with traces, vias or connector solder joints. A single unsupported plate can couple all four buttons mechanically.
3. Assemble the bottom-side QFN with the appropriate stencil/reflow process. Inspect the exposed pad and pins under magnification. The imported pad is a single 2.6 mm square; review stencil paste windowing with the assembler.
4. Check supply-to-ground resistance before applying power. Connect a current-limited 3.3 V bench supply and verify the LDC identity over I2C.
5. Configure the LDC reference/dividers, sensor drive, settling time, deglitch filter and channel scan settings from the actual measured resonance. Observe the tank with a low-capacitance probe and tune drive current; fixed production register values are deliberately not supplied for unmeasured coils.
6. Record each channel untouched, pressed and with neighboring buttons pressed. Choose a threshold above measured drift/noise and add release hysteresis and debounce in the host firmware. Use slow baseline tracking only while released.
7. Verify over panel temperature, different press positions, mounting torque and target gaps. Avoid assuming frequency delta directly equals calibrated force.

## Validation and remaining work

Final automated results are recorded in `evidence/final-*`: netlist, schematic placement, PCB placement, routed build, TypeScript, preserved-coil geometry and Gerber-derived shorts. The custom geometry audit is focused on coils and is not a complete independent manufacturing DRC.

This board is an unbuilt prototype. Automated checks do not establish inductance, Q, touch sensitivity, EMC, ESD robustness or mechanical reliability. Coil impedance/resonance and faceplate behavior must be measured. The assembly BOM leaves generic passive vendor selection to the builder; generated pick-and-place rotations require assembler review. No firmware has been flashed or hardware tested.

Reference: https://www.ti.com/lit/ds/symlink/ldc1614.pdf and https://www.ti.com/product/LDC1614 .

### Browser router bundle
The circuit imports coil-aware-router.browser.js because the browser evaluator cannot resolve the router package's nested object-hash dependency. After editing coil-aware-router.ts, run bun run build:router to regenerate the local browser bundle.