Does this circuit have proper isolation?
If you need ground isolation then you need different power supplies. However if your only concern is the voltage level i.e. you don't want to damage the micro controller then you do not need ground isolation. All you need to do is to guarantee that the maximum voltage that reaches the pins does not exceed the maximum. 

This can as you have suggested be achieved through optical isolation; however, there are cheaper ways to do it. One example would be to use a voltage divider.

This should help you out further.