I've used the following schematic but with a 6N135 instead of a 6N138.

I did some testing by connecting a LED between pin 6 and ground. It's on while the input LED is off.
The only way I can get it to go off is if I pulse the input LED (pins 2&3) with a battery pack (ca. 3.5V). If I however I hook it up to a midi output of a midi interface and play some midi files, nothing happens, the test LED stays on.

I've tried many different resistor value but it did not help. I don't know if the 6N135 was a bad choice for this or if I'm overlooking something.

According to this, the MIDI interface is a 5mA current loop. This means you don't need any resistor in series with the opto input.

Since the 6N135 has a minimum current transfer ratio of 7%, that means the worst-case output current would be only 0.35mA. The minimum load resistor (R2) value is thus 5V/0.35mA = 14.3kΩ. This may be too large a resistor value to get the frequency response you need. If so you may need to find an opto coupler with a higher transfer ratio and/or frequency response.

I started from scratch today, rewired everything on the breadboard, inserted a 2.2K resistor between pins 6 an 8, changed R3 from 220 Ohms to 100 Ohms and it works, at least in the direction Arduino TX - 6n135 - MidiMan (Input). The Midiman USB interface recognizes midi notes sent from the Arduino.

do you guys know how I could include a signaling LED on the right side of the opto (i.e. use pins 5-8)? I want it to blink whenever there is an incoming message. I've tried different combinations with a NPN transistor and a resistor and cant get a functioning circuit, i.e. if the led blinks then there is no signal going to RX, or vice versa RX is receiving data but the LED is either fully on or fully off.

---

btw, I tried removing the 3K3 resistor between pin 6 and 8 and the circuit continued to work, data was going through to the RX pin. What's the reason for that 3K3 resistor being there?

Connect with Us

Sign Up

Quote of the day

“Electrical science has disclosed to us the more intimate relation existing between widely different forces and phenomena and has thus led us to a more complete comprehension of Nature and its many manifestations to our senses.”