The schematic to test the LDR is very simple, like simple simple. Really the hard part is figuring out how to make reasonably standardized changes to the light to get a sense of it. You also kind of want to see what the light level is visually so you can have a frame of reference when looking at numbers later through an ADC output.
So this is what I came up with.
The schematic is just +5V to one lead of the LDR, then a 1K series resistor, and then GND.
What I’m going to do, is place the entire circuit inside the lightbox I use to take pictures of stuff for the website, and then measure the voltage drop across the 1K series resistor. First I’ll measure the voltage with ambient light, then add a primary light source, then add four light blocks one at a time to see what the difference is. The light blocks are made of highly technical postit notes cut down to fit on the little holder I’m using… which is an old UV lens filter. I checked before I took the photos and the presence of the filter had no effect on the voltage level.
So there we go, we have the system setup inside the light box, and ready to start measuring. Remember, this orange multimeter is autoranging, so you’ll have to look closely for the position of the decimal point.
[masterslider id=11]Light Level | Vmeasure | Difference |
---|---|---|
Ambient | 2.17V | N/A |
Primary | 1.12V | +1.95V |
Blocks: 1 | 2.98V | -1.14V |
Blocks: 2 | 2.48V | -0.50V |
Blocks: 3 | 2.13V | -0.35V |
Blocks: 4 | 1.85V | -0.28V |
As the amount of available light diminishes, the resistance of the photoresistor increases. From the measurements, it also looks like there is a diminishing return on the amount of light blockage you get when you place a sheet of postit note between an LED flashlight and a photo resistor. I decided to rerun the test with more blocks so I had more than four data points, and this is what the graph wound up looking like, pretty asymptotic as it approaches the resistance caused by whatever the ambient light is.
You would also expect that as the light decreases, and resistance increases, that the current flowing would decrease as well. Fortunately, since we know…
- The voltage input to the circuit as a whole, Vout of my Arduino measured at 4.87V
- The voltage drop across the second resistor, the chart above
- The value of the series resistor, measured at 987Ω
… we can determine both the current draw of the circuit and the resistance in ohms of the LDR as each light blocker was added, thanks to Ohm’s law and the fact that the same current draw occurs at every node of a voltage divider (more on this in a later post)!
First, we find the circuit current draw. The formula you would use is \(\mathrm{\frac{V_{meas}}{R_{2}}=I_{circuit}}\). If we use the Ambient Lighting measurement from above as an example, we would get: \[\large\mathrm{\frac{2.17V}{987Ω}=0.0021A=2.10mA}\]
Second, we use the voltage we start with, 4.87V from the Arduino, and the current draw, 2.10mA, to determine the total resistance of the circuit: \[\large\mathrm{\frac{2.17V}{.0021A}=2319Ω}\]
Finally, we subtract the value of the series resistor, 987Ω from the total resistance, 2319Ω to get the resistance of the LDR in the ambient light of my lab: \[\large\mathrm{2319Ω-987Ω=1332Ω}\]
The final table then, showing us how much current was drawn and what the resistance of the photoresistor at each stage was, is as follows…
Light Level | Vin | Vmeasured | Current | LDR Resistance |
---|---|---|---|---|
Ambient | 4.87V | 2.05V | 2.05mA | 1358 |
Primary | 4.87V | 3.76V | 3.81mA | 291 |
Blocks: 1 | 4.87V | 2.48V | 2.51mA | 951 |
Blocks: 2 | 4.87V | 2.05V | 2.08mA | 1358 |
Blocks: 3 | 4.87V | 1.83V | 1.82mA | 1640 |
Blocks: 4 | 4.87V | 1.71V | 1.73mA | 1824 |
Blocks: 5 | 4.87V | 1.57V | 1.59mA | 2075 |
Blocks: 6 | 4.87V | 1.48V | 1.50mA | 2261 |
Blocks: 7 | 4.87V | 1.43V | 1.45mA | 2374 |
Blocks: 8 | 4.87V | 1.34V | 1.36mA | 2600 |
Blocks: 9 | 4.87V | 1.30V | 1.32mA | 2710 |
But really, this is a crude method of measuring this – millivolt changes based on sheets of paper stuffed in front of a flashlight in a room with loads of other light and shadow pollution. I had to redo all the measurements for the second table when I realized voltage for a one measurement was higher than the one before because I was holding my hand near the flashlight the first time and cast a shadow from the ambient light source.
Generally speaking, I want to build my own optoisolator, and measure this thing that way instead. I think I’ll do that tomorrow.