Separate-Ground voltage measurement

I checked my inventory, I have a plenty of simple optos around.

Do you think if I will build 2 simple optocoupler (PC817) conns (sender side - opto in between ground and digital pin, with 330k current limiter in series, receiver side - opto out between the digital pin and gnd, pin side with pullup 10k) would be sufficient? And running this with software serial to communicate between arduinos?