I am in need for a low cost light detector that has a use settable trigger point for the light/dark threshold. My first thought has been to just set up a voltage divider in the following way. +5V | | | | | 500K | | | | |--------- PIC ADC | | | | | | LDR | | | | --- The LDR has >500K resistance in darkness and 3K-20K at 10 Lux. One could use a PIC output pin to feed the divider instead of the +5V and just activate this when a measurement is needed. Is there any drawbacks with such a scenario? Is there a better way to do this in a low cost way? /Ake --- Ake Hedman (YAP - Yet Another Programmer) eurosource, Brattbergav=E4gen 17, 820 50 LOS, Sweden Phone: 46 657 413430 Cellular: 46 730 533146 Company home: http://www.eurosource.se Kryddor/Te/Kaffe: http://www.brattberg.com Personal homepage: http://www.eurosource.se/akhe -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.