and.... lookup linear opto couplers, plus your code can correct for some non-linearity.