Thanks Neil, Doing mostly software work for the last decade... Why does the ADC input see the two resistances in the divider in parallel as its input impedance? Why isn't it just the LDR that set this? Sorry if this is a very dumb question... I plan to use the 12F675 and you are right there is a 10K recommended impedance of the analog voltage source. I', glad I asked the question. Nothing is ever as simple as it first look is it! /Ake -----Ursprungligt meddelande----- Fr=E5n: pic microcontroller discussion list [mailto:PICLIST@MITVMA.MIT.EDU]F=F6r PicDude Skickat: den 18 april 2004 20:31 Till: PICLIST@MITVMA.MIT.EDU =C4mne: Re: [EE:]Light detector There is a 10k maximum input impedance requirement for the 16F PIC's, which you will exceed with this setup. IIRC, it's about 1/4 of that for the 18F series. You should be able to do this successfully with a lower-resistance LDR. I picked one up from digikey ages ago with a range of 4k - 11k ohms, which when combined with the fixed resistor in the voltage divider, will let the PIC input see an impedance in it's required range. (The PIC input sees an impedance of the parallel combination of both resistors in the divider). Alternatively, if you have an LDR with a slightly higher resistance than will meet the PIC's input impedance specs, you could try paralleling the LDR with another resistor, but you'll lose some linearity (which should not really 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 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. -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.