Software apps and online services
More and more cities in China require the classification of waste, and the demand for various types of classification is increasing rapidly. Compared to traditional manual sorting, AI intelligent identification sorting can reduce people's work load. But for many beginners, AI is "far away", so we build an intelligent sorting application model that allows more people to learn to use AI cameras and make their own applications.
1. Set up AI camera M5StickV
The standard 1515 aluminum profile is used to fix the top of the structure on the 6060 module, and the M5StickV with AI recognition function is used for object recognition.
Using the SD card, refer to the official website V-Training service tutorial (AI recognition model training service) to construct an object recognition model to achieve the effect of identifying objects.
After completing the model training, modify the startup program file "boot.py" and define the extended interface of M5StickV as the serial port. And send the identification information to Basic through the serial port.
Note: When shooting the material, please be as close as possible to the light and background conditions of the actual use environment. You can modify your program according to the recognition rate of the actual model training results, such as objects that are prone to misidentification, can set a higher recognition rate determination condition, or set certain effective numbers to reduce the occurrence of misidentification.
2. Set up controller M5Stack Basic
The middle of the Alec panel is used to secure the middle of the structure, and the controller BASIC equipped with ESP32 is placed above it for control and content display. Through the serial communication with the M5StickV, the identification data transmission, processing, and control actuators perform corresponding actions.
The BUS module stacked on the host is used to expand the bus external RGB light bar. With the FastLED library, we can easily program some cool lighting effects.
The M5GO base used at the bottom is stably installed on the acrylic panel by the building block structure. The three expansion interfaces compatible with Grove on the base are used for two serial communication and transmission PWM signal control sorting servos.
Note: You can use the program to map the serial port to different pins. If the host you are using is Fire, you need to pay attention to avoid using GPIO16/17 as the serial port.
3, set up stepper motor module
At the bottom of the structure is a customized 6060 stepper motor motion module that communicates with the BASIC for serial communication, receiving control commands and return status. The 6060 instruction set is shown below.
The moving part of the motor is matched with a sorting tray composed of building blocks. During the running, the steering gear realizes the sorting of objects on the left and right sides by changing the angle of rotation.
After the object is successfully identified, the part of the transport object is sent to the corresponding sorting position for sorting.
1. Power on the module, controller, and camera wait for the device to start, and initialize the initialization (when the light bar is lit and the effect is changed continuously, the initialization is complete).
2. The identification object can be identified and sorted by placing it on the identification area (building block).
1. The recognition system relies heavily on color and shape, so use identifiers that differ in shape as much as possible.
2. The stepping motor module is slower. The speed given on the program is closer to the critical value. If “catch” occurs during the running, turn off the power, stop it, and restart.