MIDI Adapter
There are two sockets, 6.35mm and 3.5mm, wired in parallel. They're mechanically exclusive: plugging into the 6.35mm disconnects the 3.5mm. You can plug in one of these 3 things:
- MIDI - TRS MIDI, type A or type B
- Expression pedal - a passive potentiometer pedal
- Footswitch - a simple contact closure, latching or momentary
It's unidirectional - there is no MIDI OUT.
Supports TRS-A or TRS-B
TRS MIDI comes in two flavours which swap tip and ring, and getting it wrong usually means nothing works and nobody knows why. Here the input goes through a diode bridge before the optocoupler so the current loop is always rectified and both A and B modes "just work".
Also supports analog inputs
There's an analog switch between the jack and the rest of the circuit. In MIDI mode it routes tip and ring to the optocoupler; in pedal or footswitch mode it routes them to a pair of ADC pins on the MCU instead. The MIDI path is the default state (set with a pull-down).
No auto-detect
The mode is chosen by you and stored in flash. I did think about detecting what's plugged in, but an open footswitch is electrically identical to an empty jack, and an expression pedal needs a calibration sweep anyway - so both non-MIDI modes need you to do something whatever the detection says. Guessing would just be unreliable.
Not an audio input
The 6.35mm socket takes an ordinary guitar cable, which invites plugging it into things it shouldn't be plugged into. Don't connect anything that drives it above about 5 volts - no amplifier, line or speaker outputs, no power supplies. The input is clamped, but the clamps are sized for ESD and plug-in transients, not a sustained fault from something mains powered.
It's also not galvanically isolated. Both sleeves are tied to ground; the optocoupler gives common-mode rejection but won't break a ground loop the way a conventional DIN MIDI input does.
Firmware
The MCU is a WCH CH32V203 running TinyUSB. Configuration uses the same SysEx protocol as the Tiny MIDI Knob, so the configurator at midiadapter.com is the same web app, talking Web MIDI. Settings (mode, CC number, calibration, thresholds) live in flash and survive firmware updates.
Schematic

PCB
4 layer board, 45 x 30mm.
Front

Back
