Prodigity wrote:Measure the resistance of the photocell in the dark.
Multiply that value by 2.2 and round it off to the nearest resistor value you can find.
Connect the resistor to +3.3V and the other end to tout.
Connect the photocell to tout and ground.
That should cover a big part of the range of the ADC assuming that the resistance difference between dark
and light is big enough
tnx i have managed to wire up everything and it works now. I get data range from 0 to 1023. But still i have few questions.
1) Why multiply it with 2.2 (is this because of 3.3V -1V)?
My photocell has around 18K ohm x 2.2 = rounded 40k ohm. See point 2)
2) 3.3V is not fixed. 3xAA are in range from 2.7V to 4.1V(slowly dropping ...)
So should i use i dont know .. low dropout regulator LM1117 (1.8V) and than i would have fixed 1.8V? Is this ok plan?
If point 1) is correct and if i use LM1117(1.8V) than i would multiply it with (1.8V - 1V) = 0.8V ... so photocell 18K ohm x 0.8V = 14.4k ohm.
Is this correct path or not?