Calibrating humidity sensors

Jeremy Harris

Senior Member
On this thread: the conversation drifted off into a discussion on calibration. When I first built my humidity sensor modules (using a Humirel HS1101, as detailed here: ) I used the saturated salt method to calibrate them. This works well, but it is a bit of a faff and takes a fair bit of time.

As an alternative, it is possible to measure relative humidity pretty accurately using a sling psychrometer (see here:, which is simply a device with two thermometers, one of which has a bit of wet cloth wrapped around it, that is whirled around to allow the dry air temperature and the temperature of the wet thermometer to be measured. The temperature of the wet thermometer will usually be lower than that of the dry one, because of cooling by evaporation. The extent of this cooling depends on the relative humidity of the air - the drier the air the greater the temperature difference between the two thermometers.

It occurred to me that a Picaxe could be used to do the same thing, using a couple of DS18B20 sensors. It also seemed to me that there was no need to swing the thing around over your head, all that was needed was to blow air over the sensors at about the same air speed. A small cooling fan can blow air at least as fast as the speed reached by the professional sling psychrometers (that are often used to calibrate/check professional weather station sensors). To see if this would work I knocked up a couple of DS18B20's on an AXE091 development breadboard, and hooked them up to an 08M2. A 40mm diameter cooling fan was bodged up, running from a 12V battery, and arranged to blow over the two sensors. I wrapped a bit of open weave cloth (cut from a bandage) around one of the sensors and dripped a bit of water on it. A bit of quick and dirty code to read the two sensors (in 12 bit mode) and output the temperature to the serial port was written. This displays the wet and dry temperatures about every 1.5 seconds or so on the terminal screen in PE.

To get relative humidity a fair bit of math has to be done. The easy way to avoid this is to use a paper look up table (like this one: ). If you want to do this by calculation, then the process is to determine the saturated vapour pressure of water at the dry bulb temperature, using this formula:

Saturated vapour pressure (in Pa) = 610.78*EXP(Td/(Td+238.3)*17.2694), where Td is the dry sensor temperature in deg C.

Next, you need to calculate the vapour pressure at the wet sensor, using the same formula:

Wet sensor vapour pressure (in Pa) = 610.78*EXP(Tw/(Tw+238.3)*17.2694), where Tw is the wet sensor temperature in deg C.

Then you need to calculate the actual water vapour pressure in the air (I used a modified version of the Apjohn equation, there are other equations (Ferrel, Carrier etc) that give similar results):

Air water vapour pressure (in Pa) = wet sensor vapour pressure-((1.8*Td*(Td-Tw))/2700) where Td and Tw are the dry and wet sensor temperatures in deg C.

Calculating relative humidity (as a percentage) is then straightforward:

RH (%) = 100 * (Air water vapour pressure / saturated vapour pressure)

I knocked up a small Excel spreadsheet ( here: ) to do these calculations, but if someone relishes a challenge they might want to see of they can get a Picaxe to do them. Should be an interesting exercise in doing fairly complex arithmetic with just integer math!

To get back to my little experiment, I found that the simple method of using two DS18B20 sensors, a bit of wet cloth and a small computer fan does indeed work very well, certainly good enough to get within a couple of percent of the true RH. There are a few points to watch:

1. Water and electricity don't mix, so you have to come up with a way to seal the DS18B20 leads. I found that using plastic sleeving over the whole sensor didn't work well, as it stopped the wet sensor reading accurately. I ended up with only the leads being insulated. If doing this for real I think I would try and insert the wet sensor inside a tight fitting copper, brass or aluminium tube, with a bit of epoxy to seal the leads. The metal tube would probably ensure that the sensor read the cool temperature from the wet cloth more accurately.

2. The fan needs to have all its output directed to the sensors, via a tapered duct. I used some folded paper, taped up so that the exit hole that was blowing air over the sensors was around 20mm square and this worked well. I didn't get good results with the fan just sat next to the sensors on the breadboard, they need a good airflow to read accurately.

3. The wet cloth dries out fairly quickly at room temperature, and the wet sensor temperature then starts to rise. So it is important that a way is found to keep the cloth wet (maybe a small pot with the cloth dipped in like a wick?).

4. The response time of this set up is slow, it takes a couple of minutes to reach equilibrium. If the Picaxe code was to run through a loop and detect the lowest wet sensor temperature (after making sure it really was the minimum), then stop and display both temperatures it would probably be more foolproof.

I'm sure this principle could be used to make either a fan driven unit (as I've tried to do) or to just replicate a conventional sling psychrometer. Might make an interesting educational project, which is what NASA seems to suggest on this site: (which has a link to better instructions). I can't see any reason why a Picaxe, two sensors, a battery and display couldn't be fitted to the rotating part, especially if the code was written to wait for the lowest wet sensor reading, then stop and display the results.


Senior Member
Wow! Spinning microcontrollers! There's got to be a steampunk version in there somewhere...

Interesting stuff. I haven't yet actually even used my PICAXE-friendly non-spinning non-watered RH sensor: it's lurking in my components box unloved at the moment.