This paper designs an intelligent ammonia collection and detection device based on solar power generation, which can detect the concentration of ammonia in real time and protect the health and safety of livestock. The system is composed of three parts. The front end collects ammonia concentration with data sensor, and then transmits the collected data to network server through wireless transmission equipment based on RS485 protocol. The back end analyzes ammonia concentration of farm in real time through special software, and carries out early warning and detection. A cylinder is designed for the intelligent ammonia collection and detection device. The upper side wall of the cylinder is symmetrically provided with a circular hole, the inner wall of the left circular hole is fixedly installed with a first one‐way valve, the inner wall of the right circular hole is fixedly installed with a second one‐way valve, the right wall of the cylinder is fixedly installed with an L‐shaped pipe, and the ammonia detection sensor is built in.The system adopts the ammonia sensor based on RS485 communication protocol to collect and real‐time detect the ambient air of animals in the farm, and through the setting of the height adjustment device, the air collection point can be adjusted high and low, so as to collect air samples of different heights, so that the ammonia of different heights in the farm can be collected and detected.The experiment shows that the intelligent ammonia collection and detection device can effectively and automatically detect the ammonia concentration, the system design is reliable, the algorithm is stable, and it is easy to realize and apply.