0
\$\begingroup\$

In my project I'm using an STM32F401 controller. I want to provide a digital input to one of its GPIO (3.3 V maximum) pins to read an industrial sensor output. I'm advised to provide isolation between sensor output and controller input using an optocoupler.

  • Input voltage to optocoupler = 5-24 V
  • D/I pin voltage = 3.3 V max

Here's my proposed design:

enter image description here

If something is wrong or if I'm missing any major thing in this circuit then please let me know.

\$\endgroup\$
2
  • \$\begingroup\$ @All - The long comment chain has exceeded what is reasonable for comments. Therefore it has been moved to chat and should be continued there (see the link below). --- As this bulk moving of comments to chat can only be done once per question, any further comments posted here might be deleted without notice. Keep it in chat now, please! When someone has got enough information from the chat to post an answer, then please do that as usual. Any updates to the question which are decided during the chat, should be made via an edit to the question, not as a comment. Thanks. \$\endgroup\$
    – SamGibson
    Commented Oct 17, 2022 at 14:02
  • \$\begingroup\$ Comments are not for extended discussion; this conversation has been moved to chat. \$\endgroup\$
    – SamGibson
    Commented Oct 17, 2022 at 14:02

1 Answer 1

1
\$\begingroup\$

I think that input resistance should be lowered, because when 12V applied to input you have approx I = U / R1 = 12 / 22k = 0.54mA flowing through optocoupler (without count of LED's Rd and leakage through 1N4003 (be careful, because diodes with a large reverse voltage have relatively large leakage currents)). Also pay attention to frequency characteristics of interface and optocoupler (think that you have LED here to know if sensor sending information thorough one of the interfaces). And with this diode you are only protected with positive transients (if sensor input isn't protected), negative transients going through 1N4003 and R1 to sensor input.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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