An intelligent disinfection robot based on STC89C52 microcontroller as the control system is proposed to address the current problems of high cost, scene limitations, and complex control factors. With the assistance of software development, the peripheral circuit of the chip is designed, and the robot can dynamically adjust its path according to its own and surrounding companions' position and motion status. The research results indicate that the various modules of the system can work in coordination, with high accuracy in tracking routes, precise image recognition, timely obstacle avoidance, fast response speed, and safe and reliable system operation. The disinfection robot carried out disinfection and sterilization test on the most common staphylococcus aureus and mold, and the test results showed that the pathogenic bacteria decreased significantly after 2 min, and all bacteria were removed after 3 min, and the killing rate of bacteria was up to>96.0%. This method improves the obstacle avoidance ability and collaborative efficiency of robot systems in complex environments, and can effectively respond to various unexpected situations.