To reduce an installing space and simplify a mounting structure of a
sensor (40) of a rotary encoder, a sealing device with a sensor has a
retainer (10) having a fitting tube section (11) and an installation
flange section (12) expanding outside thereof and fixed to an engine
block (2), and a sealing device body (20) fitted to the fitting tube
section (11) and slidably contacted with an outer surface of the crank
shaft (4), a sensor (40) detecting a rotation of a pulsar ring (30)
rotating together with the crank shaft (4) is attached to a sensor
installation section (13) in the installation flange section (12), and a
pulsar body (32) of the pulsar ring (30) is formed in a cylindrical shape
and extends in a circumferential direction coaxial with the fitting tube
section (11) between the fitting tube section (11) and the sensor
installation section (13).