MustafaMulla29/usb-pd-motherboard

4-layer USB-C PD hub motherboard with 20 V USB-C input, Linux T113-S3 computer, CH338F USB hub, four individually controlled 5–20 V PD outputs, USB data/camera ports, regulated rails, and hardware watchdog/E-stop safety interlock.

Version
1.0.24
License
unset
Stars
0

Use with the tscircuit CLI

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

tsci clone MustafaMulla29/usb-pd-motherboard  # download the package files into ./usb-pd-motherboard
tsci add MustafaMulla29/usb-pd-motherboard    # add it to your project as @tsci/MustafaMulla29.usb-pd-motherboard

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.

docs/bom-stock-cost-2026-12-02.md

# Parts stock and cost check (2026-12-02)

Checked against the reviewer's advice: use parts with more than about 1000 in stock, look for big cost
reductions, target under $10 (or $15) per board at 200 boards.

Source: the built board (`dist/index/circuit.json`, 407 placed parts of 84 kinds) and JLCPCB's live parts data on
2026-12-02 (stock and the price break for 200 boards). The full list is `bom-priced-2026-12-02.csv`.
Prices are for parts only. Sections 1 to 4 describe the board as it was before any change; sections 5 and 7 list
what was changed afterwards, and section 7 has the board's cost now.

## 1. Stock

Seven kinds are under 1000 in stock. Four of them cannot even cover 200 boards.

| Part on the board | Used for | JLC stock | Needed for 200 | Replacement that is in stock |
| --- | --- | ---: | ---: | --- |
| C1166, 150 kΩ 5 % | RBDRAMFT (1.5 V DRAM supply feedback) | **5** | 200 | C25755 150 kΩ 1 % (787,000) |
| C227310, 180 kΩ 5 % | RB33FT (3.3 V supply feedback) | **6** | 200 | C25760 180 kΩ 1 % (509,000) |
| C227295, 120 kΩ 5 % | RPDCFG1 (tells the CH224Q to ask for 20 V) | **17** | 200 | C2909314 120 kΩ 1 % (1,133,000) |
| C167294, 4.7 µH 0630 inductor | L5V, LP1–LP4 (5 per board) | **75** | 1000 | C167220 FXL0630-4R7-M, same 7 × 6.6 mm size, 33 mΩ, 6 A (143,000); also cheaper |
| C851002, 40.2 kΩ 0.1 % | RB33FB | 768 | 200 | C25893 40.2 kΩ 1 % (264,000) |
| C1849461, TPS16630PWPR | UIN, the input eFuse | 850 | 200 | none at JLC (the only other TPS16630 has 3). Enough for 200 boards today, but a risk |
| C2692947, 59 kΩ 0.1 % | RBCOREFT (0.95 V core supply feedback) | 990 | 200 | C32297 59 kΩ 1 % (103,000) |

The three resistors with 5, 6 and 17 in stock are 5 % parts picked automatically; all three set a voltage, so the
1 % replacements are also the better choice. The inductor footprint must be compared before swapping.

Above 1000 but worth watching (single source, a few thousand): T113-S3 2,369; STM32G0B1CBT6 1,571 (400 needed);
SMBJ30A C151917 1,228 (same part from another maker, C113998, has 135,000); USB2517I 3,033; TPD6S300A 3,077
(800 needed); TPS55288 3,846 (800 needed).

55 of the 84 kinds are JLC "extended" parts ($3 each per assembly order, about $0.83 per board at 200). 23 of those
are ordinary resistors and capacitors; choosing basic-library values where one exists would remove most of them.

## 2. Cost today: $57.42 of parts per board at 200 boards

| Section | Cost | Share |
| --- | ---: | ---: |
| Linux computer (T113-S3 $17.29, its supplies, microSD, debug) | $18.74 | 33 % |
| PD OUT 1–4 power stages (4 × $4.49) | $17.95 | 31 % |
| Supervisors A and B (2 × STM32G0B1CBT6 at $5.41) | $11.20 | 20 % |
| USB hub (USB2517I $3.32) + USB 1–4, CAM, PC ports | $4.77 | 8 % |
| Power input (TPS16630 $1.85, 5 V buck, CH224Q) | $3.87 | 7 % |
| Safety interlock + stop button | $0.89 | 2 % |

Nine chip types are 84 % of the cost: T113-S3 $17.29, 2 × STM32G0B1 $10.81, 4 × TPS55288 $7.06,
4 × TPD6S300A $3.76, 4 × TPS25947 $3.39, USB2517I $3.32, TPS16630 $1.85, 5 inductors $1.15, 8 MOSFETs $1.08.

Bare board and assembly come on top. Not quoted here; a rough guess for a 4-layer 90 × 98 mm board with about
1,660 solder joints is $5–6 per board at 200.

## 3. Where cost can come out

Prices are JLCPCB's on 2026-12-02; the savings are per board.

**A. Same design, part swaps (about −$3.5)**

| Change | Saves | Note |
| --- | ---: | --- |
| Inductor C167294 → C167220 (5 per board) | ≈ $0.85 | also fixes the stock problem; compare the footprints first |
| TPD6S300A ($0.94) → TPD6S300 ($0.30–0.51, 13,970 in stock), 4 per board | ≈ $2.35 | same package; read both datasheets for the differences before deciding |
| 0.1 % resistors → 1 % (6 parts), SMBJ30A from another maker | ≈ $0.30 | |

**B. Redesign of one block each (about −$11 more)**

| Change | Saves | Cost of the change |
| --- | ---: | --- |
| 2 × STM32G0B1 ($10.81) → 4 × CH32X035G8U6 ($0.27–0.54 each, 7,182 in stock), one small USB-PD microcontroller per port | ≈ $9.2 | new schematic for the supervisors, different firmware base (WCH RISC-V instead of STM32). The cheaper STM32G071C8T6 ($1.27–1.57) would be closer to a drop-in, but JLC has only 384 |
| USB2517I ($3.32) → CH338F 7-port hub ($0.96–1.70, 7,649 in stock) or FE2.1 ($1.12–1.86, 2,461) | ≈ $2 | new footprint; check per-port power control |

After A and B: about **$43** of parts.

**C. Changing what the product is (needed to get near $15)**

| Change | Saves | What is lost |
| --- | ---: | --- |
| T113-S3 ($17.29) → F1C200S ($5.55–7.62, 1,418 in stock) | ≈ $10.8 | only one USB port (no separate PC port), 64 MB, older ARM9 core. Other Linux chips at JLC cost more: RV1103 $9.83–12.29, RV1106G2 $10.81–13.57 |
| Charger-style port chips instead of buck-boost + eFuse + CC protection + supervisor: e.g. IP6538 ($0.56–1.63, 2,429 in stock), roughly $1.2 per port instead of $7.2 | ≈ $24 | each port tops out at 12 V / 27 W, no 15 or 20 V, and Linux has far less control of each port |

With A + hub + F1C200S + charger-style ports the parts come to roughly **$17**, about $22–23 with board and assembly.

## 4. Against the target

The reviewer's point, as the project owner reads it, is to take **$10–15 off the cost**. That is reachable: the
swaps already made (section 5) plus the hub and supervisor changes (section 6) come to about $15.50 per board.
A $10–15 *total* is not reachable for a Linux computer with four 5–20 V PD ports; section 3 C shows what that
would take.

## 5. Done on 2026-12-02 (same copper, checked by rebuilding)

| Part | Was | Now | Stock now |
| --- | --- | --- | ---: |
| L5V, LP1–LP4 (4.7 µH inductor) | C167294 (75 in stock) | C167220 FXL0630-4R7-M, on the existing pads | 143,427 |
| RBDRAMFT 150 kΩ | C1166 (5) | C25755, 1 % | 787,671 |
| RB33FT and RP1–4OV1, 180 kΩ | C227310 (6) and C25541 | C25760, 1 % | 509,435 |
| RPDCFG1 120 kΩ | C227295 (17) | C2909314, 1 % | 1,133,482 |
| RB33FB and RP1–4ILIM, 40.2 kΩ | C851002 (768) and C2141162, 0.1 % | C25893, 1 % | 263,893 |
| RBCOREFT 59 kΩ | C2692947 (990), 0.1 % | C32297, 1 % | 102,572 |

After the rebuild every pad, track and via is identical to before, 17 parts carry new JLC numbers, the board has 82
part kinds (was 84) and costs **$56.37** in parts (was $57.42). The only kind still under 1000 is the TPS16630PWPR
input eFuse (850), which has no other version at JLC. The inductor's own land pattern (pitch 6.0 mm, pads
2.4 × 3.2 mm) is within 0.06 mm of the pads on the board (pitch 6.07 mm, pads 2.35 × 3.5 mm).

## 6. Are the remaining cost swaps safe?

Stock and price are JLCPCB's on 2026-12-02 for 200 boards.

| Swap | Saves | Stock (needed) | Copper change | Verdict |
| --- | ---: | ---: | --- | --- |
| TPD6S300A → TPD6S300 (C2649810), 4 per board | $2.50 | 13,970 (800) | none: same package and pin numbers | **done** (section 7); works, but less robust (below) |
| USB2517I → CH338F (C42387425) | $2.25 | 7,649 (200) | new footprint; the hub area and the USB pairs are rerouted (50 of 1,444 connections touch the hub) | **done** (section 7), from the datasheet |
| 2 × STM32G0B1CBT6 → 4 × CH32X035G8U6 (C7437027) | $9.68 | 7,177 (800) | new parts, new placement; 78 of 1,444 connections touch the supervisors | a redesign, not a replacement (below) |
| 2 × STM32G0B1CBT6 → 2 × STM32G071CBU6 (C529343), a middle path | ≈ $7.9 | 1,055 (400) | same chip family and pin functions, but a QFN-48 instead of LQFP-48: the 48 pads move about 0.85 mm inward, so each supervisor's fan-out is redrawn | much lower risk, but stock is only just over 1000 |

**TPD6S300 instead of TPD6S300A** (TI datasheets SLVSDK3C and SLVSEL8). Pin numbers and names are the same and the
electrical tables match (24 V short-to-VBUS tolerance, CC OVP 6 V, same switch resistance). TI lists two advantages
of the A part. One concerns dead-battery start-up, which this board does not use (RPD_G1/2 are tied to ground).
The other matters here: after a static discharge that trips the overvoltage switch, the TPD6S300 takes at least
21 ms to reconnect CC, which TI says guarantees a Type-C disconnect; the TPD6S300A reconnects in about 0.9 ms and
holds the connection. On a PD OUT port a disconnect means the port drops its power and the device has to
renegotiate. So the cheaper part works, but a static shock at a connector can briefly cut power to that device.

**CH32X035 instead of the STM32G0B1** (WCH product page). Each CH32X035 has one USB-PD controller, so it takes four
chips, one per port, instead of two. It has only one I2C interface, and each supervisor here uses two (one to the
TPS55288 converters, one to the Linux computer), so the port control wiring has to be redesigned as well. The
firmware base changes from ST's USB-PD library to WCH's. None of the supervisor firmware is written yet, so no code
is lost, but this is the largest change on the list and the least proven.

**CH338F instead of the USB2517I** (WCH datasheet CH338DS1, V1.3). A 7-port high-speed hub in a 4 × 4 mm QFN-32. The
"F" package has one shared power-enable pin and one shared over-current pin, not one per port: per-port control
is only on the QFN-64 CH338X, of which JLC has 41. So each port's 5 V switch is now driven by a Linux GPIO.

## 7. Done on 2026-12-02, second round: two chips changed

| Part | Was | Now | Per board at 200 | JLC stock |
| --- | --- | --- | ---: | ---: |
| UP1CC–UP4CC, CC protection on PD OUT 1–4 | TPD6S300A, C2876380, 4 × $0.94 | TPD6S300, C2649810, 4 × $0.31 | −$2.50 | 13,970 |
| UHUB, USB hub | USB2517I, C478081, $3.32 | CH338F, C42387425, $1.07 | −$2.25 | 7,649 |
| YHUB, hub crystal | 24 MHz Murata, C127895, $0.12 | 25 MHz X322525MOB4SI, C9006 (a JLC basic part), $0.06 | −$0.06 | 411,491 |

The board now has 405 placed parts of 85 kinds and costs **$51.51** in parts per board at 200 boards.
It was $57.42 at the start of the day: **$5.91 less**. 55 kinds are JLC "extended" parts.
Under 1000 in stock: TPS16630PWPR (C1849461, 850, used as UIN). It has no other version at JLC.

**TPD6S300**: same pads, same tracks; checked by rebuilding (every pad, track and via identical).

**CH338F hub**: the chip is smaller and has a different pin layout, so the hub area was laid out again. Board size
and layer count are unchanged (90 × 98 mm, 4 layers). Of the 1,168 saved routes, 1,041 are unchanged entry for
entry; the hub's own nets, the six USB pairs that end at the hub and the five port-enable lines were routed
again. The build reports no errors. Five of the six pairs got shorter and all are within 2 mm of length match
(ROUTING.txt has the table). Wiring follows the datasheet's reference circuits.

What works differently with the new hub:

- **Port numbers in Linux.** "USB 3" is hub port 5 and "CAM" is hub port 3 (USB 1, 2 and 4 keep their numbers),
  because that is the order of the chip's pins. The numbers printed on the board do not change.
- **Port power.** Linux switches each port's 5 V with its own GPIO (PD0–PD4). A port is off until Linux turns it
  on. The 0.5 A (CAM 1 A) limit of each port's switch is unchanged.
- **Ground.** The chip's only ground pin is its centre pad, so four ground vias sit inside that pad.

Not proven until a board is built: the 25 MHz oscillator (the datasheet shows the circuit but not the crystal's
load value; a 12 pF crystal was chosen) and the soldering of the centre pad over its four vias.

**A wrong part number found and fixed on the way.** tscircuit remembers the JLC part it picked by a part's name,
not its value. Two resistors in the stop loop had kept their old parts after their values were changed on
2026-12-01: RESTSRC was listed with a 1 kΩ part (design 330 Ω) and RESTPD with a 10 kΩ part (design 2.2 kΩ).
Version 1.0.20 was published with that. The loop would still have worked, at 0.3 mA instead of 1.3 mA. Both now
carry the right parts, and `tools/bom-value-check.py` checks every resistor and capacitor before a push.

**One value corrected afterwards, from the chip maker's own evaluation board** (CH338EVT.ZIP, board CH338F-R0-1v1):
the resistor that switches the hub's own USB-PD function off (RHUBPD) is 5.1 kΩ there; the datasheet drawing says
10 kΩ, which can leave the pin 0.03 V above the level the chip is sure to read as low. It is 5.1 kΩ now (C25905,
a part the board already used). Same pads, no copper change, same cost. The evaluation board also confirmed the
crystal circuit and the crystal size.

**Still open** from section 6: the supervisors (2 × STM32G0B1, $10.81) are the largest remaining cost. The project
owner decided not to change them for now.