I want to connect an input signal to pc817 and the output to a microcontroller. I don't know how to put the LED at the input to indicate that the input signal is working.
For example my input is limit switch. My \$V_{in}\$ is 3.3V. Before the limit switch is closed, the voltage at the first pin of optocoupler should be the forward voltage 1.4V. After the limit switch is closed, the voltage become 3.3V. So my question here is how to connect the LED to the input and how to connect the signal of the input to the optocoupler. other than limit switch i will use digital or analog sensor as input to be isolated and interface to the microcontroller. i would like to make the led as the indicator when the sensor is sensing object, and the led will light. so how to make the led work like that.