As is known to all, university chemistry laboratories have always been considered as dangerous areas on campus, especially pharmaceutical chemistry laboratories, which are often the focus of pharmaceutical laboratory management. The innovation in safety management mode can effectively reduce or even eliminate security risks and reduce the risk of safety accidents. With the rapid development of artificial intelligence, robots have been introduced into all walks of life, replacing humans to complete part of the safety inspection. One of the core tasks of laboratory safety inspection is to find the source of fire and take measures to extinguish the fire in time. The intention of this paper is to design a sentry robot, which could take appropriate emergency measures to detect dangerous situations, including sounding alarms and carrying out firefighting, in order to minimize accidents and economic losses, based on machine vision for periodic inspection of laboratories with a temperature thermal imager to scan surroundings at the same time. The preliminary research results show that based on the machine vision, the robot identified the fire source and adjusted the spray device to carry out the fire-extinguishing experiment successfully. The development and utilization of laboratory patrol robots can share the work of laboratory patrol to a certain extent, guarantee the safety of experimental teaching in colleges and universities, and have room for sustainable research.