Electronic – Accidentally outputting to an optoisolator

opto-isolatoroutputttl

It's your friendly electronic hobbyist again.

I am designing a board where I am reading input from an optoisolator like this.

IN7 is connected to a peripheral parallel port chip of an old 8-bit microprocessor, which is supposed to be set as an input.

I just realized, however, that a user could accidentally have IN7 set as a 5V TTL output instead of an input.

What happens in a case like this? Could doing so cause damage to the circuit? If so, is there a way to protect it?

I'm afraid I don't understand optoisolators (or transistors) well enough to know what would happen.

The Circuit

Best Answer

Putting a 220ohm-1kohm resistor between the pin and the transistor will keep any output current to a reasonable limit while still keeping the input signal within an acceptable envelope.