Following this appnote (PDF) on using photodiodes, I'm connecting an IR LED as a light sensor and emitter, configured like this:
To emit light, I pull
PIN1 high and
R2 serves as a current limiting resistor. To detect light, I pull
PIN2 high and connect
PIN1 to an ADC;
R1 form a voltage divider, and the voltage on
PIN1 is proportional to the amount of light.
What I'm curious about is the best value for
R1 and its relation to output voltage and response time. The appnote gives a formula for calculating the response time, but leaves terms undefined. The current value of 20M was based on experimentation with a breadboard; at this value it gives reasonable results between 0 and 0.15 volts for reflected light from another identical LED, and a bit over 5V if I point the emitting LED directly at the detector.
I'd like to increase the sensitivity to low light levels, but I don't know how much I can safely do so without sacrificing response time. My target component isn't the same as I was using on the breadboard, either, and I don't know what parameters of the LED affect the output voltage. In a nutshell:
- How do I determine the response time of this circuit in its detecting configuration?
- How can I determine what voltage level to expect at PIN1 with a given value of R1 and a given light level?