The invention relates to a detection device for detecting a harmful gas in a smart pipe gallery. The detection device comprises a base and at least two moving wheels, and also comprises a displacementmechanism and a detection mechanism, wherein the displacement mechanism comprises a first driving component, a steering component, an air cylinder, two first drive rods, two second drive rods and twofirst slide blocks; the first driving component comprises a driving unit, a supporting rod, a drive unit and two third drive rods; the detection mechanism comprises a shell, a piston, an air inlet, an air outlet, a gas sensor, a supporting frame, a second driving component and a first driving rod. In the detection device for detecting the harmful gas in the smart pipe gallery, through the displacement mechanism, the position regulation of the detection mechanism is realized; thus, a detection range of the detection mechanism is expanded; the accuracy of the detection device is improved; the detection of the harmful gas is carried out on a proper amount of air sample through the detection mechanism; an influence, on a detection result, of an air mass flow is decreased, and the precision ofa detection apparatus is improved.