MustafaMulla29/rp2040-bldc-motor-controller

Hardware assembly metadata and PCB geometry for a controller board with a snap-off rotary-encoder section, plus four parallel 150 µF/50 V bulk electrolytic capacitors filtering the motor supply.

Version
2.0.40
License
unset
Stars
0

Use with the tscircuit CLI

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

tsci clone MustafaMulla29/rp2040-bldc-motor-controller  # download the package files into ./rp2040-bldc-motor-controller
tsci add MustafaMulla29/rp2040-bldc-motor-controller    # add it to your project as @tsci/MustafaMulla29.rp2040-bldc-motor-controller

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.

circuit/user-interface.tsx

import { PlugInOled } from "./oled"
import { TMP102AIDRLR } from "../imports/TMP102AIDRLR"
import { HNB09A03 } from "../imports/HNB09A03"
import { SS54 } from "../imports/SS54"
import { BoardButton } from "./controls"
import { schAt, net, Passives, Npn, type Passive } from "./helpers"

// Dedicated UI bus: hardware I2C0 on GP16/17. The motor bus on GP0/1 uses
// software I2C; the PD controller retains hardware I2C1 on GP22/23.
// OLED: 0x3C (0x3D alternate); TMP102 ADD0=GND: 0x48.
const passives: Passive[] = [
  {name:"R150",kind:"R",value:"4.7k",a:"V3V3",b:"UI_SDA",x:0,y:0},
  {name:"R151",kind:"R",value:"4.7k",a:"V3V3",b:"UI_SCL",x:0,y:0},
  {name:"R152",kind:"R",value:"1k",a:"BUZZER_EN",b:"BUZZER_BASE",x:0,y:0},
  {name:"R153",kind:"R",value:"100k",a:"BUZZER_BASE",b:"GND",x:0,y:0},
  {name:"R154",kind:"R",value:"10k",a:"V3V3",b:"TEMP_ALERT_N",x:0,y:0},
  {name:"C150",kind:"C",value:"100nF",a:"V3V3",b:"GND",x:0,y:0,footprint:"0402",volts:10},
  {name:"C151",kind:"C",value:"10uF",a:"V3V3",b:"GND",x:0,y:0,footprint:"0805",volts:10},
  {name:"C152",kind:"C",value:"100nF",a:"V3V3",b:"GND",x:0,y:0,footprint:"0402",volts:10},
  {name:"C153",kind:"C",value:"1uF",a:"V3V3",b:"GND",x:0,y:0,volts:10},
  ...["UP","DOWN","OK","BACK"].flatMap((key,i): Passive[] => [
    {name:`R${155+i}`,kind:"R",value:"10k",a:"V3V3",b:`KEY_${key}_N`,x:0,y:0},
    {name:`C${154+i}`,kind:"C",value:"100nF",a:`KEY_${key}_N`,b:"GND",x:0,y:0,footprint:"0402",volts:10},
  ]),
]

export function UserInterface() {
  return <>
    <PlugInOled />
    <TMP102AIDRLR name="U13" {...schAt("U13",0,0)}
      connections={{SCL:net("UI_SCL"),SDA:net("UI_SDA"),V_POS:net("V3V3"),
        GND:net("GND"),ADD0:net("GND"),ALERT:net("TEMP_ALERT_N")}} />
    {["UP","DOWN","OK","BACK"].map((key,i) =>
      <BoardButton key={key} name={`SW${5+i}`} signal={`KEY_${key}_N`} showReference={false} />)}
    <HNB09A03 name="BZ1" {...schAt("BZ1",0,0)}
      connections={{_POS:net("V3V3"),_NEG:net("BUZZER_LOW")}} />
    <Npn name="Q8" base="BUZZER_BASE" collector="BUZZER_LOW" x={0} y={0} sx={0} sy={0} />
    <SS54 name="D8" variant="schottky" {...schAt("D8",0,0)}
      connections={{anode:net("BUZZER_LOW"),cathode:net("V3V3")}} />
    <Passives parts={passives} sx={0} sy={0} />
  </>
}