An optoisolator also allows information to be transferred between circuits not sharing a common ground potential.
What does an optoisolator do?
allows information to be transferred between circuits not sharing a common ground potential