I am trying to use a capacitive humidity sensor (HCH-1000-002) with PIC16F690. I have read about 2 different circuits to detect the capacitance of the humidity sensor. One uses Timer 555 (NE555S-13 – see Figure 1) and the other uses resistors and the comparator in the Pic (see Figure 2)
Figure 1
Figure 2
1) Which is the best circuit?
2) How do I calculate the capacitance?
For the 555 circuit, look at the applications section of the 555 data sheet. Transpose the free-running oscillator equation to solve for C as a function of Freq.
For the other circuit, I would have to know what the code is doing with AN0, RA2 and RA3? Likely, it is measuring the time it takes to charge/discharge the capacitor to a given threshold as defined by the internal comparator.
I just looked at the data sheet. That is a rather poor sensor. Its capacitance is effected by the measurement frequency, the ambient temperature, and by-the-way, slightly by changes in humidity. Good Luck...
Both designs require a microcontroller ; although, one might use an off-the-shelf frequency meter for the 555-based circuit (with appropriate re-numbering of the pins). If you are comfortable with microcontrollers, then there is no advantage to the 555-based design.
Edit: It took me awhile to find a link to this series of capacitance measurement chips. I have used the CAV424 several years ago. It might be a simpler solution, if you do not want to use a microcontroller. There is also the CAV414 and CAV444. http://www.analogmicro.de/english/index.html