Using voltages generated in a carbon nanotube layer, the method does not require sampling, chemical labels, or an external light source. The application of this research may enable the on-site quality control of chemical factories or environmentally sensitive water sites.