I am very new to Arduino and I need to create an embedded system that measures light intensity by using a primary sensor as a solar panel and a backup sensor as a photodiode. I can change sensors by using a push button. Here is my question, does anyone know how to convert the values coming from solar panel or photodiode into Lux.
Thank you for your respond and the thing is I got this as an assignment. So I need to use solar and photodiode somehow to do the assignment. I did search a lot, but nothing could found related to this.
It sounds like you are using the photovoltaic effect of the photodiode. "several hundred milli-volts" is actually quite high for a conventional photodiode. On the Arduino Uno (which you have pictured in your Tinkercad project) you can set the voltage reference down to 1.1 volts but that may not help you if you have to "use all the 10-bit values in Arduino ADC". It looks like you have to use an OpAmp. The Arduino Uno does not have a built-in OpAmp. If the OpAmp is powered from 5V and you are using the 5V voltage reference there will be no need to protect against "a flash of light" causing an over-voltage pulse. If there is not a linear relationship between the light intensity and the voltage delivered to the Arduino, you may need a mapping table or some other representation of a formula.
To measure light intensity, measure the short circuit current of the photodiode or solar panel (the open circuit voltage is not useful). That can be converted into lux using a calibration factor. The easiest way to determine that factor is by measuring the actual light intensity with a commercial, calibrated lightmeter.
Start experimenting with the solar panel.
Your circuit is not working, because it measures panel voltage.
Panel voltage is fairly constant with varying levels of sunlight, so not a good indicator.
You should be measuring panel current, which is linear with solar irradiation.
To measure panel current, put a low value (shunt) resistor across the panel, to (almost) short the panel. That leaves a small voltage (<1volt) that is mainly depending on panel current.
Which panel do you have.
I have tried a 6volt/160mA panel, with a 6.8 ohm resistor across, connected to ground and A0 of an Uno R3. That did give me A/D values of ~300 inside with morning sun and this code.
You can optimise/change the resistor (5 to 10 ohm?) to give A/D values of ~1000 in full noon sun, which you then can convert to lux values.
Leo..