Devesh36/bench-eight

Eight-channel 0–10 V measurement and control console: dual ADS1115 ADCs, buffered inputs, Pico controller, microSD, RTC, RS-485, four protected low-voltage outputs and a separate OLED/encoder panel in a tscircuit assembly.

Version
0.1.3
License
unset
Stars
0

Use with the tscircuit CLI

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

tsci clone Devesh36/bench-eight  # download the package files into ./bench-eight
tsci add Devesh36/bench-eight    # add it to your project as @tsci/Devesh36.bench-eight

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.

ui.circuit.tsx

PCBPCB preview for ui.circuit.tsx
SchematicSchematic preview for ui.circuit.tsx
import { Fragment } from "react";
import type { BoardProps } from "@tscircuit/props";
import { Header, Encoder } from "./parts";
export const uiPins = {
	pin1: "net.V5",
	pin2: "net.GND",
	pin3: "net.SPI_SCK",
	pin4: "net.SPI_MOSI",
	pin5: "net.OLED_CS",
	pin6: "net.OLED_DC",
	pin7: "net.OLED_RST",
	pin8: "net.ENC_A",
	pin9: "net.ENC_B",
	pin10: "net.ENC_SW",
	pin11: "net.V3V3",
	pin12: "net.STATUS",
};
export default function ControlPanel(props: BoardProps) {
	return (
		<board
			name="PANEL"
			width={108}
			height={48}
			thickness={1.6}
			solderMaskColor="blue"
			autorouter="auto_local"
			minTraceToPadEdgeClearance={0.15}
			schTraceAutoLabelEnabled
			{...props}
		>
			<schematicsheet
				name="UI"
				displayName="Display and rotary control"
				sheetWidth={420}
				sheetHeight={297}
			>
				<schematicsection name="UI" displayName="Display and rotary control" />
			</schematicsheet>
			<net name="GND" isGroundNet />
			<net name="V3V3" isPowerNet />
			<net name="V5" isPowerNet />
			<Header
				schSheetName="UI"
				schSectionName="UI"
				name="J_MAIN"
				count={12}
				pcbX={-37}
				pcbY={0}
				pcbRotation={90}
				schX={-10}
				schY={0}
				schWidth={2}
				schHeight={1.4}
				connections={uiPins}
			/>
			<Header
				schSheetName="UI"
				schSectionName="UI"
				name="J_OLED"
				count={7}
				pcbX={-14}
				pcbY={-17}
				schX={-2}
				schY={0}
				schWidth={2.5}
				schHeight={1.8}
				connections={{
					pin1: "net.V5",
					pin2: "net.GND",
					pin3: "net.SPI_MOSI",
					pin4: "net.SPI_SCK",
					pin5: "net.OLED_CS",
					pin6: "net.OLED_DC",
					pin7: "net.OLED_RST",
				}}
			/>
			<Encoder
				schSheetName="UI"
				schSectionName="UI"
				name="ENC1"
				pcbX={37}
				pcbY={0}
				schX={7}
				schY={0}
				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",
				}}
			/>
			{["ENC_A", "ENC_B", "ENC_SW"].map((net, i) => (
				<Fragment key={net}>
					<resistor
						schRotation={-90}
						schSheetName="UI"
						schSectionName="UI"
						name={`R_ENC${i}`}
						resistance="10k"
						footprint="0603"
						manufacturerPartNumber="RC0603FR-0710KL"
						pcbX={23}
						pcbY={6 - i * 5}
						schX={4 + i * 3}
						schY={5}
						connections={{ pin1: "net.V3V3", pin2: `net.${net}` }}
					/>
					<capacitor
						schSheetName="UI"
						schSectionName="UI"
						name={`C_ENC${i}`}
						capacitance="10nF"
						footprint="0603"
						manufacturerPartNumber="GRM188R71H103KA01D"
						pcbX={18}
						pcbY={6 - i * 5}
						schX={4 + i * 3}
						schY={-5}
						schRotation={-90}
						connections={{ pin1: `net.${net}`, pin2: "net.GND" }}
					/>
				</Fragment>
			))}
			<capacitor
				schRotation={-90}
				schSheetName="UI"
				schSectionName="UI"
				name="C_PANEL"
				capacitance="1uF"
				footprint="0805"
				manufacturerPartNumber="GRM21BR61C105KA01L"
				pcbX={-28}
				pcbY={-15}
				schX={-6}
				schY={7}
				connections={{ pin1: "net.V5", pin2: "net.GND" }}
			/>
			<resistor
				schSheetName="UI"
				schSectionName="UI"
				name="R_UI_LED"
				resistance="1k"
				footprint="0603"
				manufacturerPartNumber="RC0603FR-071KL"
				pcbX={37}
				pcbY={15}
				schX={13}
				schY={4}
				connections={{ pin1: "net.STATUS", pin2: "net.LED" }}
			/>
			<led
				schRotation={-90}
				schSheetName="UI"
				schSectionName="UI"
				name="LED_UI"
				color="blue"
				footprint="0603"
				manufacturerPartNumber="LTST-C190TBKT"
				pcbX={43}
				pcbY={15}
				pcbRotation={45}
				schX={13}
				schY={0}
				connections={{ pos: "net.LED", neg: "net.GND" }}
			/>
			{[-50, 50].flatMap((x) =>
				[-20, 20].map((y) => (
					<Fragment key={`${x}:${y}`}>
						<hole pcbX={x} pcbY={y} diameter={3.2} />
					</Fragment>
				)),
			)}
			{["OLED_CS", "OLED_RST"].map((net, i) => (
				<resistor
					key={net}
					name={`R_OLED${i}`}
					resistance="10k"
					footprint="0603"
					manufacturerPartNumber="RC0603FR-0710KL"
					pcbX={-10 + i * 6}
					pcbY={-11}
					schX={-2 + i * 3}
					schY={7}
					schRotation={-90}
					schSheetName="UI"
					schSectionName="UI"
					connections={{ pin1: "net.V3V3", pin2: `net.${net}` }}
				/>
			))}
			<silkscreentext
				text="BENCH EIGHT / CONTROL PANEL"
				pcbX={0}
				pcbY={21}
				fontSize={1}
			/>
			<silkscreentext
				text="OLED: 5V GND DIN CLK CS DC RST"
				pcbX={-14}
				pcbY={-22}
				fontSize={0.8}
			/>
			<silkscreentext text="TURN / PRESS" pcbX={37} pcbY={-13} fontSize={0.8} />
		</board>
	);
}