aj0070/dual-motor-encoder

A 60×45 mm dual-motor controller board built around an RP2040 MCU with QSPI flash, USB‑C, encoder inputs, dual DRV8871 H‑bridge drivers, protected power input, 5 V buck and 3.3 V LDO rails, connectors, filtering, and status LEDs.

Version
1.0.0
License
unset
Stars
0

Use with the tscircuit CLI

tsci is the tscircuit CLI. Install it with npm install -g tscircuit.

tsci clone aj0070/dual-motor-encoder  # download the package files into ./dual-motor-encoder
tsci add aj0070/dual-motor-encoder    # add it to your project as @tsci/aj0070.dual-motor-encoder

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.

parts/encoders.tsx

import React from "react"

export const Encoders = () => (
  <>
    <schematicsheet name="ENC" displayName="Quadrature encoders" sheetIndex={4} />
    <schematicsection name="ENC1" displayName="Encoder 1" />
    <schematicsection name="ENC2" displayName="Encoder 2" />

    <pinheader
      name="J5"
      pinCount={6}
      pitch="2.54mm"
      gender="male"
      footprint="pinrow6_p2.54mm"
      showSilkscreenPinLabels
      pinLabels={["5V", "GND", "A", "B", "IDX", "GND2"]}
      schWidth={0.58}
      schSheetName="ENC"
      schSectionName="ENC1"
      schX={-13}
      schY={6}
      pcbX={-12.0}
      pcbY={20.2}
      connections={{
        pin1: "net.V5",
        pin2: "net.GND",
        pin3: "net.ENC1_A_H",
        pin4: "net.ENC1_B_H",
        pin5: "net.ENC1_IDX_H",
        pin6: "net.GND",
      }}
    />
    <resistor
      name="R15"
      resistance="10k"
      footprint="0603"
      schSheetName="ENC"
      schSectionName="ENC1"
      schX={-9}
      schY={9}
      schRotation={270}
      pcbX={-21.0}
      pcbY={16.71}
      connections={{ pin1: "net.V3_3", pin2: "net.ENC1_A_H" }}
      pcbRotation={90}/>
    <resistor
      name="R16"
      resistance="10k"
      footprint="0603"
      schSheetName="ENC"
      schSectionName="ENC1"
      schX={-7}
      schY={9}
      schRotation={270}
      pcbX={-17.8}
      pcbY={16.75}
      connections={{ pin1: "net.V3_3", pin2: "net.ENC1_B_H" }}
      pcbRotation={90}/>
    <resistor
      name="R17"
      resistance="10k"
      footprint="0603"
      schSheetName="ENC"
      schSectionName="ENC1"
      schX={-5}
      schY={9}
      schRotation={270}
      pcbX={-14.6}
      pcbY={16.75}
      connections={{ pin1: "net.V3_3", pin2: "net.ENC1_IDX_H" }}
      pcbRotation={90}/>
    <resistor
      name="R21"
      resistance="1k"
      footprint="0603"
      schSheetName="ENC"
      schSectionName="ENC1"
      schX={-9}
      schY={6}
      pcbX={-11.4}
      pcbY={16.92}
      connections={{ pin1: "net.ENC1_A_H", pin2: "net.ENC1_A" }}
    />
    <resistor
      name="R22"
      resistance="1k"
      footprint="0603"
      schSheetName="ENC"
      schSectionName="ENC1"
      schX={-9}
      schY={4}
      pcbX={-8.2}
      pcbY={16.5}
      connections={{ pin1: "net.ENC1_B_H", pin2: "net.ENC1_B" }}
    />
    <resistor
      name="R23"
      resistance="1k"
      footprint="0603"
      schSheetName="ENC"
      schSectionName="ENC1"
      schX={-9}
      schY={2}
      pcbX={-21.0}
      pcbY={14.29}
      connections={{ pin1: "net.ENC1_IDX_H", pin2: "net.ENC1_IDX" }}
    />
    <capacitor
      name="C32"
      capacitance="10nF"
      footprint="0603"
      schSheetName="ENC"
      schSectionName="ENC1"
      schX={-6}
      schY={6}
      schRotation={270}
      pcbX={-14.6}
      pcbY={11.18}
      connections={{ pin1: "net.ENC1_A", pin2: "net.GND" }}
    />
    <capacitor
      name="C33"
      capacitance="10nF"
      footprint="0603"
      schSheetName="ENC"
      schSectionName="ENC1"
      schX={-6}
      schY={4}
      schRotation={270}
      pcbX={-11.4}
      pcbY={12.09}
      connections={{ pin1: "net.ENC1_B", pin2: "net.GND" }}
    />
    <capacitor
      name="C34"
      capacitance="10nF"
      footprint="0603"
      schSheetName="ENC"
      schSectionName="ENC1"
      schX={-6}
      schY={2}
      schRotation={270}
      pcbX={-8.2}
      pcbY={12.5}
      connections={{ pin1: "net.ENC1_IDX", pin2: "net.GND" }}
      pcbRotation={180}/>

    <pinheader
      name="J6"
      pinCount={6}
      pitch="2.54mm"
      gender="male"
      footprint="pinrow6_p2.54mm"
      showSilkscreenPinLabels
      pinLabels={["5V", "GND", "A", "B", "IDX", "GND2"]}
      schWidth={0.58}
      schSheetName="ENC"
      schSectionName="ENC2"
      schX={5}
      schY={6}
      pcbX={12.0}
      pcbY={20.2}
      connections={{
        pin1: "net.V5",
        pin2: "net.GND",
        pin3: "net.ENC2_A_H",
        pin4: "net.ENC2_B_H",
        pin5: "net.ENC2_IDX_H",
        pin6: "net.GND",
      }}
    />
    <resistor
      name="R18"
      resistance="10k"
      footprint="0603"
      schSheetName="ENC"
      schSectionName="ENC2"
      schX={1}
      schY={9}
      schRotation={270}
      pcbX={-17.8}
      pcbY={13.59}
      connections={{ pin1: "net.V3_3", pin2: "net.ENC2_A_H" }}
      pcbRotation={90}/>
    <resistor
      name="R19"
      resistance="10k"
      footprint="0603"
      schSheetName="ENC"
      schSectionName="ENC2"
      schX={3}
      schY={9}
      schRotation={270}
      pcbX={-14.6}
      pcbY={13.59}
      connections={{ pin1: "net.V3_3", pin2: "net.ENC2_B_H" }}
      pcbRotation={180}/>
    <resistor
      name="R20"
      resistance="10k"
      footprint="0603"
      schSheetName="ENC"
      schSectionName="ENC2"
      schX={5}
      schY={9}
      schRotation={270}
      pcbX={-11.4}
      pcbY={14.5}
      connections={{ pin1: "net.V3_3", pin2: "net.ENC2_IDX_H" }}
      pcbRotation={90}/>
    <resistor
      name="R24"
      resistance="1k"
      footprint="0603"
      schSheetName="ENC"
      schSectionName="ENC2"
      schX={9}
      schY={6}
      pcbX={-8.2}
      pcbY={14.5}
      connections={{ pin1: "net.ENC2_A_H", pin2: "net.ENC2_A" }}
    />
    <resistor
      name="R25"
      resistance="1k"
      footprint="0603"
      schSheetName="ENC"
      schSectionName="ENC2"
      schX={9}
      schY={4}
      pcbX={-21.0}
      pcbY={12.5}
      connections={{ pin1: "net.ENC2_B_H", pin2: "net.ENC2_B" }}
    />
    <resistor
      name="R26"
      resistance="1k"
      footprint="0603"
      schSheetName="ENC"
      schSectionName="ENC2"
      schX={9}
      schY={2}
      pcbX={-17.8}
      pcbY={11.18}
      connections={{ pin1: "net.ENC2_IDX_H", pin2: "net.ENC2_IDX" }}
    />
    <capacitor
      name="C35"
      capacitance="10nF"
      footprint="0603"
      schSheetName="ENC"
      schSectionName="ENC2"
      schX={12}
      schY={6}
      schRotation={270}
      pcbX={-21.0}
      pcbY={10.5}
      connections={{ pin1: "net.ENC2_A", pin2: "net.GND" }}
    />
    <capacitor
      name="C36"
      capacitance="10nF"
      footprint="0603"
      schSheetName="ENC"
      schSectionName="ENC2"
      schX={12}
      schY={4}
      schRotation={270}
      pcbX={-17.8}
      pcbY={9.51}
      connections={{ pin1: "net.ENC2_B", pin2: "net.GND" }}
    />
    <capacitor
      name="C37"
      capacitance="10nF"
      footprint="0603"
      schSheetName="ENC"
      schSectionName="ENC2"
      schX={12}
      schY={2}
      schRotation={270}
      pcbX={-14.6}
      pcbY={9.51}
      connections={{ pin1: "net.ENC2_IDX", pin2: "net.GND" }}
    />
  </>
)