I would like to understand how does work the polulu Reflectance Sensor internally. I can make it work but I would like to know what is happening electrically.
This is the schema (focus on the bottom left part, the squared area).
An these are the steps to read a value:
- Turn on IR LEDs (optional)
- Set the I/O line to an output and drive it high
- Allow at least 10 us for the 10 nF capacitor to charge
- Make the I/O line an input (high impedance)
- Measure the time for the capacitor to discharge by waiting for the I/O line to go low
- Turn off IR LEDs (optional)
I guess initially the 10 nF capacitor is charged. Why does it say in step 3 to charge it again. Do you charge "the other side" of the capacitor?.