Patent attributes
An electronic device may be provided with a proximity sensor. The proximity sensor may include a light source such as a light-emitting diode and a light detector such as a photodiode. The light-emitting diode may be driven with an alternating current drive signal so that alternating current light is produced. The alternating current light may reflect off of an external object and may be received by the photodiode. The photodiode may receive a direct current light signal associated with the presence of ambient light. The efficiency of the photodiode may be affected by the level of ambient light and the efficiency of the light-emitting diode may be affected by the temperature of the light-emitting diode. Ambient light correction circuitry and temperature correction circuitry may be used to ensure that proximity sensor readings are not adversely affected by changes in operating temperature and ambient lighting conditions.