The lux (symbol: lx) is the SI unit of illuminance and luminous emittance, measuring luminous flux per unit area.
This library implements a way to estimate lux given a LDR resistance value read from an ADC input pin of an AVR Atmega.
The estimation is based on this formula:
lux = A*((R/B)^C)
where R is the LDR resistance.
An Excel spreadsheet is provided to help the estimation of A, B and C values. You have to read lux values using a calibrated luxmeter, and the R values of your LDR, write it down on the Excel sheet, and estimate A, B and C, power regression can help you estimating values.
Code
Notes
- read risk disclaimer
- excuse my bad english
lux = A*((R/B)^C)
ReplyDeleteWhat's meaning in above formula
Hello, that's a power regression.R is the LDR resistance, A, B and C are values dependant on the LDR model.
DeleteHello Davide,
ReplyDeleteI'm Song and nice to meet you. May I ask you for a few question? please.
For your excel spreadsheet can use for any LDR or not?
Could you suggest me how to estimate the A, B, C and formula?
Thank you so much,
Song.
Hello.
DeleteWrite down some values read from a calibrated lux meter. And the values of the resistence of your LDR exposed to the same amount of light of the lux meter sensor. Then, you could use matlab and do power regression, or simply put the value you read in the spreasdheet provided and by hand try to find the best A, B, C parameter to fit the curve for your LDR. Hope this helps.
Hello Davide,
DeleteI got it. I'll try follow your suggestions.
Thank you so much.
Song,
easier equation to fit for a log-log (power) behaviour is:
ReplyDeleteLux=R^a*10^b, only 2 fit parameters (a,b), hence it will faster converge even with very off-start values.