In the fresh tomato market, it is crucial to sort and sell tomatoes based on their quality. This is important to enhance the competitiveness and profitability of the market. However, the manual sorting process is subjective and inefficient. To address this issue, we have developed an automatic tomato sorting system that uses the Raspberry PI 4B as the control platform for the robot arm. This system has been integrated with a human–computer interaction interface sorting system. Our experimental results indicate that this sorting method has an accuracy rate of 99.1% and an efficiency of 1350 tomatoes per hour. This development is in line with modern agricultural mechanization and intelligence needs.