Measure battery Voltage 4V using optocoupler and read voltage value use Arduino

An optocoupler is a logic device 0 or 1.

The idea is POSSIBLE - but you would need eg V-f converter, optocoupler, measure the frequency with the arduino. Or some sort of feedback system.

But basically you are trying to do this the wrong way.

Perhaps if you told us a bit more?