Figure 2:
simulation of optocoupler.