Not enough current to turn on optocoupler 6N135...

greets

I want to build a midi shield but the midi loop current from my Midiman 1x1 interface is not enough for the 6N135 (datasheet). If I’m correct it needs 16ma and the Midiman can’t supply that.

How can I boost the signal?

I thought of using a transistor and use the 5V rail from the UNO, but then that would break the isolation between Midiman and the UNO, correct?

Another idea was to use a separate battery pack (4.5V) to power the transistor, but I’m not sure how to hook it up.

I’d appreciate your help with this,

thanks

6N135 - MIDI.jpg

Maybe 16mA is needed when you run it @1Mbit and you need to work with higher output currents (fast). I would try it with much lower diode current with midi (ie. 3mA), as the CTR is same - and use larger collector resistor (ie 4k7). Midi is slooow.. :slight_smile:
PS: see Fig.3 - for 1.8mA collector current you need 5mA LED diode current.

If you mean the resistor Rl between pin 6 and 8 (see attach) then I have already tried 4.7k and other values without success. It works however if I pulse the input diode with 4.5V from a battery pack.

I also tried removing the 6N135 from the circuit and simply inserting a led (without a resistor) between the midi output pins, it pulses if midi data is being sent, so it looks like the voltage and current is enough to pulse a led but not the input led of the 6N135, or…

6N135 - Test circuit.jpg

Try to wire a 50k-100k resistor from Vb (pin 7) to Vcc (bias the transistor, maybe it helps). Set the output voltage to 4V (when you have 5V Vcc) with no current into the led.

How do you feed the LED? Do you sink it or do you source it?? Maybe your interface is better (can give you more current) in the sinking as in the sourcing (or vice versa)..

You may increase the RL from 4k7 to 10-20k. Midi is 30kbit, so it may work. According to the datasheet you will need almost no current for the led to toggle such output.

Although the performance figures are quoted at 16mA, Fig. 1 on page 7 of the datasheets shows that it has a reasonable current transfer ratio down to at least 1mA. But you will need to use a higher value load resistor (the one between pins 6 and 8). Try omitting that resistor altogether and enabling the internal pullup resistor on the Arduino input pin that it is connected to. That should get you some response, although it might not work at 30kbits.

Unfortunately nothing seems to work. I even tried using my UNO as a midi sending device, no success. This is the sketch: http://www.arduino.cc/en/Tutorial/Midi

I'm curious what the voltage levels for the TX pin are. Is it +5V for logic 0 and -5V for logic 1?

I'm curious what the voltage levels for the TX pin are. Is it +5V for logic 0 and -5V for logic 1?

Voltage levels of arduino's TX pin? 5V log1 and 0V log0.

Voltage levels of arduino's TX pin? 5V log1 and 0V log0.

I thought serial communication is HIGH while idle, i.e. logic 0 = +5V.

Yes, MCU’s UART serial comm idle is CMOS high (5V) at the arduino TX/RX pins. Start bit is low CMOS log0 (0V).
Arduino’s TX/RX pins are not at the RS232 voltage levels.

RS232 uses “mark and space” instead of log1, log0. It idles on Mark (-12V…-3V) and the comm starts with Space (3V…12V). Those are typical PC voltages ranges, the standard is broader.

so when TX is LOW it’s pulled (directly?) to ground?


I did some further testing with the 6N135. It starts functioning if I lower the baud rate from 32500(MIDI) down to below ca. 500. Does this mean that this opto is not fast enough?

naut:
I did some further testing with the 6N135. It starts functioning if I lower the baud rate from 32500(MIDI) down to below ca. 500. Does this mean that this opto is not fast enough?

It means that the opto is not fast enough in the circuit you are using. Photodiodes and optoisolators can typically work at a speed inversely proportional to the load resistance.

The datasheet quotes a propagation delay time of 2us max using 16mA forward current and 4.1K load resistance, with 1.5V being then threshold at which it is measured. You are driving it with less than 16mA, and the Arduino has a threshold more like 2.5V than 1.5V. However, unless the current you are using is very much lower than 16mA, then I think you should be able to get it working at 32500 baud if you choose a suitable load resistor. Try varying the load resistor and seeing how the maximum usable baud rate varies with its value. When you have found the optimum load resistance, if the speed still isn't high enough then you will need to use an external transistor or comparator to allow the use of a lower load resistor.

naut:
I did some further testing with the 6N135. It starts functioning if I lower the baud rate from 32500(MIDI) down to below ca. 500. Does this mean that this opto is not fast enough?

The datasheet calls it a "High Speed Transistor Optocoupler" so that's probably not it...

Hopefully you did not wire the 1.5uF CL capacitor to the output - as depicted on the above schematics... :slight_smile:
If yes, then plz get rid of him ....