Capacitive humidity sensor interface, how?

Go To Last Post
20 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have picked up this humidity sensor. Datasheet rates it at 330pF at 55 percent RH, with a 0.6pF per percent gradation (so range is 300pF-360pF for 1 percent to 100 percent RH.). Datasheet goes on about saying unit can be used at 1KHz-100KHz. Test setup says it's driven with a 1V P-P 20KHz signal. It does not say if it is DC, AC, or provide a typical application schematic.

My question is how would I go about making a proportional voltage output interface for this sensor, that I can feed into an ADC for reading? I have checked other datasheets, only thing that came close to something usable used a 555 to output variable frequency. I would like to avoid the 555 (and also avoid a MATCH interrupt) if at all possible.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Whew that took a while, somehow Apache had a problem with the post until I removed the % sign... Might wanna look into updating it too...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

One way would be to make it part of an RC oscillator and count frequency. Think something like a 555 but please don't actually use the bipolar one - they s&^k (pardon the French). You can also make an RC oscillator with a couple of logic gates.

You should not need to use match. Just count for a known time interval.

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A bit of googling got me I think a suitable oscillator. Anyone have experience designing Wien bridge oscillators? The concept is very simple, however I am at a doubt if the low capacitance value of the probe will give me enough frequency swing to measure the output accurately over the range. I also have never dealt with those before, and only have a general idea of the design process, I would definitely need some help calculating the component values for it.

If the frequency shift is large enough to measure, I could feed the output sine into a comparator, have the comparator ISR start/stop a timer to accumulate counts and average say 50 interrupts.

Does this sound like a viable plan?

P.S.: Hmmm Capacitance multiplier? This should resolve any issue with swing being too small.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You could also use a port pin via a suitably sized resistor to charge/discharge the sensor and use the AVR comparator to sense the voltage sense point. Measure the time from the port pin toggle to the comparator changing and you have your measurement. Measure discharge as well to get some more accuracy. Basically this is what the 555 does.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Wein Bridge really wants both capacitors changed simultaneously. Also a bit tricky to get the gain just right.

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman:

That is a great idea! I could charge the cap with a 1M resistor in series with an output pin, set comparator treshold to 65% of charge voltage, when it interrupts toggle a n-ch MOSFET to discharge the cap, start a counter, wait for recharge, rinse and repeat a couple of times and average counts. 1MOhm @ 300pF should give me oscillation at around 3KHz, which is in range with the probe's specs...

At such a low value I could discharge the probe directly to ground through the mosfet right?

Last Edited: Wed. Sep 16, 2009 - 05:31 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Jim:

Well that explains why I can't get it to oscillate in simulation... ;)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Have a look at the elm-chan projects. He has
one about capacitance measurement and one about
capacitive sensing.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This is soooo simple... I wonder how long I would have been at it without you guys... So simple I won't bother the usual screenshot, here it is in ASCII art...

                 3M3         Sensor
IO Output  >----^v^v^v----o----| |----o GND
                          |
                  100     |
Comparator <----^v^v^v---/

Now I just start timer, toggle the IO output, and stop timer when comparator hits 65% of VCC.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ahh, that famous 0.693*RC (= RC*ln2) equation of the the time constant!

I have the feeling that nothing has really changed in the last decades I have been on the watch...

-George

I hope for nothing; I fear nothing; I am free. (Nikos Kazantzakis)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This is the perfect example of the engineer's eternal struggle. Come out with a way complicated solution to a high school physics problem...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That is so true, my friend...

I hope for nothing; I fear nothing; I am free. (Nikos Kazantzakis)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Another good way to measure capacitance variation is the circuit as used in Elcie, Elcie and Elmcie:http://www.aplomb.nl/TechStuff/Elmcie/Elmcie.html

Nard

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tessa and Tina, You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So I did the exercise and jerry-rigged a proof of concept circuit with what I had on hand, there's a good 200uS between 310pF and 370pF with a 3Meg resistor @ 2V input and 1.4v trigger. So I should be able to get VERY good accuracy with the comparator/timer setup. :)

I attached shots for your enjoyment.. Keep in mind I'm using poor quality components here... :)

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you use a 3Meg resistor the oscilloscope probe
will probably have some influence on the measurement,
even if its a 10Meg 10:1 probe.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Probably, but then again this was just a proof of concept, I wanted to see what kind of swing I could expect. On the real board I will put a female socket of some kind in which I can insert a capacitor for calibration.. I might also raise the resistor value to get a bit more swing..

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There is a large recent thread on this topic if it helps:

https://www.avrfreaks.net/index.p...

In the end, I personally opted for a simple solution that also allows for reading multiple capacitor values using the ADC, a few transistors for multiplexing, and a R/C network to measure the time to charge with a CTC clock. Not that much to it, but it works very reliably and accurately. If it helps, there is a schematic and code samples on that thread. Good luck and I look forward to hearing what your solution is.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Here is another way of doing it with an oscillator circuit and 16 bit counter.

http://sites.google.com/site/ang...