hrithik18k/smart-switch-pcb

The AO3400A component models a SOT-23 N-channel MOSFET with labeled pins for Gate, Source, and Drain, including 3D CAD models and schematic symbols for electronic circuit design.

Version
1.0.1
License
unset
Stars
0

Files

README.md

# Two-board smart-switch prototype

This tscircuit project splits the smart switch into two 17.5 × 40 × 1.6 mm boards matching the mechanical envelope from [`mohan-bee/smart-switch-cad`](https://github.com/mohan-bee/smart-switch-cad). The controller carries the CAD mounting-hole pattern; the screw terminals occupy those corner regions on the power board, so its final retention method must be resolved in the enclosure design.

## Controller and touch board (`index.circuit.tsx`)

- ESP32-C3 Wi-Fi/BLE controller
- TTP223 touch controller
- 9 × 11 mm solder-mask-covered touch electrode, exactly at board coordinate (0, 0) on the bottom layer
- AP2112 3.3 V regulator
- AO3400A relay-coil driver and flyback diode
- three-hole 2.54 mm inter-board header: 5V, GND, RELAY_LOW

![Controller PCB](docs/controller-pcb.png)

![Controller 3D](docs/controller-3d.png)

## Relay and mains board (`power.circuit.tsx`)

- Omron G5Q-1A4-EL3-HA DC5 relay
- 1 A / 250 V board fuse
- 275 V MOV surge suppressor
- separate screw terminals for supply and switched load
- matching 5V, GND, RELAY_LOW inter-board header

![Power PCB](docs/power-pcb.png)

![Power 3D](docs/power-3d.png)

## Inter-board connector

| Pin | Signal    | Purpose                                                                         |
| --- | --------- | ------------------------------------------------------------------------------- |
| 1   | 5V        | Relay coil and controller supply from an external certified isolated 5 V supply |
| 2   | GND       | SELV return/reference                                                           |
| 3   | RELAY_LOW | MOSFET-switched low side of the relay coil                                      |

## Safety boundary

This is a compact engineering prototype, **not a certified or installation-ready 240 V product**. The present design is deliberately limited to a 1 A fuse. The relay component rating alone does not establish product safety or load compatibility. Before mains use, a qualified engineer must verify the exact load type and inrush, creepage and clearance, trace width and temperature rise, fuse breaking capacity, surge/overvoltage category, flame-rated enclosure and PCB material, earthing, touch protection, terminal ratings, and applicable IEC/UL/IS compliance. Use only an external certified isolated 5 V SELV supply; never power the low-voltage board with a non-isolated dropper.

## Verification

Run the checks for both entry points:

```sh
bun install --frozen-lockfile
bun run typecheck
bunx tsci check netlist index.circuit.tsx
bunx tsci check schematic-placement index.circuit.tsx
bunx tsci check placement index.circuit.tsx
bunx tsci build index.circuit.tsx --pcb-png --schematic-png --svgs --3d-png
bunx tsci check shorts index.circuit.tsx
bunx tsci check netlist power.circuit.tsx
bunx tsci check schematic-placement power.circuit.tsx
bunx tsci check placement power.circuit.tsx
bunx tsci build power.circuit.tsx --pcb-png --schematic-png --svgs --3d-png
bunx tsci check shorts power.circuit.tsx
```

Prototype touch sensitivity through the final plastic cover. Mechanically verify both populated boards, connector/cable clearance, antenna keep-out, and high-voltage insulation against a printed enclosure before fabrication.