I am currently using a LDR ( Light Dependant Resistor) on an analogue pin. As it is I am now short on analogue pins.
So question is how low does the pin have to be pulled to change state?
Will it change state below 50% of Vin then change state again above 50% of Vin?
What I would like to do is use 2 digital pins with 2 LDR's and be able to achieve 3 light levels. EG both inputs high, one input low and both inputs low.
Threshold voltage for digital pin to go "0" is about 2.2V ( VCC= 5V)
and go "1" 2.7 V. Be advised, there is also hysteresis , look into data sheet for your atmega chip for more details.
What I would like to do is use 2 digital pins with 2 LDR's and be able to achieve 3 light levels.
In that case you would need two different values of pull up resistor so that the 0 / 1 threshold is different on each LDR input. You will have to experiment with your sensors and light levels to find the right values.
A low needs to be less than 0.3 x VCC per the datasheet.
A high be above 0.6 x VCC
Excellent. Thanks.
I thinking internal pull up resistors and a pot for adjustments should work.
This is a rather unusual arrangement so let us know how you get on with it.