With the continuous development of my country's economy, urbanization is getting higher and higher, making people's domestic garbage more and more, and the problem of garbage sorting is becoming more and more serious. In order to avoid the damage of daily garbage on the ecological environment, reduce the huge impact of daily garbage on the environment, and facilitate the use of the cycle of garbage and propaganda to the public to classify garbage. This article uses a STM32 single -chip machine. When the user says the password of the garbage or the name of the trash can, the voice recognition module of the trash can will be identified on the user password. The overall assembly welding is carried out to complete the debugging, which proves that it has high stability and reliability. To a certain extent, it has certain significance to reduce the workload of sanitation workers and their sanitation work management.