Info on selection of series Resistors with LDR

westaust55

Moderator
Some information that may be useful to others who decide to experiment with Light Dependant resistors.

I was curious about the variation in the value of the resistor to put in series with an LDR as shown in various PICAXE documents.
PICAXE manual 1 on page 59 shows a 10 KOhm resistor as does AXE050 and AXE092 datasheets.
PICAXE manual 3 on page 28 shows a 100 kOhm resistor.

Being one to try and optimise such things for the best resolution, I started out to see what might best suit my LDR to maximise the voltage range into the analogue input of a PICAXE and have gone a bit further looking at data for several readily available LDR’s being sold here in Australia. Turns out that my own sample is out of spec but to my advantage. Most LDR’s have a fair range of ohmic values for maximum light conditions.

It turns out that based upon the published data, the optimal value for the external series resistor can vary dramatically from 33 kOhm through to 1.2 MOhm with a 2 to 1 ratio for a given LDR depending upon what the LDR’s resistance value is under bight/light conditions.

While for some models of LDR, a 100 kOhm resistor will only result in a small drop in the voltage input range, at least one type of LDR will result in a 21% to 38% reduction in input voltage range to the PICAXE with a 100kOhm resistor and up to 72% drop in available range if the frequently suggested 10 kOhm resistor is used.
Attached is a table I have prepared showing the available analogue input voltage range (as a percentage of the supply voltage – 5Vdc) for some available LDR’s and the effect of various series resistors.

In summary, it is worth measuring the resistance range of your LDR and selecting a series resistor to get the maximum possible voltage range into your PICAXE.
 

Attachments

Dippy

Moderator
That's a keen bit of work WA.

May I ask a question or two.

1. Did you get the LDR specs from a Data Sheet and then 'simulate' the ranges with a pot.?

2. I don't see any measured real ADC values?
The reason I mention this is because at lower light levels using LDRs usually results in high impedances. And usually too high for reliable ADC measurements. Microchip suggest 10K source impedance to keep spec. on most PICs (lower on some). Showing the non-linearity would have been interesting to see if the given 10K recommendation is pessimistic.
 

westaust55

Moderator
Hi Dippy,

The data other than for my “sample” LDR came from supplier specs.
The values were actually calculated (spreadsheets make these things very easy) but do correlate well with my single sample LDR within a degree of tolerance.

I did not use a pot but tried readings with the LDR blanked and subject to a bright light using several different series resistor values.
Attached are the readings including calculated (expected) and actual READADC results for my LDR.

The light I used for these attached results gives an LDR resistance under bright light of 600 ohms whereas I had used a torch for the earlier 1500 Ohm reading – not that there is a lot of difference.

Edit:
I was just looking thru the Exemplar Student projects and on looking at the Datalogger schematic therein, I note that the series resistor with the OPR12 LDR is 1 KOhm. So quite a range (1 kOhm, 10 kOhm and 100 kOhm) even within Revolution PICAXE documentation

--------------------------------------------------------------------------
The first day you don't learn something new is your first day in a wooden box
 

Attachments

Last edited:
Top