I've spent some time looking for a answer to rather simple question - how to calculate luminosity [lux] from photoresistor resistance [Ohm], sadly to no avail. So, I think its time someone actually posted a answer to this on a forum for others to find.
It is quite funny, but nor wiki, nor datahsheets seem to show any equation how to actually use photoresistors. As if they were to be used by just looking at the number and saying "Ahh yes, 100 kOhm, that must mean somewhat darker than full Sun but not as dark as complete darkness"
Here is what we know:
- Photoresistor decreases its resistance when illuminated.
- This is caused by more charge carriers being freed in the semiconductor thanks to the light.
- Different photoresistive materials are sensitive to different wavelengths of light.
- The relation between resistance and luminosity is non-linear:
ie: R != a+ b*E, but rather R = f(E) where:
R is resistance [ohm]
E is luminosity [lux]
a,b are some constants
f() is some non-lin function
- Photoresistors suck
- (+) they are cheap
- they are not precise at all
- Specific values from piece to piece can apparently vary by like 50% and more
- Assuming you even find the datasheet
- They are really slow (time constant of 20ms is a lot)
- Nonlinear AF
- They are in every cheap luminosity module
- There is minimal info in the datasheets
But there might be applications where precision is not needed and you already have one on hand since you bought it somewhere for 1usd.
Example application:
I've got a module with photoresistor pointing out of a window and I want to log the light level outside. Since I know the accuracy is bad, I do not expect to get correct reading in lux, but I can still find the minimum, maximum, and log the light in %. However to make some sense of the data, I'd like for the scale of the logged data to be linear.
Assuming I do not have reference luminosity meter to build a look-up table, and I know how to get the resistance of photoresistor from module output voltage.
Finding the equation
Looking at some lux-resistance plots, which are log scale, the dependency looks almost linear (at log scale), so I'd guess that the dependency is some sort of y = ax^b.
Looking into the datasheets, we find parameter called sensitivity S [ohm/lux] defined as:
![]()
where R100 and R10 are photoresistor resistances at luminousity E100 and E10. Also it is obvious that E100 = 100lux and E10 = 10lux.
Parameter R10 is specified (by quite a wide range), however we can assume we know it.
We can substitute the E100 with y as unknown variable, R100 as known variable and the rest are known constants. For S=0.8 (purely parametric gets you a lot of different discontinuities ) we get:
(also p10 = e10, its to not confuse wolfram with Euler number)
(no idea how to actually solve this equation, bonus points for the one who can)
so the solution is:
E = 10*(R/R10)^(1/S) [lux]
where:
E is luminosity [lux] corresponding to resistance R [ohm]
R10 is constant [ohm] corresponding to luminosity 10 lux
S is sensitivity [ohm/lux].
However plotting this equation for parameter estimated based on a datasheet we get:
This does not look like the curve from Adafruits pdf. Actually the resistance is increasing as we increase the luminosity, which is opposite of whats supposed to be happening.
I know that we got E as dependent variable on R, and the plot is the other way, but the equation should hold true no matter which of them you say is dependent
So, what wrong?
If you guys can spot a failure in the thought process, or know something more please point it out. It feels strange to me that probably everyone used these devices at some point when playing with Arduino, however noone came up with some simplified equation to estimate the values yet.
Cheers
Sources
htt ps://www.electroduino.com/ldr-sensor-module-how-ldr-sensor-works/
htt ps://forum.arduino.cc/t/display-lux-with-ldr/100389/5
htt ps://www.mantech.co.za/datasheets/products/MLGXXXX.pdf
htt ps://media.digikey.com/pdf/Data%20Sheets/Photonic%20Detetectors%20Inc%20PDFs/PDV-P8104.pdf
I can sadly embed only three images, so please find the resistance lux dependency in the first link.
I can also embed only 4 links, thats why htt ps://...
#photoresistor #math #LDR


