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/io.tsx

import React from "react"

export const Io = () => (
  <>
    <schematicsheet name="IO" displayName="I2C, LEDs, mounting" sheetIndex={5} />
    <schematicsection name="IO_I2C" displayName="I2C / IMU" />
    <schematicsection name="IO_LED" displayName="Status LEDs" />

    <connector
      name="J7"
      footprint="jst4_p1mm_sh"
      pinLabels={{ pin1: "GND", pin2: "3V3", pin3: "SDA", pin4: "SCL", pin5: "MP1", pin6: "MP2" }}
      schSheetName="IO"
      schSectionName="IO_I2C"
      schX={-6}
      schY={4}
      pcbX={26.8}
      pcbY={0.0}
      pcbRotation={270}
      connections={{
        pin1: "net.GND",
        pin2: "net.V3_3",
        pin3: "net.I2C_SDA",
        pin4: "net.I2C_SCL",
        pin5: "net.GND",
        pin6: "net.GND",
      }}
    />
    <resistor
      name="R29"
      resistance="4.7k"
      footprint="0603"
      schSheetName="IO"
      schSectionName="IO_I2C"
      schX={-3}
      schY={7}
      schRotation={270}
      pcbX={22.0}
      pcbY={0.0}
      connections={{ pin1: "net.V3_3", pin2: "net.I2C_SDA" }}
    />
    <resistor
      name="R30"
      resistance="4.7k"
      footprint="0603"
      schSheetName="IO"
      schSectionName="IO_I2C"
      schX={-1}
      schY={7}
      schRotation={270}
      pcbX={22.0}
      pcbY={-2.5}
      connections={{ pin1: "net.V3_3", pin2: "net.I2C_SCL" }}
    />

    <resistor
      name="R27"
      resistance="1k"
      footprint="0603"
      schSheetName="IO"
      schSectionName="IO_LED"
      schX={3}
      schY={7}
      schRotation={270}
      pcbX={22.0}
      pcbY={8.0}
      connections={{ pin1: "net.V3_3", pin2: "net.LED_PWR" }}
    />
    <led
      name="D5"
      color="green"
      footprint="0805"
      schSheetName="IO"
      schSectionName="IO_LED"
      schX={3}
      schY={3}
      schRotation={270}
      pcbX={22.0}
      pcbY={5.0}
      connections={{ pin1: "net.LED_PWR", pin2: "net.GND" }}
    />
    <resistor
      name="R28"
      resistance="1k"
      footprint="0603"
      schSheetName="IO"
      schSectionName="IO_LED"
      schX={6}
      schY={7}
      schRotation={270}
      pcbX={22.0}
      pcbY={10.5}
      connections={{ pin1: "net.V3_3", pin2: "net.LED_STAT" }}
    />
    <led
      name="D6"
      color="red"
      footprint="0805"
      schSheetName="IO"
      schSectionName="IO_LED"
      schX={6}
      schY={3}
      schRotation={270}
      pcbX={22.0}
      pcbY={2.5}
      connections={{ pin1: "net.LED_STAT", pin2: "net.STAT_LED" }}
    />

    <hole name="H1" diameter="3.2mm" pcbX={-26} pcbY={19} />
    <hole name="H2" diameter="3.2mm" pcbX={26} pcbY={19} />
    <hole name="H3" diameter="3.2mm" pcbX={-26} pcbY={-19} />
    <hole name="H4" diameter="3.2mm" pcbX={26} pcbY={-19} />
  </>
)