One embodiment of the present invention provides an apparatus for analyzing a liquid comprising a plurality of different substances. The apparatus includes an absorber that comprises one or more layers of absorbent material for absorbing the liquid and one or more sensors embedded within the one or more layers of absorbent material. The sensors are configured to provide information associated with the different substances included in the absorbed liquid, and a location of a respective sensor is determined based on a corresponding substance detected by the sensor and a diffusion property of the substance.