How to accurately measure the resistance of an LDR?

Started by moid, September 06, 2022, 08:44:16 AM

Previous topic - Next topic

moid

Hi everyone
I realise that this might be a 'how long is a piece of string' question, but a few years ago I was late night surfing ebay when I happened upon an amazing deal for 100 odd LDRs of differing values, so of course I bought them... they arrived a month or so later, I stashed them in my parts box... and forgot about them.

Recently I built a pedal with an LDR in it, and as the layout didn't specify what value LDR to use I thought I'd try out some of those cheap Chinese LDRs to see if they were any good... so looking at the bags they came in there is a cryptic glyph squiggle on each which doesn't look like arabic numbers / roman alphabet or even Mandarin, so that's not much help regarding their value (I have asked a colleague who can read Mandarin and he says he doesn't think it's Mandarin unless it's something really badly hand written), so that's no help to me. I tried them in the pedal and didn't get any joy with them, in the end I used a 8/24K LDR I bought from a reputable seller and that worked fine. So the next thing I did was start to test a few of these cheap LDRs (to make sure they weren't duds) by attaching one leg to the positive probe of my DMM and one leg to negative and waving my hand over the LDR or shining a bright LED at them - and all the ones I tested did indeed show reaction to light levels (changing levels of resistance), however from this simple test I have no way of knowing what the actual manufacturer rating is for them, so my question is, is there a better way to test them which will tell me this infomation? Thanks!
Mushrooms in Shampoo -  Amidst the Ox Eyes - our new album!

https://mushroomsinshampoo.bandcamp.com/album/amidst-the-ox-eyes

ElectricDruid

I think your test is about as good as it gets.

LDRs are highly variable at the best of times. Shine the same light on them twice and you won't get two readings of the same resistance. Close-ish, sometimes. And when you put them in pitch dark, the resistance goes up...and up...and up...for many minutes. And how long it spends in this pitch black condition then affects what reading you'll get when you next put it in the light, and how quickly it'll get there too. So they're a nightmare to specify accurately!

I'd measure them to get a reasonable grip on what the lowest R you're likely to see is in bright light, and what the highest R (within a few seconds of darkness) is and leave it at that. That's enough to be able to get a compressor into the right ballpark, or get a phaseshift stage's capacitor adjusted into the audio range or whatever. After that, you tweak to taste.

moid

Thanks Tom! OK well that saves me worrying about how to measure them accurately, they sound quite random! I did wonder about how long to measure for; I noticed the resistance went up ridiculously if I left them covered by a thick black cloth, but it took them a minute or two to get to 10M. In that case I'll use a bright white LED as my maximum brightness that they are likely to encounter and then see what resistance they get to after a few seconds.
Mushrooms in Shampoo -  Amidst the Ox Eyes - our new album!

https://mushroomsinshampoo.bandcamp.com/album/amidst-the-ox-eyes

idy

I sometimes use a piece of heat shrink tubing. Pinch to make dark. Haven't gotten fancy enough to put LED in there with it....

PRR

> waving my hand over the LDR

Not very controllable or repeatable.

You need a tightly controlled light source. Ordinary incandescent is fine if your wall-voltage is consistent all the time, else think about an incandescent car tail-light bulb on regulated 12V power. Shielded so windows room lighting does not change the light a bit.

If you wanted ONE resistance you could buy a resistor. No you want more than one resistance, so you need more than one light level. You can mess with filters, old sun-glasses. Traditionally we varied the distance from lamp to photoresistor. Over some range of light levels, resistance is about proportional to distance. So if you are looking for 100:1 range of resistance you may try 2 inches and 200 inches (16 feet). So not a casual corner-of-desk setup.
  • SUPPORTER

stallik

Quote from: PRR on September 06, 2022, 07:53:57 PM
Over some range of light levels, resistance is about proportional to distance. So if you are looking for 100:1 range of resistance you may try 2 inches and 200 inches (16 feet).

Inverse square law states that (from a point light source), if you double the distance, you quarter the light. If the above statement is correct, this would mean that the LDR does not behave in a linear fashion.
If this is the case and the resistance is indeed proportional to distance then I have an idea.

Before I start constructing a physically large experiment in limited space, is it possible that you might expand on the comments 'some range of light levels' and 'about proportional' ?
Insanity: doing the same thing over and over again and expecting different results. Albert Einstein

merlinb

We're not making life support equipment here or working in a physics lab. Really all you need to know is:
"is the dark resistance in the tens-of-k range, or in the megohms range?"
and:
"is the light resistance in the hundreds-ohms range, or in the kilohms range?"
The vast majority of applications only care about that level of precision.

Dark resistance is easy of course, just measure it in the dark. Light is less controlled but since you're making music effects you're almost certainly going to be using a red LED, so just set up a red LED with realistic pedal-level current, and put your LDRs against it. You now have a setup that closely reflects how you will actually use the LDRs. That's how I bag mine up anyway.

PRR

Quote from: stallik on September 06, 2022, 10:40:26 PM
Inverse square law states ...

Correction welcome. If it is not near-linear then it may be near-inverse-square.

I think the experimenter will quickly see if I am full of crap, again.
  • SUPPORTER

Rob Strand

#8
The intensity (lux) drops as inverse square - it's like you have a 1mm^2 patch receiving only part of surface of an expanding sphere - the further out you go the less light goes through you collection area.     However when you are close to a distributed light source it will drop only as inverse.  (You get the same issues with speaker systems.)

https://www.egofelix.com/light-intensity-versus-distance/

What's not linear is the LDR resistance vs light level   Resistance is proportional to 1 / L^gamma, gamma is often around 0.9. so if you double the light level the resistance only drops by 1.87.   However different LDRs have different gamma's.

If you want to measure the dark resistance you might try a box in a box and then turn all the lights off.      Then you will have to choose how long you want to wait for the resistance to settle.

Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

Locrian99

Quote from: idy on September 06, 2022, 04:30:58 PM
I sometimes use a piece of heat shrink tubing. Pinch to make dark. Haven't gotten fancy enough to put LED in there with it....

This is how I have my shoot the moon tremolo set up.   LDR and LED connected with a piece of black heat shrink tubing going over the both of them.   Works great, I figured this way when boxed up I didn't have to worry about the LED for the effect being on shining light back through the bezel.   And I could test the effect the normal way without having to go crazy, though it worked fine on my test bench with just an enclosure over the top and the wires running out to a breadboard on the outside without the tubing.    As merlin mentioned I don't think the exacts are needed here. 

stallik

Quote from: PRR on September 07, 2022, 10:31:32 PM
Quote from: stallik on September 06, 2022, 10:40:26 PM
Inverse square law states ...
If it is not near-linear then it may be near-inverse-square.

Further research on my idea (non music related) shows that I am, as usual, barking up the wrong tree. Did come across a graph lux/resistance where the log of both produced a pretty straight line. That interests me me in another direction but for now, I'm going back to making sawdust.

Sorry if I've added any confusion to this thread
Insanity: doing the same thing over and over again and expecting different results. Albert Einstein