I found this article:


Zynthian MIDI output

Credits by Zynthian

I like that it has notification LEDS for MIDI in/out/thru.

However, I also notice there are optocouplers for MIDI Out and Thru, while the MIDI electrical spec, page 2/3 only defines an optocoupler for MIDI In.

Is this overprotection or are the additional optocouplers useful?


Optocouplers are used for galvanic isolation. In most cases, this protects against dangerous voltage differences, but in MIDI inputs, it just prevents ground loops.

However, the optocouplers used for the MIDI outputs in the linked schematic do not provide any isolation whatsoever, because the grounds and +5V power supplies are connected together (they are the same). Those optocoupers could be replaced with a simple transistor, or (because no amplification is needed) with a piece of wire.

That schematic is not the work of a competent designer. Ignore it.

  • \$\begingroup\$ Thanks for this info ... and looking at your answer (and the one from Justme), I will ignore it ... using the official circuit except for using H11L1's instead. \$\endgroup\$ Sep 10 '19 at 21:33

The extra two optocouplers seem to be there not for ground isolation purposes - their both sides are ground referenced so they don't block ground loops.

The extra optocouplers just seem to be doing logic level translation, buffering and driving the thru and out connectors. In a rather unconventional way, and not within the required resistance tolerance either. And the outputs are missing the ground pin for the connector shield as well.

The input circuitry leaves quite little current for the optocoupler input - but the higher the visible LED forward voltage is the more current the optocoupler gets. In this case it is designed with a green LED so the optocoupler current is still above the turn-on threshold.

  • \$\begingroup\$ Thanks for the comment, and also about the remark about the LEDs; it seemed like a good idea but if they interfere with the MIDI signal, I will control LEDs with a microcontroller instead (I will use a microcontroller anyway). \$\endgroup\$ Sep 10 '19 at 21:34

If you trust the other guy to put one on his MIDI in, it's over-protection. But - in the real world, it's 10 cents well spent. Ground loops are a big problem in audio systems. MIDI is not particularly high speed, so there is no reason not to do it.

EDIT : as others have pointed out the opto in this schema has nothing to do with isolation. In fact it is not relevant to the MIDI interface at all as it is isolating between the driver and the internal circuit (this is the OUT side).

Take a look at this description of the MIDI interface hardware.

This version is done a bit differently - pin 5 is grounded, pin 4 driven high. It comes to the same thing. But the opto here is for interfacing with the micro, nothing to do with the MIDI wiring. (I didn't look hard enough the first time.)

  • \$\begingroup\$ I imagine ground loops in MIDI would be harder to pin down, as they wouldn't cause the characteristic noises that ground loops in analog audio cause. \$\endgroup\$
    – Hearth
    Sep 10 '19 at 13:02
  • \$\begingroup\$ Thanks for the info. \$\endgroup\$ Sep 10 '19 at 13:05
  • \$\begingroup\$ I had a ground loop issue yesterday, not with a MIDI cable but with a USB cable. In this case it was a nasty high pitched whining, similar to what you get when a microcontroller infects an audio system with digital noise. With MIDI you'd probably get something similar, perhaps getting worse when the song is playing and data is flying around. \$\endgroup\$
    – danmcb
    Sep 10 '19 at 15:07
  • 1
    \$\begingroup\$ 10 cent optocouplers are not suitable for MIDI, and the optocouplers in the question do not prevent ground loops. \$\endgroup\$
    – CL.
    Sep 10 '19 at 20:32
  • 2
    \$\begingroup\$ MIDI is not particularly high speed, but the specification requires bit edges not to distort more than 2 microseconds per device, it basically requires optocouplers capable of about 1Mbit/s signaling through them. \$\endgroup\$
    – Justme
    Sep 10 '19 at 20:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.