So I'm trying to use a photo-resistor and I learned that you should have a "fixed" resistor in the circuit. So my question is, what resistor should I have be the fixed resistor? My photo-resistor has a resistance of 18-50 KΩ at 10lux and a darkness resistance of 2.0 MΩ at 0lux.
-
1please include the circuit diagram ... what are you trying to accomplish?jsotola– jsotola2021年08月25日 23:16:17 +00:00Commented Aug 25, 2021 at 23:16
-
1What voltage swing to you want. What are you connecting the output to. Post a schematic along with links to technical information on the parts you are using.Gil– Gil2021年08月26日 01:21:33 +00:00Commented Aug 26, 2021 at 1:21
-
What part of the "light curve" are you interested in and what will you be connecting the LDR output / voltage divider to? An LDR that has a resistance of, say, 20k Ohms at 10 lux (which is a very low "candlelight" light level) can have a resistance of only 100 Ohms in daylight (10.000 lux or more). Your voltage divider (input to an ADC i presume?) should be matched with the values you are interested in.StarCat– StarCat2021年08月26日 06:22:14 +00:00Commented Aug 26, 2021 at 6:22
-
@StarCat does the resistance of the fixed resistor change what kind of values I'll get? Also, what is a "light curve"? And btw I connected the output to the 5V pin on the Arduino.Christian Bautch– Christian Bautch2021年08月26日 15:09:35 +00:00Commented Aug 26, 2021 at 15:09
1 Answer 1
What part of the "light curve" are you interested in and what will you be connecting the LDR output / voltage divider to?
A photoresistor (LDR) that has a resistance of, say, 20k Ohms at 10 lux (which is a very low "candlelight" light level*) can have a resistance of only 100 Ohms in daylight (10.000 lux or more). Your voltage divider (input to an ADC i presume?) should be matched with the values you are interested in.
That said, if I make the assumption that you want to distinguish between daylight and darkness and you want to connect the LDR voltage divider to an ADC input on your Arduino that has the same range as your power supply (usually 5V or 3.3V), you could build the following voltage divider using your LDR and a 10k Ohm resistor (R1, your "fixed" resistor):
schematic
simulate this circuit – Schematic created using CircuitLab
This will give you a fairly wide range of values (with higher values being brighter) and allows you (by experiment) to determine when it's time to turn the lights on, for example.
*Actually, the definition of 1 lux is the amount of light one candle generates at a meter distance, so 10 lux is the light of 10 candles.
-
1Change R1 to a (trim)potentiometer so you can adjust it to your needs.SBF– SBF2021年08月26日 10:04:57 +00:00Commented Aug 26, 2021 at 10:04
-
fun trick: put LDR from ADC to GND, then take the other lead to a GPIO set to "INPUT_PULLUP". Depending on the type of ldr, this can give you full range or sometimes just about 1/4 range, but often that's good enough to tell "it's dark"...dandavis– dandavis2021年08月26日 19:43:25 +00:00Commented Aug 26, 2021 at 19:43
Explore related questions
See similar questions with these tags.