The invention discloses a sensor, and provides a vapor-liquid sensor which is high in detection sensitivity and stable and reliable in performance. The vapor-liquid sensor solves the technical problems that in the prior art, detection sensitivity is low, and as floating balls are easily attached to a guide rod, a vapor-liquid sensor fails. The vapor-liquid sensor comprises a valve body and a hollow guide rod with one end packaged in a containing cavity of the valve body, a magnetic switch is arranged at the portion, corresponding to the interior of the valve body, in the hollow guide rod, a floating ball set is connected to the portion, corresponding to the magnetic switch, outside the hollow guide rod in a sliding mode, an input port and an output port are formed in the portions, corresponding to the two ends of the floating ball set, in the containing cavity respectively, the floating ball set comprises a floating sleeve made of a PP material, an annular magnet and a close cover, the hollow guide rod is sequentially sleeved with the floating sleeve, the annular magnet and the close cover, the annular magnet is clamped between the floating sleeve and the close cover, and the portion, between the floating ball set and the valve body, of the hollow guide rod is sleeved with an auxiliary spring.