Projects

Humidity control

Humidity measuring using the Arduino and capacitive sensors of  Vishay.

Measuring humidity with an Arduino

 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...

Measuring humidity with an Arduino [2]

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.

Reducing humidity with a DIY moisture absorber

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.

How to make it

Parts needed

  1. Plastic box with lid 80 x 120 x 50 mm (box 1)
  2. Plastic box 80 x 120 x 80 mm. Box 1 should fit in the top of this box.
  3. Silica gel (we used about 200 ml)
  4. A mesh 80 x 120 mm, big enough to cover the bottom of the plastic box.

Step 1 - Prepare the lid

Heat up a nail and use it to melt about 16 holes in the lid.

 heat up a nail heat up a nail

 Melt holes in the lid Melt holes in the lid

Step 2 - Prepare Box One

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.

Melt holes in the bottom Melt holes in the bottom

Cut the mesh so it fits on the bottom of the box Cut the mesh so it fits on the bottom of the box

 Put the mesh inside the box Put the mesh inside the box

 Step 3 - Put a thick layer of silica gel in the box

 Put silica gel in the box Put silica gel in the box

Put a thick layer of silica gel in the box Put a thick layer of silica gel in the box

 Close the box with the punctured lid Close the box with the punctured lid

Step 4 -  Completing the moisture absorber

Put box 1 into the higher box [1/3] 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 [2/3]

Put box 1 into the higher box [3/3] Put box 1 into the higher box [3/3]

Appendix - Using the Moisture Absorber

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...

It works, look at these measurements:

Humidity measurement in the store room Humidity measurement in the store room

Humidity measurement in the box with absorber 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.

Subtitles

Vimeo subtitles - MidityVimeo library

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:

  1. Make sure you include the MidityVimeo and the GoogleAPI javascript in your page
  2. Paste the Vimeo Embed code in your HTML
  3. Create the Javascript subtitles as mentioned in my previous blog 
  4. Call a function to activate the subtitles: 
    MidityVimeoLib.showSubtitles(clip_id, subtitles, ID_Of_Subtitles_DIV);

Things to note:

  • Examples included in the package
  • The MidityVimeo library searches your page for all Vimeo movies and replaces them all with dynamically loaded ones in order to get JavaScript access to them. 
  • Supports changing subtitles during playback by calling the above function again. That way you can let the user switch between languages.
  • Support of multiple subtitled Vimeo clips on 1 page.
  • Not supported: one Vimeo clip twice on one page (but I'm interested in why you would want to do that)
  • License: GNU GPL3, full text is included in the package

Next step:

  • Create an easy editor so transcribers can create the subtitles

If you're using it, I would appreciate a comment below or send me a quick note.

AttachmentSize
MidityVimeo_1_0_20100312.zip16.34 KB