Analog Voltage Reading Method
The easiest way to measure a resistive sensor is to connect one end to Power and the other to a pull-down resistor to ground. Then the point between the fixed pulldown resistor and the variable photocell resistor is connected to the analog input of a microcontroller such as an Arduino (shown)For this example I'm showing it with a 5V supply but note that you can use this with a 3.3v supply just as easily. In this configuration the analog voltage reading ranges from 0V (ground) to about 5V (or about the same as the power supply voltage).
The way this works is that as the resistance of the photocell decreases, the total resistance of the photocell and the pulldown resistor decreases from over 600KΩ to 10KΩ. That means that the current flowing through both resistors increases which in turn causes the voltage across the fixed 10KΩ resistor to increase. It's quite a trick!
Ambient light like… | Ambient light (lux) | Photocell resistance (Ω) | LDR + R (Ω) | Current thru LDR +R | Voltage across R |
---|---|---|---|---|---|
Dim hallway | 0.1 lux | 600KΩ | 610 KΩ | 0.008 mA | 0.1 V |
Moonlit night | 1 lux | 70 KΩ | 80 KΩ | 0.07 mA | 0.6 V |
Dark room | 10 lux | 10 KΩ | 20 KΩ | 0.25 mA | 2.5 V |
Dark overcast day / Bright room | 100 lux | 1.5 KΩ | 11.5 KΩ | 0.43 mA | 4.3 V |
Overcast day | 1000 lux | 300 Ω | 10.03 KΩ | 0.5 mA | 5V |
This table indicates the approximate analog voltage based on the sensor light/resistance w/a 5V supply and 10KΩ pulldown resistor.
If you're planning to have the sensor in a bright area and use a 10KΩ pulldown, it will quickly saturate. That means that it will hit the 'ceiling' of 5V and not be able to differentiate between kinda bright and really bright. In that case, you should replace the 10KΩ pulldown with a 1KΩ pulldown. In that case, it will not be able to detect dark level differences as well but it will be able to detect bright light differences better. This is a tradeoff that you will have to decide upon!
You can also use the "Axel Benz" formula by first measuring the minimum and maximum
resistance value with the multimeter and then finding the resistor value
with: Pull-Down-Resistor = squareroot(Rmin * Rmax), this will give you slightly better range calculations
Ambient light like… | Ambient light (lux) | Photocell resistance (?) | LDR + R (?) | Current thru LDR+R | Voltage across R |
---|---|---|---|---|---|
Moonlit night | 1 lux | 70 KΩ | 71 KΩ | 0.07 mA | 0.1 V |
Dark room | 10 lux | 10 KΩ | 11 KΩ | 0.45 mA | 0.5 V |
Dark overcast day / Bright room | 100 lux | 1.5 KΩ | 2.5 KΩ | 2 mA | 2.0 V |
Overcast day | 1000 lux | 300 Ω | 1.3 KΩ | 3.8 mA | 3.8 V |
Full daylight | 10,000 lux | 100 Ω | 1.1 KΩ | 4.5 mA | 4.5 V |
This table indicates the approximate analog voltage based on the sensor light/resistance w/a 5V supply and 1K pulldown resistor.
Note that our method does not provide linear voltage with respect to brightness! Also, each sensor will be different. As the light level increases, the analog voltage goes up even though the resistance goes down:
Vo = Vcc ( R / (R + Photocell) )
That is, the voltage is proportional to the inverse of the photocell resistance which is, in turn, inversely proportional to light levels.
Text editor powered by tinymce.