I was thinking will following circuit will work as automatic cutoff system when battery is fully charged?
initially optocoupler is off.we press S1 to turn on optocoupler hence powering up the circuit and begin charging the battery.as long as current flow through output of op amp will be high and optocoupler remains turned on.when battery is fully charged current flow through RL will be zero,therefore voltage difference between inverting input and non-inverting input of op amp becomes zero.this will turn off the optocoupler.and it will also cut power to entire circuit.