Electronic – arduino – Multi channel optocoupler

arduinomidiopto-isolator

I'm new to electronics, so forgive not using official terms.

I want to make a MIDI project with an Arduino (Mega) and want to have 3 MIDI input channels. Currently on my breadboard I use 6N137 optocouplers which seem to work.

However, I also see schematics using a 6N138 or 6N139 optocouplers… Since I'm not so good at reading datasheets, let alone comparing them (since they use somewhat different terminology).

Since I need to use 3, maybe I thought I can use a so called multiple-optocoupler like this 4 channel optocouper

Also I found LTV847

However, is it comparable to a 6N137? And would I still need to use a diode and resistors as in the schematic of e.g. the MIDI In of this?

Or should I use a 6N138 or 6N139 or another since the 6N137 has disadvantages?

Or are there even better/more suitable multiple channel optocouplers than the one I found?

(the reason is want to check if I can save some space by using a multi channel optocoupler instead of 3 separate ones, including resistors/diodes etc).

Best Answer

I'd suggest the best device selections are the 6n137 or in a slightly smaller physical form the H11L1 where you can save two pins worth of board space.
The reason these are ideal is that they are digital devices (they have a Schmidt level gate driver) rather than the analog devices such as the 6N138/139 or even the SFH6916 suggested in the comments.

The speed of your MIDI command is very low (31k baud) so this is not a concern. However you need to ensure you have what's called hysteresis built into the signal path so you get clean replication of the signals passing through your MIDI devices. The digital parts give you this built in, whereas with the analog parts you have to design this in which typically requires more components for through signals.

Here's the relationship between input current and the digital output for the H11L1:

enter image description here

You can see here that the current requirement to switch state of the digital output is just under 1 mA (you don't have to deal with current transfer ratios with digital devices) and the hysteresis is built in.

You MIDI interface will switch between 0 mA and about 5.5 mA (if you use the 3 220 Ohm resistors recommended) for it's low/high state. The reverse protection diode shown in many schematics is a good idea, just for safety.