Convert LDR's resistance to lux, or another unit of light?

Hello!
I know how to calculate the resistance of the variable resistor (usually sensor [in this case, LDR]) in a circuit (voltage divider) like this:

[GND] ---- [10k ohm resistor] ---- | ---- [LDR] ---- [5V]
                                   |
                           [Analog Input A0]

This is the formula for resistance of LDR in ohms ("resistor" is the 10k ohm resistor):

resistance = 1024.0 * resistor / ADC - resistor;

I am using this LDR included with the Sparkfun Arduino Starter Kit: http://www.sparkfun.com/datasheets/Sensors/Imaging/SEN-09088-datasheet.pdf. How can I convert the resistance to a unit of light, such as lux?

Basically you can't.
At least not easily, this is because the reading you get has a non linear relationship with a Lux light measurement. If you calibrated your sensor you might be able to use a look up table. It a 10 bit D/A will not give you much of a range.

Grumpy_Mike:
If you calibrated your sensor you might be able to use a look up table.

How to do?

Grumpy_Mike:
At least not easily, this is because the reading you get has a non linear relationship with a Lux light measurement.

But isn't the relation always the same? That is: when the LDR's resistance is x ohms, the ambient light is y lux. You can't use a formula, but is there an online converter? If not, then is there an easy to read look up table?

You calibrate your sensor bu measuring the light with your sensor and the same light with a sensor that gives a reading in Lux. So you build up a table of your reading verses the true light level.

As your sensor and circuit is probbly not what others have then there is not likely to be an online look up table ready for you.

To calibrate the sensor you will need to build a relationship between the reading you get and a lux value you measure externally with some sort of instrument/meter. This will allow you to build a table of redings/lux.

What you can then do with this is:

  1. Use the table in your code and extrapolate between values (eg, table value for reading 10 and 20, you get 15 and interpret the lux value as being between the values for 10 and 20).
  2. Put the numbers into something like Excel, see if the relationship can be defined as a function (Excel will allow you to work out the parameters) and then use the function 'formula' to get the lux from reading.

The second methnid can work if the relationship is well expressed by the function. The first is easiest to implement immediately. Either way you need to build the relationship table.

I don't have any lux sensor, so I cannot calibrate!

Do you know anyone who is a photographer? Their light meters are 'lux meters' ...

Correct.
The other alternitave is to try and get a calibrated light source.

That is why candel power was used for a time. A standard candel was used with controlled dimensions and chemical constitutes and wick.

Isn't that candle?

Doc

Yes, dyslexia and an iPad are not a good combination.

This tutorial at LadyAda might help

so I cannot calibrate

Grease spot photometer?

Hmm interesting stuff, according to this:

You take a candle (that must be the standard candle Grumpy_Mike is taking about) and put your sensor 1 meter away and it should show 1 Lux. Unfortunately it isn't linear, so you can't just use 2 candles and measure 2 Lux.

More practically, you can get Luxmeter App's to Android and Iphone

JimboZA:
This tutorial at LadyAda might help

I already saw that. They have a hard-to-read chart.
I wish that there was an online converter. You enter the type of LDR (e.g. product number), the resistance, and it gives you the lux value.

So what was it about reply #3 you did not understand?