H11L1M optocoupler

Hey there,

I'd like to protect a serial connection with a H11L1M (I can easily get some at work and it works from 3 to 16 V) between a Nano and a Raspberry Pi.
This kind of optocouplers has the following truth table:

Input Output
H L
L H

Is it possible to drive the LED from the anode? I mean when the device is not emitting on TX, the LED is high (so the output is low) and when TX is high, the LED is not grounded so the output is high.

Would that work?
I've added some resistors to get sufficient current from and to GPIO pins.
Do I really need the 100nF capacitor ? It is present in the datasheet but I wonder if it's not only for testing purposes.

@manitoba29

Driving he Cathode (pin2) with the TX will work.
You need the capacitor.
The H11 is not real fast. What's your fastest baud rate?

Thanks for your quick answer. Max BR is 115200

Even with driving the LED at 10mA, that may be pushing the limits.
I have only used it for low speed applications.

Would you recommand another optocoupler with better specs ?

Let me see what's readily available.

The 6n137 is a much faster optocoupler, and will be able to do that speed without breaking a sweat.

I have done 115200 through a basic optocoupler (PC817) but it is rather error prone :slight_smile: It was really over the limit.

The TLP2361 available from Digi-Key would be perfect. It can easily do 1MegaBaud, is specified for 2.7V to 5V operation, doesn't need a pullup, low current and it's only $0.13 more than an H11L1.

1 Like

Thank you very much to both of you.
I've tried to create a schematic with the 6N137 but the TLP2361 is sexier as it's way smaller and requires less components.

Do you think the following cabling would work for my needs ? I'm not sure about the resistor nor if I need to add a diode between 1 and 3.

If 3.3-SEC is just 3.3V DC then no need for a diode.

Is the Nano a regular 5V Nano?

Thanks.
Yes this is a regular 5V Nano (old version).
Do you think the R3 resistor is correctly sized ?

If I'm not wrong and understand correctly the datasheet, it should be something like that:
R=(V-Vf)/I = (3.3-1.5)/0.01=180Ω

So I should probably go with a 270Ω, correct ?

Is the nano on the TX side or the RX side?
One of the sides should be using 5V and not 3.3V

Nano is on left side. But both devices can provide 3.3V (and it's easier for me to get 3.3 than 5V)

So TX goes from 0 to 5V and 3V3-SEC is 3.3VDC. So there will be a reverse voltage of 1.7V across the LED when TX is High and that is fine.

To compute R:
Lets say that when TX is low it's at 0.1V max.
The LED Vf max is 1.65V
The LED threshold current is 1.3mA, so let's at least double that to 3mA

3.3V-1.65-0.1 = 1.55V
For a current of 3mA, 1.55/3mA = 516Ω So 510Ω would be good

Thank you very much, especially for the compute ! It was very clear.
I was using Vf nominal in mine and not the maximum.
I don't get why you use Ifhl and not If. Could you enlighten me ?

Actually, I probably should have used the recommended If(on) which is given as 2mA min to 6mA max. There are some trade-offs with power dissipation, propagation delay and current but if your baudrate is 1Meg or less it's not an issue.

So any current between those two values will work. 4mA is in the middle.
R = 1.55/4mA = 387, so use a 390
If = 10mA is the absolute maximum current and you don't want to be anywhere near that value.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.