With the continuous development of science and technology, the degree of automation of various products in life is increasing. However, the impact on energy consumption and environment is getting bigger and bigger, and energy saving and emission reduction is gradually becoming a hot topic in the society. The huge loss of electrical energy in colleges and universities makes the development of energy-saving control technology particularly important. In this paper, we design an energy-saving control system for college classrooms based on STM32 main controller, which mainly collects the light intensity and personnel distribution information of classrooms through photoresistor sensors and infrared pyroelectric sensors, and combines software programming to realize effective and group control of classroom lights, so as to achieve the purpose of energy saving. On this basis, a simple upper computer monitoring interface is built to display the collected information, which facilitates real-time monitoring and management of the classroom. The system is analyzed and introduced in detail in three main aspects in the paper. Firstly, the selection of the main controller and its main hardware circuit modules are introduced; secondly, the software process design is centered around the system; finally, using simulation, analysis and online debugging, the light intensity and personnel distribution information collected can be used to control the lamps and lanterns at the corresponding locations of the personnel to turn on. In summary, this paper designs a classroom energy-saving control system to meet the current situation of large energy consumption in college classrooms, which can realize the effective lighting of the corresponding positions according to the changes of natural light environment and different positions of the personnel in the classroom, and verifies the feasibility of this scheme. It provides an idea to effectively reduce the waste of power resources and achieve the purpose of energy saving and emission reduction in colleges and universities.