There is a 10k maximum input impedance requirement for the 16F PIC's, whi= ch=20 you will exceed with this setup. IIRC, it's about 1/4 of that for the 1= 8F=20 series. You should be able to do this successfully with a lower-resistance LDR. = I=20 picked one up from digikey ages ago with a range of 4k - 11k ohms, which = when=20 combined with the fixed resistor in the voltage divider, will let the PIC= =20 input see an impedance in it's required range. (The PIC input sees an=20 impedance of the parallel combination of both resistors in the divider). Alternatively, if you have an LDR with a slightly higher resistance than = will=20 meet the PIC's input impedance specs, you could try paralleling the LDR w= ith=20 another resistor, but you'll lose some linearity (which should not really= =20 matter if all you need is a threshold). Cheers, -Neil. On Sunday 18 April 2004 01:05 pm, Ake Hedman scribbled: > 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 t= o > 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 d= o > 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.