Microcontroller is widely used in the intelligent life of modern society. Intelligent development based on Microcontroller to solve the actual needs of people's life, work, study and other fields is the core of Microcontroller application. Therefore, it is a task for researchers to understand the structure and performance of microcontroller, develop software, and be familiar with the method and process of intelligent development based on microcontroller. And with that in mind, this paper designs and produces a physical hardware system for indoor environment detection based on STM32 microcontroller. The system can detect the light intensity, temperature and humidity, and CO gas concentration in the indoor environment; and the data is integrated and processed by the STM32 microcontroller to display the current parameter values of each quantity in the indoor environment on a 3.5-inch resistive screen; at the same time, the PC can also log in to the OneNET cloud platform through the web page, and display the light intensity, temperature and humidity, and CO gas concentration values in the indoor environment in real time in the device created by OneNET for real-time viewing. The system can also display the light intensity, temperature and humidity, and CO gas concentration values in the indoor environment in real time. The hardware system has been tested and tested to achieve its function.