A portable and detachable ultraviolet-visible spectrometer for undergraduate experimental teaching was designed and built.Students learned about its working principle by consulting relevant materials and literature,and used optical components to design and build the ultraviolet-visible spectrometer.The completed device was used to test the ultraviolet spectrum characterization of amino acids,and the accuracy of the device was verified through Density Functional Theory(DFT)calculations.This experimental program helps students understand the construction principles of the device in depth,exercise their practical abilities,and learn and explore related methods of quantum mechanics calculations.It implements the teaching concept of"learning by doing",giving students a sense of achievement in the experimental operation,greatly enhancing their interest in learning.