Electronic – How does the QTR-8RC capacitor charging works

capacitorsensor

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.

http://www.pololu.com/catalog/product/961

This is the schema (focus on the bottom left part, the squared area).

http://a.pololu-files.com/picture/0J629.650.png?7975fd7128a0eb0861e253d9c7f439c0

An these are the steps to read a value:

  1. Turn on IR LEDs (optional)
  2. Set the I/O line to an output and drive it high
  3. Allow at least 10 us for the 10 nF capacitor to charge
  4. Make the I/O line an input (high impedance)
  5. Measure the time for the capacitor to discharge by waiting for the
    I/O line to go low
  6. 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?.

Best Answer

The third pint should read

Allow at least 10 us for the 10 nF capacitor to discharge.

If the capacitor has Vcc on both sides it's discharged. (IR) light on the phototransistor will cause a current to ground, so that voltage builds up on the capacitor, making its lower side go lower, as the other side is fixed at Vcc. Since the charging is through a current source instead of a resistor the voltage will decrease linearly with time.