Humidity measuring using the Arduino and capacitive sensors of Vishay.
![]()
![]()
I have salvaged a couple of capacitive humidity sensors which I intend to use for measuring humidity(!) with an Arduino. 
Problem now is: how to read capacitance values using an Arduino?
The Arduino website suggests this:

But I am pretty sure this works only with large capacitors. The Vishay is only 122 pF. In the above circuit I might need a resistor of 10 M or more.
After checking application manuals of this type of thing I figured I need a 555 timer and build an astable circuit like this:
C would be the humidity sensor. C, R1 and R2 together define the frequency of the output signal on pin 3.
By connecting pin 3 to the Arduino, I'll be able to read out the frequency the 555 is generating. Now I need to figure out the optimal values of the resistors. I found others did this too: Check out the Cricket of Blueroomelectronics. They are using the HS1101 humidity sensor, which is slightly different from my Vishay.
To be continued...
In my previous post, I explained I want to use a Vishay/Philips capacitive humidity sensor and an Arduino to measure humidity. Up until know, I’m not much further than the idea. Today I tried a simulation in Linear Technology LTspice IV to get a better view.
I simulated an NE555 astable multivibrator circuit in Ltspice IV.
This was the circuit:

The humidity sensor in this schema is C1.
LTSpice IV is fairly easy to use. Creating the circuit was a bit unusual, but I had this plot in no time:

It looks to me that this should be measurable with an Arduino.
But to the calculations first. According to http://www.daycounter.com the frequency can be calculated like this:
F = 1/T = 1.44 / ((R1+R2*2)*C)
Which means in my case:
F = 1/T = 1.44/((390000 + 390000 * 2) * 110*10-12) = 11188 approx 11.1 KHz
T = 89.375 * 10-6
When the relative humidity rises, we might have a 140pF:
F = 1/T = 1.44/((390000 + 390000 * 2) * 140*10-12) = 8791 approx 8.8 KHz
T = 113,75 * 10-6
BTW. The above site also warns that “…the design equations of the timer are just approximations that can be off by as much as 20% from the empirical results.” In the final setup we'll have to calibrate.
I zoomed in to 200 microseconds, this is it:

Looks like the calculations and spice come to a similar conclusion.
Zoomed in on a 140pF circuit plot:

Now let’s look at the resistors. The largest resistors I have in my workbench are 1M. Let's see what the frequencies look like with them:
At 110pF and 1M:
F = 1/T = 1.44/((1000000 + 1000000 * 2) * 110*10-12) = 4363 approx 4.3 Khz
T = 229 * 10-6
At 140pF and 1M:
F = 1/T = 1.44/((1000000 + 1000000 * 2) * 140*10-12) = 3.429 approx 3.4 Khz
T = 229 * 10-6
These values are probably much easier to measure with an Aduino, but I‘ll try that on a breadboard later.
As you can see in this picture, the relative humidity in our place was very high during the winter monsoon. I do not know if it really was 99%, but it was high enough to give trouble drying our laundry, which makes all clothes stink. That is a small problem compared to what the high humidiy does to our digital cameras: if the fungus that makes clothes smell gets on the CCD or inside the lens, they wil be permanently damaged.
There is electrical equipment for reducing humidity, but a moisture absorber as descibed here does a decent job by using the natural properties of Silica gel.
Heat up a nail and use it to melt about 16 holes in the lid.
The inner box needs around 16 holes in the bottom, we also put a mesh inside to keep the silica from falling through the holes.
Cut the mesh so it fits on the bottom of the box
Put a thick layer of silica gel in the box
Close the box with the punctured lid
Put box 1 into the higher box [1/3]
Put box 1 into the higher box [2/3]
Put box 1 into the higher box [3/3]
Using it is pretty easy. Take a 15-liter box put all your gear in, together with the moisture absorber:
No photo, but: Don't forget to close the lid...
Humidity measurement in the store room
Humidity measurement inside the box with absorber in the store room
Relative humidity went down from 84% to 45%, that's far above our expectations.
Drying the silica gel (and re-using it) is easy. I'll show that later.
In my previous blog entry I got the idea of making subtitles for Vimeo movies. I extended that idea to make it even easier.
The attached MidityVimeo javascript library contains all code to create subtitles the easy way. The only thing you have to do is:
MidityVimeoLib.showSubtitles(clip_id, subtitles, ID_Of_Subtitles_DIV);Things to note:
Next step:
If you're using it, I would appreciate a comment below or send me a quick note.
| Attachment | Size |
|---|---|
| MidityVimeo_1_0_20100312.zip | 16.34 KB |