If you make the electrolysis cell
one of the legs of a Wheatstone
bridge, and let the cross-branch of
Wheatstone bridge be a
comparator (an op-amp without
a feedback branch) then you can
get automatic shut-off at when
the desired resistance in the
cell is attained.

Best wishes,
 Matthew