6n137 ground problem

I’m new to Arduino and electronics in general. I’m trying to receive midi signal from my keyboard to arduino and after 2 days of trying, I finally got it working using 10k resistor on 6th pin instead of 220Ohm I saw in some schemes.

I am using 5V from Arduino to power circuit and I have strange issues with grounding 5th pin on 6n137. If I put GND wire from Arduino right next to 5th pin on breadboard (Picture 1) - it works,
but if I put GND to blue rail and then connect 5th pin to blue rail (Picture 2), it won’t work. I tried all blue rails on my breadboard (they worked on previous circuits) and also tried using few 5-pin rail just to simulate bridge, and the only way 6n137 gives results is if I place GND directly from Arduino right next to 6n137.

Any idea why this could be? Could it be that wire’s resistance is too high? I also tried very short wires that I cut from spare resistors, and still not getting any results.

Here are photos: (I can’t upload since I’m new on the forum)

The image does not show the complete circuit.

Show us a good schematic of your circuit.

Show us a better image of your ‘actual’ wiring.

In the past, I’ve added a 10k between pin 7 and 8, something like this:

Also a 104 capacitor from 8 to GND.


Here’s “better” image (the best I could) of my breadboard.

And this is the diagram I followed:

In this diagram, pin 7 is not connected to anything. Could this be a reason?

Please try adding a 100nF capacitor (right next to the chip, short leads on the capacitor) between pin 8 and pin 5 of the optocoupler.

Pin 7 really should not be left open circuited; tie pin 7 to pin 8 with a 10k resistor.

You do know your power rails on the solderless breadboard are split ?