MustafaMulla29/usb-pd-motherboard
4-layer USB-C PD hub motherboard with 20 V USB-C input, Linux T113-S3 computer, CH338F USB hub, four individually controlled 5–20 V PD outputs, USB data/camera ports, regulated rails, and hardware watchdog/E-stop safety interlock.
- Version
- 1.0.24
- License
- unset
- Stars
- 0
Use with the tscircuit CLI
tsci is the tscircuit CLI. Install it with npm install -g tscircuit.
tsci clone MustafaMulla29/usb-pd-motherboard # download the package files into ./usb-pd-motherboard
tsci add MustafaMulla29/usb-pd-motherboard # add it to your project as @tsci/MustafaMulla29.usb-pd-motherboardIn a cloned or new (tsci init) project: tsci dev starts a local preview, tsci build outputs Circuit JSON, and tsci push publishes to tscircuit.com.
circuit/power-input.tsx
import { schematicPlacement } from "../lib/schematic-placement"
import { CH224Q } from "../imports/CH224Q"
import { TPS16630PWPR } from "../imports/TPS16630PWPR"
import { SMBJ30A } from "../imports/SMBJ30A"
import { TPS54560BDDAR } from "../imports/TPS54560BDDAR"
import { B560C_13_F } from "../imports/B560C_13_F"
import { FXL0630_4R7_M } from "../imports/FXL0630_4R7_M"
import { AP2112K_3_3TRG1 } from "../imports/AP2112K_3_3TRG1"
import { T2N7002AK_ES } from "../imports/T2N7002AK_ES"
import { UsbC5A } from "../lib/usbc-5a"
import { SCH_PINS } from "../lib/sch-pins"
import { C, R, n } from "../lib/common"
/**
* PD_INPUT: USB-C sink.
* CH224Q requests 20 V (RPDCFG1 = 120k, WCH Table 5-1): a normal USB-C charger and cable give 20 V x 3 A = 60 W,
* enough for 4 NEMA 8 / NEMA 17 class motors (2026-11-27: EPR / 28 V dropped, not needed). The supervisors read the
* negotiated voltage on VIN_SNS and keep the motor ports within what the source granted.
* TPS16630 eFuse: 60 V rated, UVLO 7.9 V, OVP 31.1 V, 5.45 A current limit, IMON 0.5 V/A.
* TPS54560B: VIN_SYS -> 5V0 (5 A) for PMIC, USB host VBUS switches and the AON LDO.
*/
export const PowerInput = () => (
<group schLayout={{ layoutMode: "relative" }} name="POWER_INPUT" schSheetName="power_input" pcbX={7} pcbY={1.0}>
<UsbC5A {...schematicPlacement("JPD")} name="JPD" {...(SCH_PINS.USBC_IN as any)} pcbX={-46.4} pcbY={38} pcbRotation={-90}
noConnect={["SBU1", "SBU2", "DP1", "DP2", "DN1", "DN2"]}
connections={{
VBUS1: n("VBUS_IN"), VBUS2: n("VBUS_IN"), GND1: n("GND"), GND2: n("GND"), SHELL: n("GND"),
CC1: n("PDIN_CC1"), CC2: n("PDIN_CC2"),
}} />
<SMBJ30A {...schematicPlacement("DIN_TVS")} name="DIN_TVS" pcbX={-40.4} pcbY={45.6} connections={{ K: n("VBUS_IN"), A: n("GND") }} />
{/* CH224Q, wired as WCH CH224 datasheet V2.0 sec. 6.1.1 (single-resistor config):
VBUS pin 8 must be shorted to VHV ("需要短接至VHV"); connector VBUS goes straight to VHV/VBUS, 1 uF to GND
(RPDVHV is a 0 ohm link). CFG1 Rset to GND per Table 5-1: 120k = 20 V (56k = 15 V, 24k = 12 V, 210k = 28 V).
CFG2/CFG3 float (internal pull-ups); the unfitted RPDCFG2/3 footprints were removed (2026-11-28) to free routing room. The old 0 ohm on CFG1 with
CFG2/CFG3 pulled low selected I/O-level mode 0/0/0 = 9 V (Table 5-2). */}
<CH224Q {...schematicPlacement("UPDIN")} name="UPDIN" pcbX={-40.6} pcbY={36.4}
noConnect={["CFG2", "CFG3", "DP", "DM"]}
connections={{
VBUS: n("VBUS_IN"), VHV: n("PDIN_VHV"), CC1: n("PDIN_CC1"), CC2: n("PDIN_CC2"),
CFG1: n("PDIN_CFG1"), PG: n("PD_IN_PG"), EP: n("GND"), // CFG2/CFG3 float (noConnect)
}} />
<R name="RPDVHV" v="0" a={n("VBUS_IN")} b={n("PDIN_VHV")} at={{ x: -39.0, y: 39.2, r: 90 }} />
<C name="CPDVHV" v="1uF" rating="50V" fp="0603" a={n("PDIN_VHV")} at={{ x: -37.6, y: 39.2, r: 90 }} />
<R name="RPDCFG1" v="120k" a={n("PDIN_CFG1")} b={n("GND")} at={{ x: -42.5, y: 33.6, r: 90 }} />
<R name="RPDPG" v="10k" a={n("PD_IN_PG")} b={n("V3V3_AON")} at={{ x: -37.1, y: 33.6, r: 90 }} />
<C name="CVBIN" v="1uF" rating="50V" fp="0603" a={n("VBUS_IN")} at={{ x: -34.6, y: 33.2, r: 90 }} />
<R name="RVINS1" v="100k" a={n("VIN_SYS")} b={n("VIN_SNS")} at={{ x: -20.4, y: 36.8 }} />
<R name="RVINS2" v="10k" a={n("VIN_SNS")} b={n("GND")} at={{ x: -20.4, y: 35.6 }} />
{/* --- input eFuse --- */}
<TPS16630PWPR {...schematicPlacement("UIN")} name="UIN" pcbX={-32.6} pcbY={40.4}
footprint="dfn20_thermalpad2.59mmx2.59mm_pillpads_p0.65mm_w7.5mm_pw0.34mm_pl1.75mm"
connections={{
IN1: n("VBUS_IN"), IN2: n("VBUS_IN"), IN3: n("VBUS_IN"), P_IN: n("VBUS_IN"),
OUT1: n("VIN_SYS"), OUT2: n("VIN_SYS"), OUT3: n("VIN_SYS"),
GND: n("GND"), EP: n("GND"), N_C1: n("GND"), N_C2: n("GND"), N_C3: n("GND"),
UVLO: n("IN_UVLO"), OVP: n("IN_OVP"), dVdT: n("IN_DVDT"), ILIM: n("IN_ILIM"),
IMON: n("IIN_MON"), N_SHDN: n("IN_SHDN_N"), N_FLT: n("IN_FLT_N"), PGOOD: n("IN_PG"), MODE: n("IN_MODE"),
}} />
{/* UVLO: 1.2 V x (56k+10k)/10k = 7.9 V; OVP: 1.2 V x (249k+10k)/10k = 31.1 V */}
<R name="RINUV1" v="56k" a={n("VBUS_IN")} b={n("IN_UVLO")} at={{ x: -35.9, y: 45.0, r: 90 }} />
<R name="RINUV2" v="10k" a={n("IN_UVLO")} b={n("GND")} at={{ x: -34.6, y: 45.0, r: 90 }} />
<R name="RINOV1" v="249k" a={n("VBUS_IN")} b={n("IN_OVP")} at={{ x: -33.3, y: 45.0, r: 90 }} />
<R name="RINOV2" v="10k" a={n("IN_OVP")} b={n("GND")} at={{ x: -32.0, y: 45.0, r: 90 }} />
{/* I(OL) = 18 / R(ILIM in kOhm): 3.3k -> 5.45 A. IMON gain 27.9 uA/A x 18k = 0.50 V/A */}
<R name="RINILIM" v="3.3k" a={n("IN_ILIM")} b={n("GND")} at={{ x: -30.7, y: 45.0, r: 90 }} />
<R name="RINIMON" v="18k" a={n("IIN_MON")} b={n("GND")} at={{ x: -29.4, y: 45.0, r: 90 }} />
<C name="CINIMON" v="10nF" a={n("IIN_MON")} at={{ x: -28.4, y: 46.7, r: 0 }} />
<C name="CINDVDT" v="22nF" a={n("IN_DVDT")} at={{ x: -36.2, y: 35.9, r: 90 }} />
<R name="RINFLT" v="10k" a={n("IN_FLT_N")} b={n("V3V3_AON")} at={{ x: -34.9, y: 35.9, r: 90 }} />
<R name="RINPG" v="10k" a={n("IN_PG")} b={n("V3V3_AON")} at={{ x: -33.6, y: 35.9, r: 90 }} />
{/* MODE open = latch-off after a fault (datasheet MODE_SEL); test pad allows auto-retry strap */}
<testpoint {...schematicPlacement("TPINMODE")} name="TPINMODE" footprintVariant="pad" padDiameter={0.8} doNotPlace pcbX={-32.3} pcbY={35.9}
connections={{ pin1: n("IN_MODE") }} />
{/* supervisor A can force the input eFuse off */}
<T2N7002AK_ES {...schematicPlacement("QINKILL")} name="QINKILL" pcbX={-26.6} pcbY={36.4}
connections={{ G: n("IN_KILL"), S: n("GND"), D: n("IN_SHDN_N") }} />
<R name="RINKILL" v="100k" a={n("IN_KILL")} b={n("GND")} at={{ x: -24.0, y: 35.4, r: 90 }} />
{/* SHDN has an internal pull-up (2.7 V open-circuit, datasheet I(SHDN)); no external resistor. */}
{/* VIN_SYS bulk at the eFuse output. Row moved 1.2 mm left (2026-11-30) so it clears the camera port on the top edge; CINIMON moved out of its way. */}
{[0, 1, 2, 3].map((k) => (
<C key={k} name={`CVSYS${k + 1}`} v="10uF" rating="50V" fp="1206" a={n("VIN_SYS")}
at={{ x: -26.2 + 2.3 * k, y: 44.6, r: 90 }} />
))}
{/* --- 5V0 system buck (re-placed 2026-11-26 for a tight power loop) ---
U5V turned 270: VIN/BOOT on top, SW/GND on the bottom edge. Input caps sit right above VIN,
boot cap beside the chip, inductor L5V and catch diode D5V share one SW copper area on the
bottom right, output caps next to L5V's output pin. FB/COMP parts bottom-left, RT/EN top-left. */}
{/* rect-pad SOIC-8 PowerPAD rotated 90 deg = same land pattern as the JLC import's "pillpads" variant,
whose rotated pills tscircuit's routing input reads with swapped length/width */}
<TPS54560BDDAR {...schematicPlacement("U5V")} name="U5V" pcbX={-31.0} pcbY={24.5} pcbRotation={270}
footprint="soic8_thermalpad2.5mmx3.2mm_w7.6mm_pl1.6mm_pw0.6mm"
cadModel={{
objUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C1850354.obj?uuid=8a93c3c8e269400f8c283f37d8055e89",
stepUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C1850354.step?uuid=8a93c3c8e269400f8c283f37d8055e89",
pcbRotationOffset: -90, modelOriginPosition: { x: 0, y: 0, z: -0.91 },
} as any}
connections={{
VIN: n("VIN_SYS"), EN: n("BUCK5_EN"), RT: n("BUCK5_RT"), FB: n("BUCK5_FB"), COMP: n("BUCK5_COMP"),
BOOT: n("BUCK5_BOOT"), SW: n("BUCK5_SW"), GND: n("GND"), EP: n("GND"),
}} />
{/* RT = 101756 / f^1.008 (kOhm, kHz) -> 196k ~ 500 kHz */}
<R name="R5VRT" v="196k" a={n("BUCK5_RT")} b={n("GND")} at={{ x: -33.4, y: 30.0, r: 90 }} />
<R name="R5VEN1" v="100k" a={n("VIN_SYS")} b={n("BUCK5_EN")} at={{ x: -32.1, y: 32.6, r: 270 }} />
<R name="R5VEN2" v="20k" a={n("BUCK5_EN")} b={n("GND")} at={{ x: -32.1, y: 30.0, r: 90 }} />
<C name="C5VBT" v="100nF" rating="25V" a={n("BUCK5_BOOT")} b={n("BUCK5_SW")} at={{ x: -27.6, y: 24.5, r: 270 }} />
{/* 0.8 V x (1 + 53.6k/10k) = 5.09 V */}
<R name="R5VFB1" v="53.6k" a={n("V5V0")} b={n("BUCK5_FB")} at={{ x: -32.0, y: 14.4, r: 270 }} />
<R name="R5VFB2" v="10k" a={n("BUCK5_FB")} b={n("GND")} at={{ x: -32.0, y: 19.0, r: 270 }} />
<R name="R5VCR" v="16.9k" a={n("BUCK5_COMP")} b={n("BUCK5_CRC")} at={{ x: -30.7, y: 14.4, r: 270 }} />
<C name="C5VCC" v="4.7nF" a={n("BUCK5_CRC")} at={{ x: -32.0, y: 12.4, r: 270 }} />
<C name="C5VCP" v="47pF" a={n("BUCK5_COMP")} at={{ x: -30.7, y: 19.0, r: 270 }} />
<C name="C5VIN1" v="10uF" rating="50V" fp="1206" a={n("VIN_SYS")} at={{ x: -28.9, y: 30.1 }} />
<C name="C5VIN2" v="100nF" rating="50V" a={n("VIN_SYS")} at={{ x: -29.4, y: 31.9 }} />
<B560C_13_F {...schematicPlacement("D5V")} name="D5V" pcbX={-24.95} pcbY={16.1} pcbRotation={0}
connections={{ cathode: n("BUCK5_SW"), anode: n("GND") }} />
<FXL0630_4R7_M {...schematicPlacement("L5V")} name="L5V" pcbX={-23.5} pcbY={23.9} pcbRotation={90}
connections={{ pin1: n("BUCK5_SW"), pin2: n("V5V0") }} />
{[0, 1, 2].map((k) => (
<C key={k} name={`C5VO${k + 1}`} v="22uF" rating="10V" fp="0805" a={n("V5V0")}
at={{ x: -18.2, y: 28.9 - 2.0 * k }} />
))}
{/* --- always-on 3.3 V for supervisors, latch and protection ICs --- */}
<AP2112K_3_3TRG1 {...schematicPlacement("UAON")} name="UAON" pcbX={-18.0} pcbY={20.5}
connections={{ VIN: n("V5V0"), EN: n("V5V0"), GND: n("GND"), VOUT: n("V3V3_AON") }} />
<C name="CAONI" v="1uF" fp="0402" a={n("V5V0")} at={{ x: -17.7, y: 17.5 }} />
<C name="CAONO" v="1uF" fp="0402" a={n("V3V3_AON")} at={{ x: -15.4, y: 20.5, r: 90 }} />
</group>
)