Ghost Fader

USB-MIDI-controlled volume and pan for two balanced ¼″ line channels. Balanced in, always-balanced out, one input becomes stereo automatically. Bus-powered XIAO RP2040 plus a 2×2 gain matrix of PGA2310 attenuators.

Sheet set
0 block · 1 input · 2 matrix · 3 output · 4 control · 5 power · 6 board link (stack) · full KiCad schematic
Revision
D · 2026-10-18 · USB only · audio ground isolated from USB · two-board stack layout added
Signal level
+4 dBu nominal, +22 dBu peak
Rails
USB 5 V → isolated ±12 V analog → 5 V logic (78L05) · 3.3 V XIAO, USB side
Inputs2 × ¼″ TRS, balanced or unbalanced, 48 kΩ differential
Outputs2 × ¼″ TRS, cross-coupled balanced, tolerates TS loads
Gain range+31.5 dB to −95.5 dB in 0.5 dB steps, hard mute
ControlUSB MIDI, class-compliant, channel set by DIP switch
Mono → stereoJack switch detects a missing R plug; firmware pans the L signal
PowerUSB bus power only, ≈ 0.3 A at 5 V. No DC jack, no wall adapter, one cable does everything
GroundAudio ground floats from the computer: ISO7762F on the control lines, isolated DC-DC for power, a 2 mm gap in the pours
Sheet 0 · How it works

Each input goes through a differential line receiver that turns the balanced pair into a clean single-ended signal and rejects cable noise. A plain TS plug just grounds the cold side, so unbalanced sources work with no switch. From there the two signals feed four digitally controlled attenuators arranged as a 2×2 matrix: any input can reach either output at any level. Two op-amp summers add the contributions, and cross-coupled balanced drivers put a true balanced signal on each output jack.

The XIAO RP2040 shows up on the computer as a class-compliant USB MIDI device, works out four gains from volume, pan, and whether the R jack has a plug in it, and writes them over SPI. Because pan and mono-to-stereo are just numbers in the matrix, there is no analog routing switch, no relay click, and a stereo source can be balanced or genuinely image-shifted. The same USB cable powers the box: an isolated DC-DC module turns the 5 V bus into the ±12 V analog rails. Nothing else crosses from the USB side to the audio side: the four control lines and two plug-sense lines go through a digital isolator, and the PGA logic supply is made on the audio side from +12 V. So the audio ground follows the gear plugged into the jacks, the way a transformer-isolated DI does, and the computer's ground noise stays in the computer.

J1 L IN ¼″ TRS, switched J2 R IN ¼″ TRS, switched U1 THAT 1246 bal → single, −6 dB U2 THAT 1246 bal → single, −6 dB U3 + U4 PGA2310 2×2 gain matrix 4 gains, 0.5 dB steps zero-cross switching U5 Σ OPA1642 sum L, sum R U6 THAT 1646 single → bal, +6 dB U7 THAT 1646 single → bal, +6 dB J3 L OUT ¼″ TRS J4 R OUT ¼″ TRS balanced single-ended 4 weighted single-ended balanced USB from computer MIDI + 5 V bus power one cable U9 XIAO RP2040 USB MIDI device, computes 4 gains + mute class-compliant MIDI 5 V, under 0.5 A U8 ISO7762F isolator, 4 out 2 back SPI gain words, /MUTE plug sense, back through U8 5V pin = USB 5 V PS1 ±12 V isolated DC-DC → analog stages +12 V → U10 78L05 → +5 V PGA logic audio ground; USB ground stops at PS1 and U8
audiocontrolpowerplug sense
Block diagram. Audio stays analog end to end; the XIAO only sets gains. The computer's USB port supplies both MIDI and power; PS1 regenerates clean, isolated ±12 V rails from the noisy 5 V bus, and U8 isolates the control lines, so the audio side has no copper path to the computer at all.

Why these parts

  • PGA2310, not a digital pot. Digital pots run on 5 V and clip around 1.5 V peak. The PGA2310 runs on up to ±12 V (±12 V here), handles over 7 Vrms, steps in 0.5 dB, and changes gain only at zero crossings, so there is no zipper noise. Its logic inputs are driven at 5 V by the isolator's outputs.
  • THAT 1246 / 1646 pair. The receiver drops 6 dB and the driver adds it back, so balanced-to-balanced is unity gain and the PGA sees a signal that fits comfortably. The 1646 is cross-coupled, so a TS plug on an output still gets the full signal instead of half.
  • Isolated audio ground. PS1 already isolates the rails; U8, a six-channel digital isolator with fail-safe-low outputs, isolates the four control lines and the two plug-sense lines, and U10 makes the PGA's 5 V from +12 V. The pours are split with a 2 mm gap, bridged only by a 1 nF cap (a local return for the converter's switching noise) and 1 MΩ (so the audio side cannot drift). That removes the hum loop between a computer and separately earthed audio gear, and keeps the computer's ground noise out, for about $6.
  • Matrix instead of a routing switch. Four gains cost one extra PGA2310 but remove every analog switch, and they make mono-to-stereo, balance, true pan and mono-sum pure firmware.

Cost-down option

If cross-feed and mono-sum do not matter, drop U4 and the summers and put a DG419 analog switch in front of the second PGA channel: it picks the R receiver when a plug is present and the L receiver when it is not. That saves roughly $18 and one op-amp, at the cost of a small click on plug insertion unless firmware mutes around it.

Pin numbering

Sheets 1 to 5 are the readable overview: IC pins are labelled by function and bypass caps are not drawn. The full KiCad schematic further down has datasheet pin numbers, every bypass cap, the 1646 sense caps and the ERC-checked netlist, and is the one to lay a board out from.

Sheet 1 · Input receiver, one of two
J1 L IN · ¼″ TRS jack with tip and ring switching contacts Neutrik NRJ6HF S sleeve T tip R ring TN RN C1 100p C2 100p R1 100k +5VA SENSE_L → XIAO D0 U1 THAT 1246 IN+ IN− REF OUT SENSE −6 dB +12 V −12 V C3 10µ NP L_SE → sheet 2
Balanced receiver with plug sense. A TS plug shorts ring to sleeve, so the receiver simply sees tip against ground. Unplugged, the ring spring rests on RN and the receiver's 24 kΩ input pulls the sense line low; any plug lifts it and R1 pulls the line high. TN grounds the idle tip. Channel R (J2, U2, C4–C6, R14) is identical, sense goes to XIAO D1, and its output is net R_SE.
Sheet 2 · Gain matrix and summers
L_SE R_SE U3 PGA2310 · direct paths (a: L→L, d: R→R) AINL AINR SDI SCLK /CS /MUTE ZCEN AOUTL AOUTR SDO VA+ +12 V · VA− −12 V VD +5VA · AGND · DGND MOSI (T11) SCK (T13) CS (T10) MUTE (T9) +5VA → U4 SDI U4 PGA2310 · cross paths (c: L→R, b: R→L) AINL AINR SDI SCLK /CS /MUTE ZCEN AOUTL AOUTR SDO VA+ +12 V · VA− −12 V VD +5VA · AGND · DGND ← U3 SDO SCK (T13) CS (T10) MUTE (T9) +5VA NC R2 10k R3 10k R4 10k R5 10k L node R node + − U5A R7 10k R6 10k L_SUM → sheet 3 + − U5B R9 10k R8 10k R_SUM → sheet 3 U5 = OPA1642 dual, ±12 V gain 2 restores the passive ½ from the 10 k pair
2×2 matrix. Each receiver drives two 10 kΩ PGA inputs; each summer takes one direct and one cross path. The non-inverting summer keeps absolute polarity. Dots are junctions; crossings without dots do not connect. The XIAO clocks 32 bits per update: U4's word first, then U3's.
GainChip · channelTakesFeedsStereo (R plugged)Mono (R empty)
aU3 · LL_SEL_SUMvol × balance-leftvol × cos θ
dU3 · RR_SER_SUMvol × balance-rightmute
cU4 · LL_SER_SUMmutevol × sin θ
bU4 · RR_SEL_SUMmutemute
Sheet 3 · Balanced output driver, one of two
L_SUM U6 THAT 1646 IN GND OUT+ SENSE+ SENSE− OUT− +12 V −12 V R10 10Ω R11 10Ω C7 100p C8 100p T tip (+) S sleeve R ring (−) J3 L OUT ¼″ TRS
Cross-coupled balanced output. If a TS cable grounds the ring, the 1646 senses it and doubles the tip drive, so an unbalanced destination still receives the full level. Channel R (U7, J4, R12, R13, C9, C10) is identical and takes R_SUM.
Sheet 4 · XIAO, USB, switches
USB from the computer MIDI in and 5 V bus power on one cable USB 2.0 port: 500 mA · USB 3 / USB-C: 900 mA or more D+ / D− / 5 V / GND XIAO USB-C U9 XIAO RP2040 MIDI arrives over USB, no serial MIDI port used USB ground (GND_USB) D0 D1 5V GND 3V3 SENSE_L ← U8 ← J1 RN SENSE_R ← U8 ← J2 RN USB 5 V out → sheet 5 5V pin is USB VBUS GND_USB +3.3 V → U8 side 1 D8 SCK D10 MOSI D7 CS D6 MUTE D2 D3 D4 D5 D9 LED U8 ISO7762F USB audio 3.3 V side · +5VA side → U3, U4 SCLK → U3 SDI → U3, U4 /CS → U3, U4 /MUTE R15 10k audio GND E, F carry SENSE_L/R back to D0, D1 SW1 DIP ×4 MIDI ch pull-ups on GND_USB R16 1k LED1 GND_USB
Control. The XIAO's own USB-C connector is the only port: MIDI comes in as a class-compliant USB device and the bus 5 V leaves through the 5V pin. Everything on the XIAO is on the USB ground; the four control lines cross to the audio ground through U8, and the two plug-sense lines come back the same way. U8 is the F (fail-safe low) part, so with the XIAO unpowered its outputs sit low and the PGAs stay muted; R15 does the same job on the audio side until the firmware has written its first gains, which kills the power-on thump. DIP switch bits use the XIAO's internal pull-ups; closed = 0.
XIAO RP2040 power and firmware. The 5V pin is USB VBUS straight through (only the module's own 3.3 V regulator sits behind a diode), so it carries the bus 5 V out to the rest of the board, which is exactly what sheet 5 needs. The Philhower RP2040 Arduino core with Adafruit TinyUSB gives class-compliant USB MIDI. The PGA frame is 32 bits a few times a second, so bit-bang it on D8 / D10; that leaves D9, the hardware MISO pin, free for the LED. Nothing ever comes back from the PGAs. U8's side 1 runs from the XIAO's 3V3 pin, not from 5 V: the RP2040 pins are not 5 V tolerant, and the two sense lines come back toward them.
Sheet 5 · Power
XIAO 5V = USB 5 V (sheet 4) FB1 ferrite GND_USB = XIAO ground (sheet 4) C11 47µ GND_USB PS1 TBA 2-0522 +Vin −Vin +Vo COM −Vo L1 10µ +12 V C12 100µ ∥ 100n audio star ground L2 10µ −12 V C13 100µ ∥ 100n U10 78L05 +5VA → U3, U4 VD, ZCEN · U8 side 2 · R1, R14 audio ground, never references USB Ground barrier the only link between GND_USB and GND GND_USB C45 1n R17 1M GND (audio) C14 10µ
Power. Everything runs from the USB 5 V that the XIAO passes out on its 5V pin. There is no external power supply: PS1 is a small 2 W DC-DC converter soldered to the board, and its only input is that USB 5 V. PS1 is an isolated module, so the analog rails are regenerated rather than filtered from the bus. It is unregulated, so the rails sit between about ±11 and ±14 V depending on the port and the load; that is why the ±12 V part is used and not the ±15 V one, whose light-load rise would pass the PGA2310's 16 V limit. U10 makes +5VA from +12 V for the PGA logic and U8's audio side. Audio grounds meet once, at PS1's COM pin; the XIAO's ground (GND_USB) never touches them, its only links being C45 and R17 across the 2 mm gap in the pours. Keep PS1 at the far end of the board from the input receivers.

USB power budget

LoadCurrent at 5 VNote
XIAO RP2040, U8 side 1≈ 35 mARP2040 at 133 MHz plus its regulator; the isolator's USB side
PS1 supplying ≈ 55 mA on +12 V and ≈ 40 mA on −12 V≈ 230 mATHAT parts, two PGA2310, OPA2134, plus U10 (PGA logic, U8 side 2); module about 80 % efficient
LED≈ 2 mA
Total≈ 265 mA typical · ≈ 330 mA worst caseUSB 2.0 port allows 500 mA; USB 3 / USB-C ports allow 900 mA or more

So yes, bus power works, with two conditions:

  • Plug into a real port or a powered hub. An unpowered hub shares one 500 mA allowance across every device on it, and a laptop running on battery may throttle its ports.
  • The audio ground floats from the computer. PS1 isolates the rails and U8 isolates every control line, so the box's audio ground meets the computer's ground only through C45 (1 nF) and R17 (1 MΩ). Plug the synths into a separately earthed mixer while the computer only sends MIDI and there is no hum loop to close; the USB port's switching noise stays on its own side of the gap. One mechanical condition: the XIAO's USB-C shell is on the USB ground, so it must not touch the metal box. Give it a clearance cutout or a plastic bezel, and bond the box to the audio ground (a wire to the PS1 COM pad; the NRJ6HF bushings are plastic).
Full schematic · KiCad 9

The complete, layout-ready schematic: datasheet pin numbers on every IC, every bypass and bulk cap, the 1646 sense caps, build-outs and RF caps, all as a five-sheet hierarchical KiCad 9 project (a second root adds sheet 6 for the two-board stack). Inter-sheet nets are global labels; rails are power symbols. It passes ERC with zero violations, and the exported netlist was checked pin-for-pin against an independently written connectivity list (61 nets, 263 pins).

Sheet 1: balanced inputs. J1 and J2 TRS jacks with 100 pF RF caps into THAT 1246 receivers U1 and U2; ring-normal contacts pulled up by R1 and R14 as plug sense.
Sheet 1 · Balanced inputs. J1/J2 → U1/U2 THAT 1246. Tip-normal grounded, ring-normal is the plug sense with a 100 kΩ pull-up to +5VA (100 k, not 1 M: U8's inputs leak up to 10 µA). Outputs leave as L_SE and R_SE.
Sheet 2: two PGA2310 volume controls U3 and U4 forming a 2 by 2 matrix, coupling caps C3 to C6, 10 k mix resistors and OPA2134 non-inverting summers U5A and U5B.
Sheet 2 · Matrix and summers. U3 carries the direct paths, U4 the cross paths. SPI chain XIAO D10 → U3 SDI, U3 SDO → U4 SDI. R2/R3 and R6/R7 mix into U5A/U5B, ×2 non-inverting.
Sheet 3: THAT 1646 drivers U6 and U7 with 10 µF sense caps, 10 ohm build-out resistors and 100 pF RF caps into output jacks J3 and J4.
Sheet 3 · Balanced outputs. U6/U7 THAT 1646 with sense caps C17–C20, build-outs R10–R13, RF caps, jacks J3/J4.
Sheet 4: XIAO RP2040 with DIP switch SW1 on D2 to D5, plug sense on D0 and D1, SPI on D7, D8, D10 and mute on D6, all through the ISO7762F isolator U8, with pull-down R15 on the audio side and activity LED on D9.
Sheet 4 · Control. XIAO pins are numbered 1–14 as on Seeed's footprint: 1–7 down the left row from the USB end, 8–14 up the right. The 5V pin exports the USB 5 V to sheet 5; 3V3 feeds U8's side 1. The MCU_ nets are the USB side of U8, the plain names its audio side. GND_USB is the USB ground.
Sheet 5: USB 5 V through ferrite bead FB1 and 47 µF C11 into TBA 2-0522 isolated DC-DC PS1, giving plus and minus 12 V through L1, L2 and 100 µF caps; a 78L05 U10 makes +5VA from +12 V; C45 and R17 bridge GND_USB to GND.
Sheet 5 · Power. No external supply. USB 5 V → FB1 → PS1 (board-mounted isolated DC-DC) → ±12 V → U10 → +5VA. Audio star ground at PS1 Common; the ground barrier C45 / R17 beside it.
Sheet 6: two 2 by 6 box headers J5 and J6 on the same twelve nets: the plus and minus 12 V and +5VA rails with grounds, SCLK, SDI, CS, MUTE and the two plug-sense lines.
Sheet 6 · Board link (two-board stack only). J5 on the main board and J6 on the control board, joined pin for pin by a 12-way ribbon. Lives in the second root ghost-fader-stack.kicad_sch, which shares sheets 1 to 5; PDF of that root.
Footprints. Every part has one. The jacks use KiCad's stock Neutrik NRJ6HF horizontal footprint (pad names T, R, S, TN, RN, SN match the symbol). The XIAO RP2040 footprint (2 × 7 header pins on 0.6 in rows) is in the project library, drawn to Seeed's published dimensions; the TBA 2, the ISO7762F (SOIC-16 wide) and the 78L05 (TO-92) use KiCad's stock footprints. The symbol library and the generator script that produced the schematic live in hardware/kicad/.
PCB layout · 2 layers, 108 × 80 mm

A routed board that fits the Hammond 1590BB. Jacks along the rear edge with their noses 1.5 mm past the board so the panel nuts have thread; XIAO USB-C flush with the front edge; DC-DC converter and rail filters front-centre, the far corner from the input receivers; every decoupling cap within a few millimetres of its pin. The front-left corner is the USB ground island: XIAO, DIP switch, LED, ferrite, reservoir cap, the USB half of U8 and the input half of PS1. Two ground pours on both layers, USB and audio, with a 2 mm copper-free gap between them that a rule area keeps the router out of; U8 lies across the island's top edge and PS1 across its right edge, and the barrier parts C45 and R17 straddle the gap in the left column. Each pour sits over the ground tracks the router laid first, so the schematic's audio star point becomes a plane. Power tracks are 0.6 mm, signals 0.3 mm, clearance 0.25 mm. The corners are notched 7.5 × 6.5 mm to clear the box's lid-screw bosses, and the board hangs on the four jack nuts. DRC is clean against the schematic. Placement is a table in tools/build_pcb.py; routing is Freerouting via tools/route.py.

Top of the bare Ghost Fader board, silkscreen and pads only: four Neutrik jacks along the rear edge, THAT 1246 receivers below the input jacks, two PGA2310 DIPs side by side in the middle, OPA2134 and THAT 1646 drivers on the right, XIAO RP2040 front-left, TBA 2 DC-DC and filters front-centre.
Top, bare board as fabricated. J1–J4 rear edge, U1/U2 receivers, C3–C6 coupling into U3/U4, U5 summer, U6/U7 drivers, U9 XIAO front-left with USB-C at the edge, PS1 and rail filters front-centre.
Bottom of the Ghost Fader board, mirrored: ground pour with routed tracks and jack labels IN L, IN R, OUT L, OUT R.
Bottom. Ground pour and the rest of the routing. Jack labels read correctly from the back.
Before ordering. Check the board against your box: the 1590BB is about 112 × 86 mm inside at the base and the lid-screw bosses sit on 103.5 × 78 mm centres, which the notches are sized for. Drill the rear wall on the jack centres (19, 39, 68, 90 mm from the board's left edge) and slot the front wall for the USB-C plug with clearance all round: the connector shell is on the USB ground and must not touch the box. Bond the box to the audio ground with a wire to the PS1 COM pad. LED1 is a 3 mm through-hole part on the left edge near the front corner: bend it out through the left wall, or toward the front panel, or use a light pipe.
Narrow in-line PCB · 2 layers, 207 × 38 mm

A second, independent board for the same schematic, shaped for a signal chain: inputs on the right end, outputs on the left, USB out of the middle of the rear edge. It is as narrow as two jacks side by side allow (18 mm pitch) plus a little edge clearance; the XIAO lies across the board with its USB-C at the rear edge. It wants a 3D-printed box, about 40 × 210 mm inside with a ledge under the long edges; the four jack nuts hold the board. Parts run in columns along the length: drivers and summer behind the output jacks, the two PGA2310s stacked across the board with their SPI rows facing each other, the isolator, XIAO and switch, DC-DC, 78L05 and filters, receivers behind the input jacks. The USB ground island is a pocket on the rear edge under the XIAO (x 104–141 mm, 29 mm deep); the audio ground wraps under it so the rails and audio can pass from end to end, U8 straddles the pocket's left wall and PS1 its right wall. Same rules as the main board, DRC clean against the schematic. Placement is a table in tools/build_pcb_narrow.py. The 1590BB board above is unchanged.

Top of the bare narrow Ghost Fader board, 207 by 38 mm: output jacks stacked on the left end, drivers and summer, two PGA2310 DIPs stacked across the board, XIAO RP2040 across the board with USB-C at the rear edge, DIP switch, DC-DC and filters, receivers, input jacks stacked on the right end.
Top, bare board. J3/J4 out on the left end, U6/U7 and U5, U3/U4 stacked, U9 XIAO across the board with USB-C at the rear edge, SW1, PS1 and filters, U1/U2, J1/J2 in on the right end.
Bottom of the narrow Ghost Fader board, mirrored: ground pour with routed tracks and jack labels.
Bottom. Ground pour and the rest of the routing.
Box. Drill each end wall on the jack centres, 10 and 28 mm from the board's rear edge, at the NRJ6HF bushing height, and slot the rear wall for the USB-C plug (clearance all round, the shell is on the USB ground) with a 3 mm LED hole 107 mm from the left end. Parts come within 1 mm of the long edges, so keep the walls clear above the board.
Two-board stack · main 150 × 38 mm + control 75 × 38 mm

The narrow board is long because everything sits in one row. This layout splits the same circuit over two boards, one above the other, so the in-line box drops from 207 to 150 mm and the jacks are 57 mm closer together. The main board carries the jacks and the whole audio path: output jacks, drivers and summer, coupling caps, the two PGA2310s stacked across the board, the link header J5 with the plug-sense pull-ups under it, the receivers, the ±12 V bulk caps and the input jacks. It is all audio ground, one pour per layer, no split. The control board sits on four M3 × 15 mm standoffs above it, rear edges flush, its left end 59 mm from the output end: XIAO with its USB-C at the rear edge, LED, DIP switch, ferrite and reservoir, the isolator U8, the DC-DC PS1, the 78L05 and rail filters, and J6. It carries the whole ground barrier, the USB island being its left 37.5 mm with U8, PS1, C45 and R17 straddling the 2 mm gap as on the other boards. A 12-way IDC ribbon about 50 mm long joins J5 and J6 pin for pin (sheet 6): rails and grounds, the four isolated control lines and the two sense lines, all on the audio side of the barrier. Both boards are routed and DRC clean, parity checked against the stack schematic, and the gap check passes. Placement for both is one table in tools/build_pcb_stack.py; the other two boards are unchanged.

Top of the bare main board of the two-board stack, 150 by 38 mm: output jacks on the left end, THAT 1646 drivers and OPA2134 summer, coupling caps, two PGA2310 DIPs stacked across the board, the 2 by 6 link header J5 with R1 and R14 under it, THAT 1246 receivers, three bulk caps between two standoff holes, input jacks on the right end.
Main board, top. J3/J4 out on the left, U6/U7 and U5, C3–C6, U3/U4, J5 with R14/R1 under it, U1/U2, C42/C41/C43, J1/J2 in on the right. The four dark rings are the standoff holes with their copper keepouts.
Bottom of the main board of the two-board stack, mirrored: one ground pour with the routed tracks and jack labels.
Main board, bottom. One audio ground pour; no split on this board.
Top of the bare control board of the two-board stack, 75 by 38 mm: XIAO RP2040 with USB-C at the rear edge, LED, DIP switch, reservoir cap and ferrite on the USB ground island at the left, the ISO7762F isolator and TBA 2 DC-DC straddling the vertical gap, rail filters, 78L05 and the 2 by 6 link header J6 on the right.
Control board, top. U9 XIAO, LED1, SW1, C11, FB1 on the island; U8 and PS1 across the gap with C45 above and R17 below; L1/L2, C12/C13, U10 and J6 on the audio side.
Bottom of the control board of the two-board stack, mirrored: USB ground pour on one side of the gap, audio ground pour on the other.
Control board, bottom. The two pours and the 2 mm gap between them.
Box. About 40 × 152 mm inside and 32 mm tall: the same end-wall jack holes and board ledge as the narrow box, the USB-C slot and the 3 mm LED hole in the rear wall 16.6 mm higher (LED 32.9 mm from the control board's left end, which is 59 mm from the output end), the DIP switch under the lid. Main-board standoff holes at (67, 3.8), (67, 34), (119.25, 3.8), (119.25, 34) mm from the output end and the rear edge; 15 mm standoffs clear the 11 mm radial caps.
Level budget
Point in chainNominalPeakLimit there
Balanced input+4 dBu · 1.23 Vrms+22 dBu · 9.8 VrmsTHAT 1246 common-mode ±10 V on ±12 V rails
After U1 (−6 dB)0.61 Vrms4.9 VrmsPGA2310 full scale about 7.4 Vrms on ±12 V, so 3.6 dB spare at peak
After summer (×2 on a ½ divider)0.61 Vrms4.9 VrmsOPA1642 swings ±10 V
Balanced output (+6 dB differential)+4 dBu+22 dBuTHAT 1646 clips near +22 dBu on ±12 V (+24 on ±15), the tightest point in the chain
Unbalanced TS source at 0 dBV0 dBV in → 0 dBV differential outTip-only destination sees −6 dB; use the trim CC

Net gain balanced-in to balanced-out is 0 dB with the PGA at code 192. The PGA can add up to 31.5 dB, so a quiet −10 dBV consumer source can be brought up to line level without touching hardware.

MIDI and firmware map
CCFunctionMapping
7Volume127 = 0 dB, 0 = mute, 40·log10(v/127) dB between
10Pan64 = center. Mono: constant-power pan. Stereo: balance, center is 0 dB both sides
14L input trim±12 dB, 64 = 0 dB (lift unbalanced sources)
15R input trim±12 dB, 64 = 0 dB
85Mono sum≥ 64: both inputs summed at −6 dB each, then panned
120MuteAny value: hard mute via /MUTE pin
XIAO pinSignalGoes to
USB-CMIDI in, 5 V inhost computer
5VUSB 5 V outFB1, PS1
3V33.3 V outU8 side 1
D0, D1 · GP26, GP27SENSE_L, SENSE_RJ1, J2 ring-normal, through U8
D2–D5 · GP28, GP29, GP6, GP7MIDI channelSW1, INPUT_PULLUP
D9 · GP4Activity LEDR16, LED1
D6 · GP0/MUTEU3, U4, through U8
D7 · GP1/CSU3, U4, through U8
D10 · GP3 · MOSISDIU3 (chains to U4), through U8
D8 · GP2 · SCKSCLKU3, U4, through U8

Gain code per PGA channel is N = 192 + 2·dB, clamped to 0–255, with 0 meaning mute. Each PGA takes a 16-bit word, right channel byte first. With two chips daisy-chained the XIAO sends U4's word, then U3's, in one chip-select frame:

// a,d live in U3 (L,R); c,b live in U4 (L,R)
uint8_t code(float dB){ if (dB < -95.5f) return 0; return (uint8_t)constrain(192 + 2*dB, 1, 255); }

void writeMatrix(float a, float b, float c, float d){
  SPI.beginTransaction(SPISettings(1000000, MSBFIRST, SPI_MODE0));
  digitalWrite(CS, LOW);
  SPI.transfer(code(b)); SPI.transfer(code(c));   // U4: R byte, then L byte  (shifts through to U4)
  SPI.transfer(code(d)); SPI.transfer(code(a));   // U3: R byte, then L byte
  digitalWrite(CS, HIGH);
  SPI.endTransaction();
}

// mono mode: theta = pan/127 * PI/2;  a = vol*cos(theta); c = vol*sin(theta); b = d = mute
Parts list
RefQtyPartDescription≈ $ eaAlternates and notes
Audio
U1, U22THAT 1246S08Balanced line receiver, −6 dB, SO-85.50TI INA137UA is drop-in-similar. THAT 1240 (0 dB) if you would rather pad in firmware
U3, U42TI PGA2310PAStereo volume control, ±12 V analog, SPI, DIP-1611.00PGA2310UA is the SOIC-16. Not PGA2311 (±5 V, too little headroom)
U51TI OPA2134PADual JFET audio op-amp, DIP-84.00NE5532P works, slightly more noise. OPA1642 if you go SOIC
U6, U72THAT 1646S08Cross-coupled balanced line driver, +6 dB, SO-85.50TI DRV134UA is the equivalent
J1, J22Neutrik NRJ6HF¼″ TRS PCB jack, horizontal, tip and ring switching contacts3.00Any TRS jack with a ring-normal contact; the switch is the plug sense
J3, J42Neutrik NRJ6HF¼″ TRS PCB jack (switch contacts unused)3.00Same part keeps the panel uniform
C3–C6, C17–C20810 µF non-polarBipolar electrolytic, 25 V. C3–C6 couple into the PGAs; C17–C20 are the THAT 1646 sense caps0.40Nichicon UES / MUSE ES. The sense caps cut output DC offset from 250 mV to 15 mV (1646 datasheet fig. 5)
C1, C2, C7–C10, C15, C168100 pF C0GRF caps at every jack tip and ring0.10Return to chassis / sleeve, shortest path
R2–R9810 kΩ 1%Summing and feedback, metal film0.05Match within a summer for a clean mono sum
R10–R13410 ΩOutput build-out0.05
R1, R142100 kΩPlug-sense pull-ups to +5VA0.05100 k, not 1 M: U8's inputs leak up to 10 µA. Do not enable the XIAO's internal pull-ups on D0, D1
Control
U81TI ISO7762FDWSix-channel digital isolator, 4 forward / 2 reverse, fail-safe low, SOIC-16 wide4.50Must be the F version: the plain ISO7762 defaults high and would unmute the PGAs while the XIAO boots
U91Seeed XIAO RP2040MCU, USB-C, class-compliant USB MIDI via TinyUSB, on header pins5.00Its 5V pin is USB VBUS and feeds the board. The schematic numbers its pins 1–14 as Seeed's footprint does
R15, R16210 kΩ, 1 kΩMute pull-down (audio side), LED series0.05
SW114-way DIP switchMIDI channel 1–160.80
LED113 mm LEDMIDI activity0.15
CABLE1USB A or C to USB-CData cable, not a charge-only cable3.00Short and thick keeps the 5 V drop small
Power
PS11Traco TBA 2-0522Board-mounted isolated DC-DC, 4.5–5.5 V in, ±12 V 80 mA out, 2 W, unregulated, SIP-75.00Fed from USB 5 V; not an external supply. Any industry-standard SIP-7 2 W ±12 V module (Mornsun B0512, RECOM RB-0512D) has the same pinout. Not a ±15 V part: its light-load rise would pass the PGA2310's 16 V limit. Budget ≈ 55 mA on +12 V, 40 mA on −12 V. Its 1.5 kV isolation is the power half of the ground barrier
U101L78L055 V 100 mA linear regulator, TO-92, from +12 V0.30Makes +5VA on the audio side for the PGA logic and U8 side 2, about 15 mA, 0.15 W
FB11Ferrite bead, 600 Ω @ 100 MHz, ≥ 1 AKeeps converter switching noise off the USB line0.20
L1, L2210 µH, ≥300 mARail filter inductors0.40
C11147 µF 10 V low-ESRUSB-side reservoir for PS10.25Keep it modest; USB frowns on big inrush
C12, C132100 µF 25 V±12 V rail filters0.25
C14110 µF+5VA logic rail0.10
C21–C39, C4420100 nF X7ROne at every supply pin of U1–U7; C37/C38 at U10 in and out; C39 on U8 VCC1, C44 on U8 VCC20.05Within 5 mm of the pin
C4511 nF 1 kV ceramicGround barrier: GND to GND_USB0.15Straddles the pour gap next to PS1. Gives the converter's switching current a local return
R1711 MΩGround barrier bleed: GND to GND_USB0.05Straddles the pour gap. Keeps the audio side from floating away with nothing plugged in
C40–C43410 µF 25 V±12 V bulk, one pair at the input end and one at the output end0.10
Two-board stack only
J5, J622 × 6 shrouded box header, 2.54 mmBoard link, one per board0.30Stock KiCad IDC-Header_2x06 footprint
RIBBON112-way IDC ribbon, ~50 mmJ5 to J6, pin for pin1.502 × 6 sockets both ends
STANDOFF4M3 × 15 mm, 8 screwsControl board above the main board1.50Metal is fine: the holes sit in copper keepouts
Mechanical
ENC1Hammond 1590BBDie-cast aluminium, 119 × 94 × 34 mm12.001590DD if you want a hand-solderable spread
PCB12-layer, 108 × 80 mmRouted, ground pour both sides, jacks on the rear edge, DC-DC on the far edge; gerbers in the repo10.005 boards from JLCPCB or OSH Park
Estimated total, one unit at single-piece prices≈ 116≈ 106 with the narrow board in a printed box, ≈ 112 for the two-board stack. Cost-down variant (one PGA2310 + DG419): ≈ 96
Build order and checks
  1. Power only. Fit U9, FB1, C11, PS1, U10 with C37/C38, C45, R17 and the filters, nothing else. Plug the USB cable into the computer and confirm roughly +12 / −12 V with a 330 Ω test load on each rail (unregulated: a volt or two high with no load) and +5VA at 5 V. With the cable unplugged, GND to GND_USB should read about 1 MΩ: anything lower means copper bridges the gap. Put an inline USB current meter on the cable: expect well under 350 mA.
  2. XIAO and isolator. Fit U8 with C39/C44. Load a TinyUSB MIDI sketch that blinks LED1 on any MIDI message. Check the box appears as a MIDI device on the computer, that the DIP switch selects the channel, and that toggling D6 shows up on U8 pin 12 as a 5 V swing.
  3. Receivers and drivers. Fit U1, U2, U6, U7 and jacks. Temporarily jumper L_SE to L_SUM: a balanced test tone should come out at unity gain, and a TS plug on the input should still produce a balanced output.
  4. Matrix. Remove the jumper, fit U3, U4, U5. Write code 192 to all four gains and confirm unity, then mute (0) and confirm silence. Change gains while a tone is playing: with ZCEN high there should be no click.
  5. Plug sense. Watch D0 and D1 while inserting TS and TRS plugs; both must read high with any plug and low when empty.