To provide an encoder capable of replacing a circuit substrate, without removing a sensor from a motor body nor exposing the sensor and a magnet to the outside air.
A sensor protective cover 5 which protects the magnet 3 and the sensor 6 is detachably attached to a motor body 4, and a circuit board protective cover 9, which protects the circuit board 7, is detachably attached at the sensor protective cover 5, the circuit board 7 is detachably attached on the inner side of a circuit board protective cover 9, and a sensor signal lead wire 10 connected with the sensor 6 is detachably connected to the circuit board 7. As a result, since the circuit board 7 can be replaced by removing the circuit substrate protective cover 9, this dispenses with the need for the removal of the sensor protective cover 5 which protects the magnet 3 and the sensor 6 from the motor body 4, and removal of the sensor 6 which does not need to be replaced from the motor body 4 is obviated.
ONO KOJI