Digital level transducer based on optical fiber