sunlight sensor

omega4586:
Hello folks,
i'm working on a solar panel trying to predict the output in function of the ambient light using a microcontroller, i need to measure accurately the ambient light outside, in a sunny day and get an accurate measurement, i don't care about get it a particular unit i just want have an accurate measurement after the conversion to a digital value to feed it into a function.

You know, that the light intensity has a dynamic of about 1 to ~1 million?
How will you expect to measure with an analog input, that has a dynamic of 1 to 1000?
You will need a log function upfront if you want to avoid saturation.

Else, a compromise is to use a BH1750 module. You will get a dynamic of 1-65.500.
They are dirty cheap and ways better than trying to fiddle with photosensors.

You know, that the output of a solar panel is also a function of light color and panel temperature?
The color and temperature response of your panel and that one of your sensor won't match.