The use of functional polymer materials to obtain high-performance biosensors is currently a research hotspot in the field of analysis and materials. Polymer materials have the advantages of good biocompatibility, easy design and controllable preparation of reactive groups, and rich functional types, which are helpful to construct biosensor interfaces with excellent performance. This work aims to study the application of functional polymer materials in environmental biosensors in the context of the Internet of Things, prepare silver nanocubes on Nafion membranes with ATP as a buffer, and establish a new optical detection method. Formaldehyde based color change of the film. In addition, a new method for detecting temperature and spermine using the conformational changes of polythiophene (PT) derivatives under certain conditions was established. According to the color and fluorescence changes of PT induced by iodide ions in the range of 25.5℃-50.5℃, a rapid and sensitive method for temperature detection was established. The establishment of this method shows that polythiophene derivatives can be used as a new type of temperature sensor, thus expanding the application range of PT. In addition, to further validate the method, real beef and chrysanthemum samples were tested, and the detection recoveries ranged from 85.6% to 103%, indicating that the method is feasible for spermine detection.