# I cannot get opto-coupler H11L1 to work as MIDI Input

I received my H11L1 opto isolators (yeah) to use for my MIDI input(s).

However, I cannot receive anything (and tried various circuits).

According to the H11L1 (see datasheet) an example circuit is:

The red box is the part I expect I made a mistake.

According to the MIDI spec an input should look like

The red part is again the similar part I expect problems with.

The following is a screenshot of my circuit (note I replaced the ferrite beads by cables since I do not have them yet). The two cables on the right go to pin 4 and 5 of the MIDI cable (I also switched them so that is not the problem).

I use 270 ohm and 220 ohm resistors as advised.

Does anybody have an idea what can be wrong?

Update: It's improved if I put an Hex inverter (74HC14) after Vo (open collector output). The test LED (not in circuit is now shining more whenever MIDI input is received, the Arduino still doesn't get correct data, probably the signal is too much disturbed somehow).

My sketch:

#include <MIDI.h>

#define LED 13

MIDI_CREATE_DEFAULT_INSTANCE();

void setup()
{
pinMode (LED, OUTPUT);
MIDI.begin(MIDI_CHANNEL_OMNI);
MIDI.setHandleNoteOn(MyHandleNoteOn);
MIDI.setHandleNoteOff(MyHandleNoteOff);
}

void loop()
{
delay(1000);
}

void MyHandleNoteOn(byte channel, byte pitch, byte velocity)
{
digitalWrite(LED, HIGH);
delay(1000);
}

void MyHandleNoteOff(byte channel, byte pitch, byte velocity)
{
digitalWrite(LED, LOW);
delay(1000);
}


Update:

It seems the opto coupler is probably working correctly, but the Arduino does not pick up the signal correctly. I made a new question on that stack exchange:

• Comments are not for extended discussion; this conversation has been moved to chat. – Dave Tweed Jun 23 '17 at 12:02

1. Remove the opto-isolator from the breadboard. Replace it with an LED. That should blink when you transmit from the MIDI source device.
2. If that's OK then put the opto-isolator back in. Put the LED in series with the pull-up resistor. Repeat the test and you should see the LED blink.

simulate this circuit – Schematic created using CircuitLab

• See the update. Bedtime in Ireland. Good night. – Transistor Jun 19 '17 at 22:26
• @MichelKeijzers There is no relevant difference between the 6N137 and the H11L1. What test did you do with the inverter (it should not be needed)? – CL. Jun 20 '17 at 6:46
• @MichelKeijzers The MIDI output circuit also inverts the signal (it's designed this way so that an idle MIDI line does not use power). – CL. Jun 20 '17 at 8:47
• @MichelKeijzers Yes; a low voltage on the transmitter results in a current flowing through the MIDI cable, which results in a low voltage at the receiver. – CL. Jun 20 '17 at 8:56
• @MichelKeijzers Some digital optocouplers are specially designed to be non-inverting, but most optocouplers indeed are inverting. – CL. Jun 20 '17 at 8:59