Patent ID: 7268337

Claim:
An optical sensor comprising: a light receiving element in which a current corresponding to the amount of received light flows between one end and the other end thereof; a comparator which compares a voltage at the one end of the light receiving element with a predetermined threshold voltage to output a logical signal based on the comparison result; an initialization circuit which initializes the voltage at the one end of the light receiving element to the predetermined threshold voltage or a voltage approximate to the threshold voltage before detecting the amount of the received light, the predetermined threshold voltage or a voltage approximate to the threshold voltage being derived from the comparator; and a voltage changing circuit which changes the voltage at the one end of the light receiving element by a predetermined voltage after completing the initialization, wherein, after changing the voltage by the voltage changing circuit, a period until the logical signal output from the comparator is logically inverted is expressed as a value corresponding to the amount of the received light.