Photoresistors - lux from resistance, lets get to the bottom if it

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:
image

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

If you really mean lux in terms of lumens per square meter as perceived by the human eye, your only option is to make a table of the resistance values versus the output of a commercial, calibrated lux meter, for a well defined source of illumination.

Unfortunately that will depend on the spectrum of the illumination, so the table will be valid for only the light source used for calibration.

It really is a problem to measure and compare light intensities, given the many different measurement definitions in use and many different types of light sources. In practice you have to decide what your particular goal is in making the measurement, and find something that works.

Actually the resistance is increasing as we increase the luminosity

Either you are not measuring the resistance correctly, or the sensor is not a conventional LDR.

1 Like

Maybe, just to annoy you, they left out the minus sign of S (because, of course, the minus is the default and you ought to know that...).

By the way: samsung phones have a built in lux meter...

And usually people combine a ldr with some potentiometer for calibration...

And the slowness of an ldr can be an advantage...
In a car riding along a set of trees you do not want to have an auto adjust of screen brightness 10 times per second...

Yes sir, you are correct!
No idea why they left the (-) sign out, but it helped.
Changing the script a bit, I've plotted the table values Addafruits have in their pdf. If we change the R10 value to match Addas. (10kOhm) and keeping the S parameter -0.8, as we don't know any better, we get quite a reasonable estimate:


Keeping in mind that adda. probably did not measure the lux precisely.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.