muse/book-reading-clip-lamp

A 60‑mm ESP32‑S3 lamp-head PCB combining USB‑C battery charging/power regulation, OV5640 autofocus camera interfacing, I²S microphone and differential speaker audio, six‑LED boost-driven reading light, buttons, status indicators, and battery monitoring.

Version
0.2.5
License
unset
Stars
0

usb-connector.tsx

SchematicSchematic preview for usb-connector.tsx
// Frozen HRO TYPE-C-31-M-12 / JLCPCB C165948; manufacturer-audited footprint.
// Catalog pin map/model retained. Pad/slot sizes normalized to HRO drawing.
// Uses <connector standard="usb_c"> with explicit physical pads so the part is
// reproducible with --disable-parts-engine. Four paired power/ground contacts
// share wide lands; the eight signal contacts are at 0.5 mm pitch.
// HRO pin table: A6/B6=D+, A7/B7=D-, A5=CC1, B5=CC2; A8/B8=SBU unused.
// https://en.krhro.com/Product-Details/726.html
// https://datasheet.lcsc.com/lcsc/1903211732_Korean-Hroparts-Elec-TYPE-C-31-M-12_C165948.pdf
// Local cable insertion is from -Y. At the left board edge use pcbRotation=270
// (not 90): rear signal pads must face inward and the connector mouth outward.
import React from "react"
import type { ConnectorProps } from "@tscircuit/props"

export const usbConnectorPinLabels = {
  pin1: ["SHELL1","EH2"],
  pin2: ["SHELL2","EH1"],
  pin3: ["SHELL3","EH4"],
  pin4: ["SHELL4","EH3"],
  pin5: ["B8","SBU2"],
  pin6: ["A5","CC1"],
  pin7: ["B7","DM2","DN2"],
  pin8: ["A6","DP1"],
  pin9: ["A7","DM1","DN1"],
  pin10: ["B6","DP2"],
  pin11: ["A8","SBU1"],
  pin12: ["B5","CC2"],
  pin13: ["A1B12","GND1"],
  pin14: ["B1A12","GND2"],
  pin15: ["B4A9","VBUS1"],
  pin16: ["A4B9","VBUS2"]
} as const

// Physical package data only. The main circuit uses the standard connector
// primitive directly, so its USB-C schematic symbol comes from tscircuit.
export const usbConnectorProps = {
      pinLabels: usbConnectorPinLabels,
      supplierPartNumbers: { jlcpcb: ["C165948"] },
      manufacturerPartNumber: "TYPE-C-31-M-12",
      footprint: (<footprint insertionDirection="from_bottom">
        {/* HRO drawing, component-side recommended PCB layout. Origin retained
            from catalog to keep model alignment. PCB edge datum y=-4.8843 mm. */}
        <hole pcbX={-2.89} pcbY={0.9057} diameter={0.6} />
        <hole pcbX={2.89} pcbY={0.9057} diameter={0.6} />
        <platedhole portHints={["pin1"]} pcbX={4.325} pcbY={1.4057} holeWidth={0.6} holeHeight={1.7} outerWidth={0.9} outerHeight={2} shape="pill" />
        <platedhole portHints={["pin4"]} pcbX={-4.325} pcbY={1.4057} holeWidth={0.6} holeHeight={1.7} outerWidth={0.9} outerHeight={2} shape="pill" />
        <platedhole portHints={["pin2"]} pcbX={4.325} pcbY={-2.7743} holeWidth={0.6} holeHeight={1.4} outerWidth={0.9} outerHeight={1.7} shape="pill" />
        <platedhole portHints={["pin3"]} pcbX={-4.325} pcbY={-2.7743} holeWidth={0.6} holeHeight={1.4} outerWidth={0.9} outerHeight={1.7} shape="pill" />
        {/* 1.64 mm from pad rear edge to locating-hole centre, 0.5 mm from
            pad front edge to hole centre: pad length=1.14 mm. */}
        {Array.from({length: 8}, (_,i) => <React.Fragment key={`usb-signal-${i}`}><smtpad portHints={[`pin${i+5}`]} pcbX={-1.75+i*0.5} pcbY={1.9757} width={0.3} height={1.14} shape="rect" /></React.Fragment>)}
        <smtpad portHints={["pin13"]} pcbX={-3.2} pcbY={1.9757} width={0.6} height={1.14} shape="rect" />
        <smtpad portHints={["pin14"]} pcbX={3.2} pcbY={1.9757} width={0.6} height={1.14} shape="rect" />
        <smtpad portHints={["pin15"]} pcbX={2.4} pcbY={1.9757} width={0.6} height={1.14} shape="rect" />
        <smtpad portHints={["pin16"]} pcbX={-2.4} pcbY={1.9757} width={0.6} height={1.14} shape="rect" />
        <silkscreenpath route={[{x:-4.47,y:-1.67},{x:-4.47,y:0.18}]} />
        <silkscreenpath route={[{x:4.47,y:-1.67},{x:4.47,y:0.18}]} />
        <silkscreenpath route={[{x:-4.47,y:-3.92},{x:-4.47,y:-5.3943},{x:4.47,y:-5.3943},{x:4.47,y:-3.92}]} />
        <courtyardoutline outline={[{x:-5.1,y:2.9},{x:5.1,y:2.9},{x:5.1,y:-5.65},{x:-5.1,y:-5.65},{x:-5.1,y:2.9}]} />
      </footprint>),
      cadModel: {
        objUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C165948.obj?uuid=617b05f9bba7410b96c001093d8189e4",
        stepUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C165948.step?uuid=617b05f9bba7410b96c001093d8189e4",
        pcbRotationOffset: 180,
        modelOriginPosition: { x: 0, y: -2.7500289000000517, z: 0.000010999999999872223 },
      },
} satisfies Omit<ConnectorProps, "name">