Electronic – how to use H11L1 correctly to receive MIDI

midiopto-isolator

I was following this schematics. This is the first result on google images

enter image description here

My Arduino Serial Monitor received nothing. I tried to replace the H11L1 with LED, and it does blink. but as soon as I connected the H11L1 (while keeping the LED in parrarel and not connecting the H11L1 to anything else), the LED stops blinking. Tried with and without resistors, also tried to reverse the cable.
Then I plug out the H11L1, afraid to break my keyboard and the LED blinked again.

EDIT :
I was using Arduino Mega. I put it on reset mode by connecting Reset to GND. then I connected it like above and opened serial monitor. Nothing.
Also I don't use capacitor, so I edited the image a little.

Where do I start troubleshooting?

another edit, here goes my Arduino so far. Sorry for bad soldering.

enter image description here
enter image description here

What I've tried so far :

  1. Reading the serial pin as a digital pin, without connecting the H11L1 to anything except the resistors, just like above. Always return 1.
  2. Tried to put multimeter on it, still returns 1, expected return is 0. Tried to turn on LED with it, the LED did turn on.

EDIT as of 03/28/2019

I changed Arduino Mega to Wemos D1, and H11L1 to PC900V (some source told me that it is the same IC)

After that, I connected that (still using the same schematics) to D2 instead of RX, and using this code to check it. Still no luck, whatever I did it still only returns 1.

Best Answer

You cannot use both serial monitor and the serial input pin. They share the same serial port.

Even not used, TX from MIDI conflicts with TX from PC at the microcontroller RX input which keeps the input to logic "1" . Reading as digital input doesn't change anything.

Use a software UART for MIDI or find some other way to test your program without using the serial monitor.

The software UART can help you fix the design flaw noticed also by @Transistor that the output is inverted by inverting the input in software.