Arduino Nano ESP32 (3.3V) and serial port midi (no USB-MIDI)

Dear Arduino community,

for a simple MIDI controller application I successfully managed to set up a MIDI input and output circuit with an Arduino Micro like this:

Now I would like to migrate to an Arduino Nano ESP32, which has I/O voltage of 3.3V. My question is: What is the correct circuit for this setup?

In this Forum I already saw several answers circulating, which seem to differ from the MMA description. Few observations:

  • MMA recommendation for 3,3V: INPUT is given with PC900V optocoupler. 6N138 is mentioned but not further described. OUTPUT has quite low resistor values of 33 (R7) and 10Ω (R8)
  • (Which is why) it may be recommended to use different values and different optokoppler 4N35. Connections not further explained (MIDI 3.3V circuit - #3 by mirasderbissalin)
  • PJRC published a circuit for their 3.3V boards: Different Diode at MIDI IN, different resistor values… Would this also work with Arduino ESP32?

I am wondering what may be the best solution. Any advice highly appreciated.

Thanks and best wishes
Philip

See 5 Pin DIN Electrical Specs – MIDI.org for the official resistor values for 3.3V logic. Alternatively, use a 5V buffer for the MIDI output and use the standard 5V resistor values.

Thanks @PieterP, I knew I can rely on you.. Actually I already looked at the document, but there were a few confusing posts here and there about the type of optocoupler and resistor values. I now came up with this, which should mainly reflect the midi.org specs:

Still not sure how to calculate R10.. Further hints are welcome

The low values for R11 and R12 seem to be doubted by several members. I wonder if the Nano ESP32 may require different values?

Thanks again
Philip