Temperature sensor suitable for measurement of movable or replaceable parts of machines and devices, e.g. bearings or injection moulds. Equipped with bayonet fitting that enables quick and easy installation in the measured element. Furthermore, the sensor has a spring that protects the flexible cable. The cap of a bayonet fitting can be easily moved across the spring enabling the adjustment of sensor immersion length.