(Please use small words as this mechanical engineer does not often understand the world of electrons.)
I have a circuit that's driving me up a wall! In an effort to build a weather observation station, I have a capacitative humidity sensor that is built into an op-amp integrator circuit. Something similar to
this (pdf, see figure 3). I'm using an Arduino to control everything, basically following the same functional block diagram as is in the document - power HI, find the time at V1, time at V2, do some math and figure out the capacitance which is then converted to relative humidity. Then flip the power to LOW and do the same thing in reverse.
The problem, as is common with integrator circuits like this, is that the sensor/cap needs to be discharged occasionally. Based on some other suggestions I found on the internet, I added a JFET in parallel with the sensor and modified my code so that the JFET would close after every hi/low cycle, shorting the sensor and removing the built-up charge.
Unfortunately, it seems that it's in a constant state of short-circuit. If the JFET is in place (and I'm sure that I have the pins where they should be), the integrator circuit does not work. The sensor simply does not build a potential across its terminals, and I'm at a loss why the JFET won't stay in an "open" state.
Is a JFET not the right tool for the job here? Is there some quality of FETs that I'm not understanding? I've done all the most obvious troubleshooting and I'm still at a loss.
Another possibility is to just use another GPIO pin to discharge the sensor cap. If you disable all pullups & pulldowns on an input, then it should be very high impedance, and not affect your measurement too much. When you want to discharge, switch the pin to output mode and pull the sensor cap low. Switch back to input and measure again.
posted by spacewrench at 7:03 AM on November 17, 2009 [1 favorite]