An image forming apparatus comprising an image forming unit configured to form an image on a recording medium (M); an adjustment unit configured to adjust a condition for image formation, based on an output from a sensor device ; a printer housing 2200; an operation panel; and the sensor device comprising: a light source ; a photo-detection system configured to receive light emitted from the light source and reflected at a sheet-like object (M), whereby such a recording medium (M) is the object (M); and a holding member configured to hold the object (M) such that relative positions of a surface of the object (M) inserted into the sensor device and the photo-detection system are fixed; the sensor device further comprises a housing , having an inner space accommodating the light source , the photo-detection system and the holding member ; characterized in that: the sensor device is detached from the printer housing and is disposed near an operation panel, such that an operator can pick it up with his/her hand; the housing of the sensor device comprises a -X side surface, a -Y side surface and a +Y side surface in a XYZ Cartesian coordinate system, and has a slit into which the object (M) is inserted, the slit being formed in the -X side surface, having a prescribed length in the X-direction and penetrating to the -Y side surface and the +Y side surface of the housing; and the sensor device is configured such that the sheet-like object (M) can be inserted into the slit in a + X-direction by an operator holding the sheet-like object (M) with both hands and applying tension in the +Y and -Y directions to the sheet-like object (M). a light source ; a photo-detection system configured to receive light emitted from the light source and reflected at a sheet-like object (M), whereby such a recording medium (M) is the object (M); and a holding member configured to hold the object (M) such that relative positions of a surface of the object (M) inserted into the sensor device and the photo-detection system are fixed; the sensor device further comprises a housing , having an inner space accommodating the light source , the photo-detection system and the holding member ; characterized in that: the sensor device is detached from the printer housing and is disposed near an operation panel, such that an operator can pick it up with his/her hand; the housing of the sensor device comprises a -X side surface, a -Y side surface and a +Y side surface in a XYZ Cartesian coordinate system, and has a slit into which the object (M) is inserted, the slit being formed in the -X side surface, having a prescribed length in the X-direction and penetrating to the -Y side surface and the +Y side surface of the housing; and the sensor device is configured such that the sheet-like object (M) can be inserted into the slit in a + X-direction by an operator holding the sheet-like object (M) with both hands and applying tension in the +Y and -Y directions to the sheet-like object (M). the sensor device is detached from the printer housing and is disposed near an operation panel, such that an operator can pick it up with his/her hand; the housing of the sensor device comprises a -X side surface, a -Y side surface and a +Y side surface in a XYZ Cartesian coordinate system, and has a slit into which the object (M) is inserted, the slit being formed in the -X side surface, having a prescribed length in the X-direction and penetrating to the -Y side surface and the +Y side surface of the housing; and the sensor device is configured such that the sheet-like object (M) can be inserted into the slit in a + X-direction by an operator holding the sheet-like object (M) with both hands and applying tension in the +Y and -Y directions to the sheet-like object (M). <EOS>