The circuit illustration shows the 10K Ohm resistor as being the “Top” resistor (closest to positive), but the circuit diagram and the text both say that the photo resistor should be the “Top” resistor.
Following the circuit diagram the LED gets dimmer as the photo resistor gets less light. However, following the illustration the LED gets brighter as the photo resistor gets less light.
Can anyone tell me if which is the expected behavior?
Thanks,
Ian
A link to circuit #6 would make it more likely that someone will help you.
W/o knowing what the SIK says, if the photocell is the “top” resistor then as it get more light it’s resistance will decrease. As the “top” resistance decreases the ratio of the “bottom” to the total resistance gets larger and the voltage to the Arduino gets larger as well. I’ll assume that code then makes the LED brighter to correspond with more light.
Let’s play with some numbers to illustrate :
Dark case first : Let’s have the photocell = 10k and the “bottom” resistance be the same, 10k.
The voltage divider is then …
Vo = 10k/(10k + 10k) * Vin = 10/20 * Vin = 0.5 * Vin
Light case #1 : Now have the photocell be 1k. What do we get ?
Vo = 10k(1k + 10k) * Vin = 10/11 * Vin = 0.9091 * Vin > 0.5 * Vin
Light case #2 : If the photocell was the “bottom” resistance then …
Vo = 1k(1k + 10k) * Vin = 1/11 * Vin = 0.09091 * Vin < 0.5 * Vin
Thanks for your help. That explains what I was seeing.
IanDrake:
Thanks for your help. That explains what I was seeing.
Good ! Perhaps you should e-mail SFE support and inform them of the mismatch, schematic to drawing.