A sensor comprising: a main drive gear mounted on a shaft that is subjected to detection by the sensor such that the main drive gear is rotatable integrally with the shaft; at least one driven gear meshing with the main drive gear; a sensor housing accommodating the main drive gear and the at least one driven gear, the sensor being configured to detect a rotation angle of the shaft based on rotation of the at least one driven gear that rotates with the main drive gear, the at least one driven gear being supported in the sensor housing such that the at least one driven gear is rotatable and movable in a radial direction of the main drive gear, and the at least one driven gear being caused to mesh with the main drive gear by inserting, in the sensor housing, the shaft on which the main drive gear is mounted; a biasing member biasing the at least one driven gear toward the main drive gear; and a conversion mechanism configured to convert an axial force that is parallel to an axial direction of the shaft and acts on the at least one driven gear to a force in such a direction that the at least one driven gear is separated from the main drive gear when a part of the at least one driven gear contacts a part of the main drive gear while the shaft is inserted in the sensor housing, characterized in that two driven gears are mounted as the at least one driven gear; each of the two driven gears includes a gear portion meshing with the main drive gear and a shaft portion supported by the sensor housing; and the biasing member is a helical torsion spring including a coil portion supported in the sensor housing, a first arm biasing the shaft portion of one of the two driven gears toward the main drive gear, and a second arm biasing the shaft portion of the other of the two driven gears toward the main drive gear. a main drive gear mounted on a shaft that is subjected to detection by the sensor such that the main drive gear is rotatable integrally with the shaft; at least one driven gear meshing with the main drive gear; a sensor housing accommodating the main drive gear and the at least one driven gear, the sensor being configured to detect a rotation angle of the shaft based on rotation of the at least one driven gear that rotates with the main drive gear, the at least one driven gear being supported in the sensor housing such that the at least one driven gear is rotatable and movable in a radial direction of the main drive gear, and the at least one driven gear being caused to mesh with the main drive gear by inserting, in the sensor housing, the shaft on which the main drive gear is mounted; a biasing member biasing the at least one driven gear toward the main drive gear; and a conversion mechanism configured to convert an axial force that is parallel to an axial direction of the shaft and acts on the at least one driven gear to a force in such a direction that the at least one driven gear is separated from the main drive gear when a part of the at least one driven gear contacts a part of the main drive gear while the shaft is inserted in the sensor housing, characterized in that two driven gears are mounted as the at least one driven gear; each of the two driven gears includes a gear portion meshing with the main drive gear and a shaft portion supported by the sensor housing; and the biasing member is a helical torsion spring including a coil portion supported in the sensor housing, a first arm biasing the shaft portion of one of the two driven gears toward the main drive gear, and a second arm biasing the shaft portion of the other of the two driven gears toward the main drive gear.