Ambient light compensation device for an optical sensor exposed to useful light and ambient light, comprising - a lateral drift field photodiode comprising a radiation-sensitive surface on a charge generation area, including a dopant, of a semiconductor substrate in which charge carriers are formed upon exposure, - wherein the lateral drift field photodiode is provided with a first transfer gate electrode for discharge of charge carriers from the charge generation area that result from exposure of the radiation-sensitive surface exclusively by ambient light, to a first output connection of the lateral drift field photodiode, and with a second transfer gate electrode for discharge of charge carriers from the charge generation area that result from exposure of the radiation-sensitive surface by useful light and ambient light, to a second output connection of the lateral drift field photodiode, and - a control unit for alternate control of the two transfer gate electrodes (16,18), wherein the control unit comprises a signal store for storage of an ambient light signal representing the ambient light received by the radiation-sensitive surface of the lateral drift field photodiode, - wherein the radiation-sensitive surface of the lateral drift field photodiode is adapted to be exposed, in pause intervals, exclusively to ambient light and, in illumination intervals, to both ambient light and useful light, - wherein, by control of the two transfer gate electrodes (16,18) in synchronism with the pause and light-exposure intervals (P,B), the first output connection has applied to it the ambient light signal representing the exposure of the radiation-sensitive surface of the lateral drift field photodiode exclusively by ambient light, and the second output connection has applied to it an ambient and useful light signal representing the exposure of the radiation-sensitive surface of the lateral drift field photodiode by ambient light and useful light, - wherein the ambient light signal applied to the first output connection in a pause interval is stored in the signal store, and - wherein, for generating a signal which represents the useful light compensated for the ambient light, the signal stored in the signal store is subtracted from the ambient light and useful light signal which is applied to the second output connection of the lateral drift field photodiode in the light-exposure interval following the pause interval, characterized in that the signal store is configured as a current mirror which comprises two current sources (32,34) that are coupled by a sample and hold circuit, wherein one current source is connected to the first output connection of the lateral drift field photodiode and the other current source is connected, via a subtraction switch, to the second output connection of the lateral drift field photodiode, wherein the control unit is operative to open the subtraction switch in a pause interval and to close it in a light-exposure interval. - a lateral drift field photodiode comprising a radiation-sensitive surface on a charge generation area, including a dopant, of a semiconductor substrate in which charge carriers are formed upon exposure, - wherein the lateral drift field photodiode is provided with a first transfer gate electrode for discharge of charge carriers from the charge generation area that result from exposure of the radiation-sensitive surface exclusively by ambient light, to a first output connection of the lateral drift field photodiode, and with a second transfer gate electrode for discharge of charge carriers from the charge generation area that result from exposure of the radiation-sensitive surface by useful light and ambient light, to a second output connection of the lateral drift field photodiode, and - a control unit for alternate control of the two transfer gate electrodes (16,18), wherein the control unit comprises a signal store for storage of an ambient light signal representing the ambient light received by the radiation-sensitive surface of the lateral drift field photodiode, - wherein the radiation-sensitive surface of the lateral drift field photodiode is adapted to be exposed, in pause intervals, exclusively to ambient light and, in illumination intervals, to both ambient light and useful light, - wherein, by control of the two transfer gate electrodes (16,18) in synchronism with the pause and light-exposure intervals (P,B), the first output connection has applied to it the ambient light signal representing the exposure of the radiation-sensitive surface of the lateral drift field photodiode exclusively by ambient light, and the second output connection has applied to it an ambient and useful light signal representing the exposure of the radiation-sensitive surface of the lateral drift field photodiode by ambient light and useful light, - wherein the ambient light signal applied to the first output connection in a pause interval is stored in the signal store, and - wherein, for generating a signal which represents the useful light compensated for the ambient light, the signal stored in the signal store is subtracted from the ambient light and useful light signal which is applied to the second output connection of the lateral drift field photodiode in the light-exposure interval following the pause interval,