Calibrate CNY70 reflective optical sensor ?

Hi,

I have a CNY70 sensor which I use in my project.

I want the sensor to give out the same value when I hold my finger 1 cm in front of it. However, depending on whether I use it during the day (daylight) or during the evening (artificial light) it gives me different readings.

How can I resolve this problem?

Thanks,
Joël

You could detect the amount of daylight, using a photo diode, determine a relationship between ambient light level and the returned reading, and compensate.