A detection device which detects a state of a moving member such as an origin position of the moving member in a short time, is provided with a dog which includes the multiple slits, in which at least one of a separation distance between adjacent slits and a width of the slits themselves is formed in multiple kinds, a sensor which detects the presence or absence of the slits, a count position acquisition section which acquires a count start position and a count end position corresponding to the separation distance between the adjacent slits or the width of the slits themselves based on detection results of the sensor, and a state detection section which acquires a count value increase or decrease number from the count start position to the count end position and detects a state of the moving member based on the acquired count value increase or decrease number.