1
\$\begingroup\$

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

\$\endgroup\$
  • 1
    \$\begingroup\$ It looks like 4N28M will never have a CTR greater than 100%. So if your uC output pin is capable of sourcing ~11 mA, you shouldn't need any protection device. If this is a hobby project, I'd just not worry about it --- even if 11 mA is above spec for the uC, it's not likely to blow it up. And you shouldn't actually be stressing it that way anyway, if you're careful about your coding. \$\endgroup\$ – The Photon Sep 25 '15 at 5:19
  • \$\begingroup\$ Just test it and see what happens. \$\endgroup\$ – Andy aka Sep 25 '15 at 7:45
2
\$\begingroup\$

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.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.