Electronic – Simple variable Capacitor circuit to feed ADC

adccapacitorhumiditysensorvariable

I need to build a humidity sensing circuit that feeds an analogue to digital converter. (This converter is then going to send its signals to a raspberry pi for analysis etc). The sensor will be about 0.5m away from the amplifier circuit (As it will be inside a climate cabinet, and the circuitry will be outside) and I have seen in my research that having a distance between the circuits causes further complications.

I have found a capacitive humidity sensor that fits my temperature range needs (IST MK33). This has a range of capacitance of approx 290pF to 340pF (showing 0% relative humidity through to 100%). I need to then convert this somehow into a suitable input for an MCP3008 ADC, I'm assuming a range of 0v-5v will work. This will then communicate via SPI to the Raspberry Pi.

I have a 24VDC supply originally but I shall also have 5V, and 3.3VDC supplies available to drive this circuit because of the raspberry pi. I looked at the circuit and answers in this question: Converting variable capacitance value to variable DC voltage level but what with the difference in the range of the capacitance value I wondered if this is still suitable?

So my question is: is the circuit in the above link still suitable? or can someone suggest a different circuit with suitable values that would work? I'm very new to all this so I've been struggling and the data sheet for the sensor hasn't got any example circuits, which normally save me! Thanks in advance. 🙂

Best Answer

The way to to this with an absolute minimum of support circuitry is to use a DIO output to charge/discharge an RC circuit consisting of your capacitive sensor and some resistor to produce a time constant that makes sense for your application.

Start with the DIO low, leaving enough time to bring the resistor voltage to zero. Turn the output on and start a timer at the same time, and time how long it takes for the resistor voltage to reach some predetermined level. Many microcontrollers have a comparator peripheral. If you use one of these, you need NO external parts.

I don't believe the Pi has such capabilities, but an external comparator is not that big a deal.

Indeed, the need to build circuitry to create an analog voltage proportional to capacitance isn't the best way to go. the methods I like most for capacitive sensors all involve counters, not ADC's. If this isn't Pi-friendly, adding an 8-pin microcontroller to use the technique I describe, and then generate a PWM signal that you can capture with the Pi.

You can certainly use the circuit in the answer you point to (with suggested modifications as described in answers, as the original won't work), but it's parts intensive. It's also nonlinear, and you would need to use a curve fit or look up table to get your capacitance value.