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-motherboard

In 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.

lib/hyg040n04.tsx

import type { ChipProps } from "@tscircuit/props"

/** HYG040N04LS1C1 (JLC C5250956) 40 V N-MOSFET, PDFN 3.3x3.3.
 * Footprint and 3D model from the JLC import (imports/HYG040N04LS1C1.tsx). The imported
 * custom symbol declares only 5 of the 9 pads, so this wrapper keeps the land pattern and
 * uses a standard chip symbol: pins 1-3 source, 4 gate, 5-8 + exposed pad drain. */
const pinLabels = {
  pin1: ["S1"], pin2: ["S2"], pin3: ["S3"], pin4: ["G"],
  pin5: ["D1"], pin6: ["D2"], pin7: ["D3"], pin8: ["D4"], pin9: ["DPAD", "thermalpad"],
} as const

export const Hyg040n04 = ({ g, s, d, ...props }: ChipProps<typeof pinLabels> & { g: string; s: string; d: string }) => (
  <chip
    {...props}
    pinLabels={pinLabels}
    supplierPartNumbers={{ jlcpcb: ["C5250956"] }}
    manufacturerPartNumber="HYG040N04LS1C1"
    footprint="dfn8_thermalpad2.05mmx2.6mm_thermalpadcenteroffsetx0.35mm_p0.65mm_w3.64mm_pw0.4mm_pl0.6mm_pin1location(leftside,bottom)"
    cadModel={{
      objUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C5250956.obj?uuid=e22328b7e36c4e8cb5fb593b770ac99b",
      stepUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C5250956.step?uuid=e22328b7e36c4e8cb5fb593b770ac99b",
      pcbRotationOffset: 0,
      modelOriginPosition: { x: 0, y: 0, z: 0 },
    }}
    schPinArrangement={{ leftSide: { pins: ["G"], direction: "top-to-bottom" },
      rightSide: { pins: ["D1", "D2", "D3", "D4", "DPAD", "S1", "S2", "S3"], direction: "top-to-bottom" } }}
    connections={{ G: g, S1: s, S2: s, S3: s, D1: d, D2: d, D3: d, D4: d, DPAD: d }}
  />
)