Electronic – arduino – Do I really need diodes to receive MIDI

arduinoesp8266midiopto-isolator

enter image description here
enter image description here

All the schematics above use a diode before the receiving pin on the optocouplers. The problem was, I never able to find the exact same diode as the schematics.

Before, I'm using H11L1, but it never worked. Now I have plan to move to 6N138, but I'm afraid I'll meet another problem with this.

The end goal was receiving MIDI with either Arduino or ESP8266. Or is there any easier way?

Best Answer

The diode is there to protect the opto-LED in the event of a reverse polarity connection.

The HF11L datasheet states that the absolute maximum reverse voltage for the emitter (meaning the IR emitter, the LED) is 6 V. Typically a 5 V supply would be used for the MIDI driver but it's worth being careful.

In your case pretty well any diode - including an LED would suffice. A red LED would limit the reverse voltage to < 2 V and would serve as an indication for reverse connection.

For further reading have a look at Failure modes for LEDs and Opto-isolators - intro where I have written a little on the topic.


@CL raises a point that I rarely have to think about as it's not generally a problem in Ireland due to the damp climate: static. A static discharge of the wrong polarity can exceed the maximum reverse voltage by a factor of many thousand. The reverse diode protects the LED from this.

More reading: