Hello Alan, > First, I would dispense with the 10uF capacitor, this is likely to have > leakage current that will upset the reading, especially as the resistance of > the LDR gets higher under low light conditions, which is probably where you > want to be most accurate. I was already thinking about the needs of that capacitor. I've removed it and the behaviour of the circuit seens a bit better. > Second, the circuit you show will have a very non-linear output against > light level. Again it will show the greatest change at reasonable light > levels, and be worst at the dark end, which again, is probably where you > want the most accuracy. Yes, this is why I have that formula [lux = (63750/adcResult-250)] on the software. The resistance of LDR is almost linear with incident light. Something like R=500/lux (for R in kOhms). So, luminous intensity on the output of the voltage divider is: Vo=(4.7/(4.7+(500/lux)))*5 And with some algebric manipulation and scalling to ADC reading values (0-255) I've came with: lux = (63750/adcResult-250) Obviously, I'm mistaken somewhere... > Whatever circuit you use, you may need to have some tables in your >program that you can use to stepwise linearise the output. Yes, but I preffer a more general formula. There is a PIC18F252 for this simple task, so I have plenty of processing power to make calculations. Thank you, Brusque -- --------------------------------------------------------------------- Edson Brusque C.I.Tronics Lighting Designers Ltda Research and Development Blumenau - SC - Brazil http://www.suporte.ind.br/ryan/netiqueta.htm www.citronics.com.br --------------------------------------------------------------------- _______________________________________________ http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist