Measuring light with a photodiode