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.
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.
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.
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.