The box that switches the Topping D10s between the MacBook Pro (USB 1) and the PC (USB 2). A USB-C switch board out of its case does the switching; an ESP32-S3 presses its SELECT button through a PC817, reads the selected port from the board's own port LEDs, and shows it on the OLED. The front button switches; held 2 s it turns the screen off. ESP32-S3-N16R8 dev board (U.FL antenna), shown from the component side with the USB-C ports at the top; pin names are the board's printed labels, and positions count down each header from the USB end.
Board
SELECT through the PC817
A 150 ms pulse on pin 4 lights the PC817's LED; its transistor then shorts SW1's signal pad to the switch board's ground, as pressing SW1 does. It can only pull that line down, never drive it, whatever pin 4 does.
Board pins
Pin
Header
Connects to
GND
left 1
GND rail: OLED GND, FILN C and −, PC817 pins 2 and 3, J2 GND
19
left 3
USB-B breakout D−
20
left 4
USB-B breakout D+
39
left 14
470 Ω → FILN LED +
40
left 15
FILN switch NO
2
left 18
10 kΩ ← port ② LED (PC2) wire, read as analog
1
left 19
10 kΩ ← port ① LED (PC1) wire, read as analog
GND
right 1
USB-B breakout GND
5Vin
right 2
USB-B breakout 5V
14
right 3
OLED DC
13
right 4
OLED RES
12
right 5
OLED SCL
11
right 6
OLED SDA
10
right 7
OLED CS
4
right 19
1 kΩ → PC817 pin 1
3V3
right 21
OLED VCC
SH1122 OLED
Pin
Connects to
GND
GND rail
VCC
3V3 (right 21)
SCL
12 (right 5)
SDA
11 (right 6)
RES
13 (right 4)
DC
14 (right 3)
CS
10 (right 7)
FILN button
Wire
Function
Connects to
NO
Switch
40 (left 15)
C
Switch common
GND rail
+
LED
470 Ω → 39 (left 14)
−
LED
GND rail
Switch board
Point
What it is
Connects to
PC1 LED pad
Lit while port ① is selected
10 kΩ → 1 (left 19)
PC2 LED pad
Lit while port ② is selected
10 kΩ → 2 (left 18)
SW1 signal pad
SELECT button (3.3 V side)
PC817 pin 4
J2 GND
Board ground
GND rail and PC817 pin 3
J1 (DC5V)
Power
Unused: the board runs on the computers' USB power
J8 (C-OUT)
The D10s
USB-C to USB-B cable, out through the rear notch
USB-B breakout
Pin
Connects to
5V
5Vin (right 2)
GND
GND (right 1)
D−
19 (left 3)
D+
20 (left 4)
Resistors
Value
Between
470 Ω
Pin 39 (left 14) and the FILN LED +
1 kΩ
Pin 4 (right 19) and PC817 pin 1
10 kΩ
The PC1 LED wire and pin 1 (left 19)
10 kΩ
The PC2 LED wire and pin 2 (left 18)
The switch board's J2 header shows the selected port only while one input has a computer: with both connected its pins all sit high, so the port is read from the PC1 and PC2 LEDs instead, as analog (a wire on an LED's pad reads about 2.3–3.3 V lit, 0 V unlit). The Mac connects through a USB-C → USB-A adapter and a USB-A to USB-C cable, the PC through a USB-A to USB-C cable; the D10s's cable leaves through a notch in the rear panel's bottom edge, under the antenna. Firmware: esphome/office-usb-switch.yaml; build notes: esphome/docs/office-usb-switch-build.md; panels: hammond-enclosure-panels/1455R1601BK/pla/usb-switch/.