Design of Intelligent Sorting Trash Dustbin Based on STM32

—Garbage sorting is related to many issues such as living environment, resource conservation and social civilization. Aiming at the problem of garbage sorting, an intelligent sorting trash dustbin was designed on the mechanical structure designed by ourselves, using the STM32F103ZET6 chip, the LD3320 speech recognition module, and the ultrasonic module. The garbage dustbin realizes the identification of garbage types, the compressed storage of recyclable garbage, and automatic bag sealing. This design not only protects the environment, reduces the risk of disease, but also makes resources recyclable, which indirectly brings unexpected benefits to humans.


INTRODUCTION
In recent years, more and more people have begun to pay attention to garbage classification, but the situation is still grim. At present, incineration technology, compost technology and landfill technology are mainly used for the treatment of different municipal solid waste [1]. In order to solve the increasingly serious environmental problems of cities and the problem of limited resources, garbage classification is particularly important. A huge challenge in garbage classification is that the people's classification consciousness is not high, and sometimes they can't even distinguish between recyclable and nonrecyclable garbage, which makes the design of intelligent sorting dustbin very important [2].
After putting in the garbage, just by saying the name of the garbage, the trash dustbin will automatically identify recyclable garbage, kitchen waste, hazardous garbage, other garbage, and judge whether the garbage can be compressed and complete the corresponding action [3]. Finally, the garbage is poured into the corresponding bucket. When the garbage is stacked at a certain height, the garbage bag is automatically sealed, thereby avoiding the adverse impact caused by the artificial sealing bag contact with the garbage.

OVERALL DESIGN
The intelligent trash dustbin designed in this paper has three major features, voice recognition garbage types, compressed storage, and smart sealing of bags. It uses LD3320 speech recognition module and HC-SR04 ultrasonic module as sensors to complete information collection, and uses OLED as a display device to complete human-computer interaction and display garbage attribute information in real time [4]. STM32F103ZET6 is the main control chip, which completes the analysis and processing of the collected information, and controls the movement of the corresponding motor to complete the movement of the entire mechanical structure. The mechanical structure part is mainly divided into the design of the turntable mechanism of the garbage input port, the design of the garbage compression mechanism and the design of the automatic sealing of the garbage bag. And according to the sensor and stepper motor, the program and hardware are modularized.
The overall design diagram is shown in Figure 1 below, and the intelligent sorting trash dustbin assembly diagram is shown in Figure 2.

3.1Design of Turntable Mechanism for Garbage Input
Considering that the garbage may slide arbitrarily after the garbage is put in, the designed garbage inlet is a Ushaped aluminum alloy profile with two ends open to facilitate the dumping and compression of garbage. The working process is that the stepper motor of the turntable rotates according to the control signal, and the discharge port is aligned with the entrance of the corresponding type of trash dustbin. Here the stepper motor is used to drive the gear mechanism to tilt the silo. After the dumping is completed, the turntable returns to the initial position. Anatomy of the structure is shown in Figure 3 below.

3.2Design of Garbage Compression Mechanism
When the sensor recognizes the garbage as compressible garbage, the intelligent sorting dustbin will compress it to reduce the space occupied by the garbage and maximize the use of resources [5]. The working process of the compression mechanism is mainly driven by a motor. The screw rod drives the screw nut seat back and forth to push the compression plate to compress. Its compression rotation device is shown in Figure 4 below. This compression method is obtained after comprehensively considering the structural characteristics of compressible garbage. Although the screw transmission method is relatively slow, it is stable and reliable, the size of the mechanism space is small, and the torque requirements of the motor are not high [6].

3.3Trash Bag Seal Design
In the design of automatic sealing of the garbage bag, use an ultrasonic sensor to detect whether the garbage bag is full. This method has the characteristics of simple principle and low cost. The bag sealing technology uses heating and melting technology. The melting and adhesion method is a very effective and convenient method of bag sealing. In order to improve the efficiency, nickel-chromium resistance wire was selected, which can rise to higher temperature in a short time [7]. When the bag sealing device is energized, a stepper motor installed on the device drives a synchronous belt pulley to drive the belt to move the horizontal plate equipped with the electric heating wire forward and clamp the garbage bag with a fixed end. Then the heater heats the heating wire, melts the plastic bag and sticks it to seal the bag. In addition, a heat insulation strip is fixed at the other end, which prevents the heating wire from sticking to the clamping plate at the other end after repeated use. The specific process is shown in Figure 5

HARDWARE DESIGN
In the selection of the main control chip, STM32F103ZET6 [8], which has strong scalability, high cost performance, fast processing speed, low power , 04032 (2020) E3S Web of Conferences ISCEG 2020 https://doi.org/10.1051/e3sconf/202019804032 consumption, and rich network utilization resources, is used. The signal detection circuit is divided into LD3320 speech recognition module and HC-SR04 ultrasonic module. The ultrasonic detection module also uses the STM32F103C8T6 chip, which connects its PA10 pin with the STM2F103ZET6 PG2 pin to achieve signal transmission. In terms of driving, a TB6600 driver and four 42 stepper motors are used. Through the cooperation of multiple modules, the signal detection, compression storage and automatic sealing of the intelligent sorting box are completed.

4.1Power Supply
The 220V AC voltage is stepped down, rectified, filtered, and stabilized into 12V DC voltage to power four 42 stepper motors; 12V is then stepped down and filtered to become 5V to supply power to the chip; 5V becomes 3.3V through the system voltage stabilization module to supply power to some system circuits [9].

4.2Signal Detection Section
Utilizing the features of LD3320 non-specific person speech recognition, editable entries and high accuracy, to realize speech recognition, convert the received signal and feed it back to the main control chip to complete the control of the stepper motor [10].
Because the HC-SR04 ultrasonic module occupies a small space, it is installed on the upper edge of the keg to achieve accurate distance measurement without affecting the normal operation of the remaining components. It contains three basic circuits: an ultrasonic transmitting circuit, a signal receiving circuit, and a control circuit. When a high level greater than 10us is given, HC-SR04 sends 8 square waves of 40KHZ, and if a signal is detected, it outputs one high level, the test distance is calculated based on this level maintaining time [11]. When the distance reaches a given value, the main control chip controls the stepper motor of the bag sealing part to complete the bag sealing. Based on the high-level duration T and the speed of sound in the air, V, the test distance S can be calculated as:

4.3Driving Part
The TB6600 hybrid stepper motor driver is used in the turntable rotation, dumping, garbage compression and bag sealing of the intelligent sorting dustbin. When it receives a pulse signal, it will control the angular displacement of the stepper motor. A 42-step motor is used. Depending on the pulse frequency, the number of pulses can achieve precise control of angular displacement and linear displacement [12]. In addition, the use of stepper motors also eliminates accumulated errors and improves the accuracy of the entire system [13].

HARDWARE DESIGN
In the software design of the intelligent classification trash dustbin, the programming processing is performed according to each module, and the module function call is finally performed. The entire programming is done on Keil uVision5, using C language, which is easy to maintain and debug [14]. This program design, as an important core of the entire control system, realizes the control of each link of the intelligent sorting dustbin. The overall program flow is shown in Figure 6. The intelligent classification trash dustbin described in this article was modeled by SOLIDWORKS, the mechanical structure was designed, and various hardware modules were combined, and finally developed successfully. After verification, the classified trash dustbin has achieved the expected goals in terms of function, and can complete the sorting, compression storage, automatic bag sealing, etc. of the trash, verifying the rationality of its design. The design realizes the classification of garbage, which can increase the storage capacity through compression, and automatic bag sealing can reduce the spread of bacteria. This intelligent sorting dustbin will undoubtedly bring the gospel to society and the environment. However, in a noisy environment, the accuracy of speech recognition can be further improved, so that the trash dustbin can better identify the type of trash.