gokul/usb3-sd-hub
Engineering draft: four-layer, computer-powered USB 3 hub with one USB-C host socket, two USB-C and two USB-A accessory sockets, and a full-size SD slot. Board and three schematic previews are available. Routing and production checks are incomplete; not fabrication ready.
- Version
- 0.1.4
- License
- unset
- Stars
- 0
design/part-selection.ts
import type { PassiveSpec } from "../components/Passives";
// Yageo RC0402: 1%, 50 V maximum working voltage, 0.063 W.
// Every resistance below is a standard E24/E96 ordering value.
const resistors: Record<string, string> = {
"22": "RC0402FR-0722RL",
"2.2k": "RC0402FR-072K2L",
"4.7k": "RC0402FR-074K7L",
"10k": "RC0402FR-0710KL",
"12k": "RC0402FR-0712KL",
"16.9k": "RC0402FR-0716K9L",
"20k": "RC0402FR-0720KL",
"22.1k": "RC0402FR-0722K1L",
"43.2k": "RC0402FR-0743K2L",
"47k": "RC0402FR-0747KL",
"100k": "RC0402FR-07100KL",
"169k": "RC0402FR-07169KL",
"200k": "RC0402FR-07200KL",
"316k": "RC0402FR-07316KL",
"887k": "RC0402FR-07887KL",
};
const capacitors: Record<string, string> = {
// Murata: 0402, 16 V, X7R, 10%.
"100nF": "GRM155R71C104KA88D",
// Murata: 0402, 50 V, C0G, 5%.
"18pF": "GRM1555C1H180JA01D",
// Murata: 0402, 10 V, X5R, 10%.
"1uF": "GRM155R61A105KE15D",
// Murata: 0603, 16 V, X5R, 10%.
"4.7uF": "GRM188R61C475KE11D",
// Murata: 0805, 16 V, X5R, 10% / 20% respectively.
"10uF": "GRM21BR61C106KE15L",
"22uF": "GRM21BR61C226ME44L",
};
export const selectPassivePart = ({ kind, rating }: PassiveSpec): string => {
const selectedPart =
kind === "resistor" ? resistors[rating] : capacitors[rating];
if (!selectedPart)
throw new Error(`No ordering part selected for ${kind} ${rating}`);
return selectedPart;
};