One embodiment of the present invention provides an apparatus for analyzing substances included in a sample. The apparatus includes a physical enclosure for holding the sample and one or more sensors positioned on an inner surface of the physical enclosure. The sensors are configured to provide information associated with the substances included in the sample. The apparatus further includes electrical conductive traces positioned on the inner surface and coupled to the one or more sensors, thereby facilitating transmission of outputs of the sensors.