3

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?

JRE
  • 67,678
  • 8
  • 104
  • 179
Rinaldo Jonathan
  • 185
  • 2
  • 10
  • 1
    A 1N4148 is a very common part. You could use DigiKey Part # 1N4148FS-ND. – Charles H Apr 30 '19 at 18:01
  • @CharlesH I was trying to avoid buying online. finding one that sells locally returns nothing. I was trying to imagine what will happen if I don't use that. – Rinaldo Jonathan Apr 30 '19 at 18:03
  • 1
    Looks like a protection diode. If the input polarity is reversed then it prevents the opto-coupler LED from reverse breakdown – Charles H Apr 30 '19 at 18:05
  • 3
    @RinaldoJonathan Any standard silicon signal diode or rectifier diode ought to work. A 1N400x, 1N4148, whatever. It shouldn't matter unless you use something really strange. – Hearth Apr 30 '19 at 18:05
  • @CharlesH what is the worst case that can happen if I accidentally plugged in backwards? Also since MIDI has its own 5 pin connector ... Don't you think it would never happen? – Rinaldo Jonathan Apr 30 '19 at 18:09
  • Worst case is you fry the optocoupler. It's unlikely but it's not impossible. Accidental connections and shorts can be created during debugging and testing. – Charles H Apr 30 '19 at 18:12
  • @Hearth the sellers said "this is the only diode we have." It is so small I can't even recognize whats written on it. – Rinaldo Jonathan Apr 30 '19 at 18:15
  • @CharlesH I'm okay with fried optocouplers. We have several here. So I can just ignore it, or use red LED like answer below? – Rinaldo Jonathan Apr 30 '19 at 18:17
  • 1
    @RinaldoJonathan If you don't have local sellers who can offer you the part you need, you might just have to give up on getting it locally. Transistor has a point, though; you could just use an LED. Or the base-emitter junction of a BJT, for that matter. Or base-collector, it doesn't matter for this purpose. PN junctions are everywhere. – Hearth Apr 30 '19 at 18:19
  • 1
    You may need the diode to protect against ESD and surges, as this is an external connection. – scorpdaddy Apr 30 '19 at 18:27
  • FWIW I built a five way MIDI splitter about 8 years ago that does not have any protection diodes and it still works great. 6N137 optos, I think. –  Apr 30 '19 at 22:50

1 Answers1

12

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:

Transistor
  • 168,990
  • 12
  • 186
  • 385