krishnax12/usb-c-control-dial

USB-C control dial PCB with an EC11 push encoder and a 16-LED ring for volume and brightness controls. Work in progress; firmware not included and not fabrication-ready.

Version
0.0.3
License
unset
Stars
1

components/controller.tsx

import { CH552T } from "../imports/CH552T/CH552T"
import { EC11E183440C } from "../imports/EC11E183440C/EC11E183440C"
import { TS_1187A_B_A_B } from "../imports/TS_1187A_B_A_B/TS_1187A_B_A_B"

export function Controller() {
  return (
    <>
      <schematicsheet name="CONTROL">
        <CH552T
          name="U1"
          pcbX={-12}
          pcbY={-8}
          layer="bottom"
          schWidth={2.2}
          schHeight={2.2}
          schPinArrangement={{
            leftSide: {
              pins: [
                "pin19",
                "pin20",
                "pin18",
                "pin14",
                "pin15",
                "pin6",
                "pin16",
                "pin17",
                "pin1",
                "pin2",
              ],
              direction: "top-to-bottom",
            },
            rightSide: {
              pins: [
                "pin7",
                "pin8",
                "pin11",
                "pin3",
                "pin4",
                "pin5",
                "pin9",
                "pin10",
                "pin12",
                "pin13",
              ],
              direction: "top-to-bottom",
            },
          }}
          connections={{
            pin3: "net.LED_RAW",
            pin6: "net.RESET",
            pin7: "net.ENC_A",
            pin8: "net.ENC_B",
            pin11: "net.ENC_SW",
            pin14: "net.USB_DP",
            pin15: "net.USB_DM",
            pin18: "net.GND",
            pin19: "net.V5",
            pin20: "net.V33",
          }}
          noConnect={[
            "pin1",
            "pin2",
            "pin4",
            "pin5",
            "pin9",
            "pin10",
            "pin12",
            "pin13",
            "pin16",
            "pin17",
          ]}
        />
      </schematicsheet>
      <schematicsheet name="ENCODER">
        <EC11E183440C
          name="ENC1"
          pcbSx={{ "& silkscreencircle": { visibility: "hidden" } }}
          symbol={undefined}
          schWidth={1.8}
          schHeight={0.8}
          schPinArrangement={{
            leftSide: { pins: ["A", "B", "D"], direction: "top-to-bottom" },
            bottomSide: {
              pins: ["C", "E", "pin6", "pin7"],
              direction: "left-to-right",
            },
          }}
          connections={{
            A: "net.ENC_A",
            B: "net.ENC_B",
            C: "net.GND",
            D: "net.ENC_SW",
            E: "net.GND",
            pin6: "net.GND",
            pin7: "net.GND",
          }}
        />
        <resistor
          name="R3"
          resistance="10k"
          supplierPartNumbers={{ jlcpcb: ["C25804"] }}
          footprint="0603"
          layer="bottom"
          pcbX={-6}
          pcbY={-11}
          connections={{ pin1: "net.V5", pin2: "net.ENC_A" }}
        />
        <resistor
          name="R4"
          pcbRotation={180}
          resistance="10k"
          supplierPartNumbers={{ jlcpcb: ["C25804"] }}
          footprint="0603"
          layer="bottom"
          pcbX={-2}
          pcbY={-11}
          connections={{ pin1: "net.V5", pin2: "net.ENC_B" }}
        />
        <resistor
          name="R5"
          resistance="10k"
          supplierPartNumbers={{ jlcpcb: ["C25804"] }}
          footprint="0603"
          layer="bottom"
          pcbX={2}
          pcbY={11}
          connections={{ pin1: "net.V5", pin2: "net.ENC_SW" }}
        />
      </schematicsheet>
      <schematicsheet name="CONTROL_SUPPORT">
        <resistor
          name="R6"
          resistance="10k"
          supplierPartNumbers={{ jlcpcb: ["C25804"] }}
          footprint="0603"
          layer="bottom"
          pcbX={-6}
          pcbY={-6}
          connections={{ pin1: "net.RESET", pin2: "net.GND" }}
        />
        <resistor
          name="R7"
          pcbRotation={180}
          resistance="330"
          supplierPartNumbers={{ jlcpcb: ["C23138"] }}
          footprint="0603"
          layer="bottom"
          pcbX={-7}
          pcbY={-15}
          connections={{ pin1: "net.LED_RAW", pin2: "net.LED_DATA" }}
        />
      </schematicsheet>
      <schematicsheet name="MCU_DECOUPLING">
        <capacitor
          name="C3"
          capacitance="100nF"
          supplierPartNumbers={{ jlcpcb: ["C14663"] }}
          maxVoltageRating="16V"
          footprint="0603"
          layer="bottom"
          pcbX={-10}
          pcbY={-13}
          connections={{ pin1: "net.V5", pin2: "net.GND" }}
        />
        <capacitor
          name="C4"
          capacitance="100nF"
          supplierPartNumbers={{ jlcpcb: ["C14663"] }}
          maxVoltageRating="16V"
          footprint="0603"
          layer="bottom"
          pcbX={-13.5}
          pcbY={-14.5}
          pcbRotation={90}
          connections={{ pin1: "net.V33", pin2: "net.GND" }}
        />
      </schematicsheet>
      <schematicsheet name="PROGRAMMING">
        <TS_1187A_B_A_B
          name="SW1"
          pcbX={12}
          pcbY={-12}
          connections={{
            A: "net.BOOT",
            B: "net.BOOT",
            C: "net.V33",
            D: "net.V33",
          }}
        />
        <resistor
          name="R8"
          pcbRotation={180}
          schRotation={-90}
          resistance="10k"
          supplierPartNumbers={{ jlcpcb: ["C25804"] }}
          footprint="0603"
          pcbX={8}
          pcbY={-16}
          connections={{ pin1: "net.BOOT", pin2: "net.USB_DP" }}
        />
        <schematictext
          schX={0}
          schY={15}
          fontSize={0.7}
          text="CH552T USB HID controller, internal 24 MHz clock, 5 V GPIO. V33 is USB-only: 100 nF to GND."
        />
        <schematictext
          schX={0}
          schY={13.5}
          fontSize={0.7}
          text="Encoder press: mute; hold: change mode (firmware). Hold BOOT while connecting USB to program."
        />
      </schematicsheet>
    </>
  )
}