when using an ldr, make sure that it doesn't get wet!
i had some ldr's (different types) in use in outdoor units. they worked
well for about 1-2years, but suddenly, they started to indicate bright
sun, as soon as it started to rain. seems that the transparent plastic
cases of these units weren't best quality!
>From: [hidden email] [mailto:[hidden email]]
>On Behalf Of William Bross
>Sent: Monday, June 06, 2005 2:43 PM
>To: Microcontroller discussion list - Public.
>Subject: Re: [EE] Light level measurement with LDR
>I've been using just the LDR and a pull up resistor for years
>1. Set your PIC pin for digital input.
>2. Look up the light and dark resistances of the LDR.
>3. Size the pull up to make sure that the LDRs output swings
>and below the hi threshold level of the PIC pin.
>4 Add a little hysteresis code to keep it in one state or the
>enough to keep it from 'flashing'. I typically use about 30 seconds.
>Can't get any more dirt bag or cheaper than this.
>Peter Onion wrote:
>>I want to add a light level sensor to a clock I'm building so that at
>>night the back light is dimmed. ( I could use the time of day, but
>>sunrise/sun set calculations look a bit hard for a PIC (lots
>>Has anyone got any simple circuit ideas to get a "reasonably linear"
>>voltage from a typical LDR that has a log/log characteristic ?
>>The **ideal** would be a linear output with Night = 0v and
>Day = 5v to
>>feed into a ADC on the PIC which will then program the PWM output to
>>dim the back light. In practise something that gives a reasonable
>>swing over the dawn/dusk periods will do the trick.
>http://www.piclist.com PIC/SX FAQ & list archive
>View/change your membership options at