The invention discloses a sensor. The sensor comprises a sensor probe, a connecting cable and an electric connector, the sensor probe comprises a sensor shell, a circuit board, a pressing cover, a pressing cap, a pressing ring and a sealing sleeve, the pressing cover, the pressing cap, the pressing ring and the sealing sleeve are each provided with a through hole for the connecting cable to penetrate through, and the outer side of the connecting cable is sequentially sleeved with the sealing sleeve, the pressing ring, the pressing cap and the pressing cover from inside to outside. The circuit board is installed in an inner cavity of the sensor shell. The outer surface of the first end of the pressing cover is connected with the inner wall of the top of the sensor shell in a matched mode. When one end of the connecting cable is connected with the circuit board of the inner cavity of the sensor shell, the inner wall of the second end of the pressing cover is matched with the outer wall of the pressing cap, the pressing ring can be axially pressed, the sealing sleeve can be axially pressed through the pressing ring, and therefore the connecting cable is clamped, and the waterproof and dustproof effects are achieved. Compared with the prior art, a sensor connecting cable can be clamped to achieve waterproof and dustproof effects, and the structure of the sensor is easy to miniaturize.