Patent ID: 8290388

Claim:
An image forming apparatus comprising: a sensor configured to detect a state of an object present in a detection area, the sensor having a light emitting section and a light receiving section, the light emitting section irradiating the detection area with light, the light receiving section receiving the light from the detection area and outputting a light sensitive signal indicative of an amount of the received light; a processor; and a memory storing machine readable instructions that, when executed by the processor, cause the image forming apparatus to operate as: a sensor adjustment section configured to adjust a sensitivity of the sensor to a target level by varying a set value of an adjustable characteristic value associated with the sensitivity, the set value of the adjustable characteristic value being adjusted to achieve the target level of the sensitivity based on explorative measurement of the adjustable characteristic value corresponding to a predetermined reference level of the light sensitive signal, the explorative measurement being performed while the detection area is in a predetermined state; an estimation section configured to obtain a measurement value associated with an amount of a leakage current generated on the light receiving section and to estimate based on the measurement value whether the amount of the leakage current is larger than a reference amount; and a mitigation section configured to mitigate influence of the leakage current on the explorative measurement, by at least one of adjustment of the light receiving section for reduction of the leakage current and modification of the predetermined reference level, if the estimation section estimates that the amount of the leakage current is larger than the reference amount.