MCU GPIO Pin as Optoisolated Input and Output

Status
Not open for further replies.

sakibnaz

Full Member level 3
Joined
Jul 6, 2008
Messages
165
Helped
6
Reputation
12
Reaction score
6
Trophy points
1,298
Visit site
Activity points
2,778
Hi All.

For my project I need opto-isolated Input and Output but as both In and Out will not be used simultaneously so I cam thinking if its possible to use single MCU GPIO pin as opto-isolated both Input and Output.

Can anyone advice a schematic?

Thanks.

Regards.
 

Possible but tricky.

As the opto-isolator is a one way device you would have to use two, one for data to the MCU and one for data from the MCU. You would have to ensure the incoming one was in a 'non active' state when driving the outgoing one or they would simply fight each other. If you can be sure of that, use a weak pull-up to make the input default to high state and pull it low with the input opto. Drive the pin high to push more current through the LED of the outgoing one.

Brian.
 

Hi All.

Thanks a lot. Yes may be the Bi-Directional Optoisolator is a good choice. But still I am not sure if its doable as I want to use single Pin for Input and Output side.

Below is the thing I am trying to do:



So using UART command I want to set the system either input or output. In case input I'll use a Button in the Header IO pin or in case our output I can use a LED.

Please advice if any easy way to do it.

Thanks in advance.
 

UART is a worse choice, but yes, it is possible. Put there something like a STM8S in SO8 case and it will execute UART commands.
 

Hi. Yes definitely. The middle block is a MCU. Its STM32 actually. I think the below picture is appropriate. Sorry for the confusion.



Thanks.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…