I have a 12V signals that I need to get to PIC port.
The thing is that I would like NOT gate. Meaning that when there will be voltage present on foto diode there will be no voltage on PIC input and vice versa.
Will ILQ5 optocoupler be fine. Can I use below schem found in datasheet, and I use 1kohm resistor? **broken link removed**
No need to use such a low value for the pull-up (wasting much power). I would try 47K or 10K. You can probably reduce the amount of current into the emitter much below 10mA, too.
No need to use such a low value for the pull-up (wasting much power). I would try 47K or 10K. You can probably reduce the amount of current into the emitter much below 10mA, too.
From the datasheet:
foto diode forward curernt at 1.25V is 60mA - so internal resistance is 20.8 ohm
collector is saturated already at 5mA current through foto diode
So I am thinking of 2.2 kohm resistor on foto diode part for 12V input signals since 12V - 1.25V / 5mA = 2150ohm.
But more I am intereseted how to properly connect collector output to MCU so I will have "NOT" trigering on MCU port.
PIC 16Fxxx as I know already have large internal resistance and it needs very small current to flow through its input ports. I think few uA.
So if I connect like attached scheme shows and give 10k resistor it will be fine and PIC will get enough current & voltage to register the signal?
Can you just say if I would like AND triggering instead (signal on diode - signal on PIC input port), can I use 100k pull down resistor?
And some maybe stupid question. Do I even need to connect emitter to the GND in this configuration. Since current through base could flow through MCU to the GND. When collector is closed there will be no current and when it is opened the current will flow through MCU. So why even need to connect emitter to the GND?