More than 20 years ago I built an electronic psychrometer, a combination of analog and digital TTL electronics
to measure the relative humidity of air. A psychrometer uses a dry temperature sensor to measure the temperature
of the air and a wet sensor, which is covered with a cloth and kept moist with distilled water. Due to the evaporation
of the water the wet sensor will be cooled and show a lower temperature. The relative humidity of the air is depending
on the temperature of the air and having an impact on the evaporation and so on the temperature difference of
the dry and wet sensor. To find the relative humidity the air temperature and difference temperature can be used in
formulas, graphics or tables.
My old psychrometer does need two calibration points but using modern accurate digital temperature sensors like the
DS18B20, the availability of microprocessors with higher level programming and math libraries should make it possible to
build a psychrometer which does not need calibration as the sensors are already 'factory calibrated'.
A few months ago element14 gave away 500 LPC800-minikits and the availability of a little board with a 32-bit uP was
what gave me the inspiration to build a modern psychrometer. So I applied my idea, a week later the little board
arrived and I then ordered the two temperature sensors, a barometer chip and a small fan.
A bit of theory
The internet is a rich source of information, looking for data, graphics and formulas about psychrometers gives a lot
of formulas, all with different constants, and basically just one usable table. After considering all formulas I did
choose the formulas used in reference . These are the formulas :
psat = 610.78 *exp(t * 17.27 / (t + 237.3)) -- above water
h = 2502535.259 - 2385.76424 * (twet-0.01)
F = (tdry - twet) * 1006.9254 * (Patm - Psat,wet) / (0.62194 * h)
e = (Psat,wet - F) / (1 + F * 0.15577 / Patm)
RH = 100 * e / Psat,dry [%]
[pressure psat in Pa, temperatures t in °C]
The following properties are used : the temperatures of the two sensors (measured), barometric pressure (measured),
saturation pressure of water in air at the two temperature sensors Psat,dry , Psat,wet (calculated).
The formula for calculating the h value is valid from 0.02 to about 65 °C, so measuring relative humidity in the freezer
is a no go ( and as a bit of water is used there is an other problem when measuring in there as well . . . ).
For a first approach however I used a table, the one from reference . I did enter the above formulas in a spread-
sheet and with it I checked the table, using an air pressure of 101325 Pa. All calculated relative humidity values for
different air temperatures and difference temperatures, rounded to fixed numbers as in the table, agreed with this
table. It should be noted here that above formulas and the table used apply to a so called sling-psychrometer, where
the wet bulb is moving fast in air in order to avoid saturating the air around the wet sensor. I try to get the air
moving by using a small fan. And talking about a fan : now it is time for some practical work . . .
The first version, called Psychrometer deLuxe, just needed two temperature sensors and a fan, so I used the LED-
output to connect to a transistor to switch on/off the fan, and ports PIO0_1 and PIO0_3 to sense the temperature.
As digital temperature sensors I connected two DS18B20's, both are checked at the same time so I could use the
simple NO-ROM feature to get the temperatures. They can be used in normal mode, with a power supply, or in
parasitic mode, just a few lines in the program need to be commented/uncommented. The psychrometer is con-
trolled by commands via the serial interface on UART0, connected to a P.C. with the help of a little USB-serial
interface, so a little program on the P.C. is needed as well. I made one using Microsoft Visual Basic Express 2005
which happened to be on my P.C. because of an other project.
|LPC800, with two DS18B20's, fan and USB-serial converter|
The second version uses the same set-up as the first one, however in stead of the table I use the above
formulas. I call it Psychrometer deLuxe+, but using #include <math.h> showed a problem : the program size
was too big for memory ( when using the barometric sensor with its I2C interface and calculations as well ) . . .
So I looked at the internet for some fixed point math and found one which looked promising, reference .
I implemented this one, and as I needed the exp function twice I could not use the 'static inline' and turned
the .h file into two separate .c and .h files. Checking the calculations for different numbers to see if they
agreed with the numbers calculated with the spreadsheet revealed I needed a careful set-up of the different
steps of the calculation. Once done I got results which differed only a few tenths of a percent from the
spreadsheet results. This was acceptable as the function to calculate the Psat,wet and Psat,dry already
is an approach with an error of about max. 0.8 % ( and if NXP would double the amount of program
memory I could use more precise functions, it is funny there is 8K Bootrom and only 4K program memory !).
As the Patm is kept at 101325 Pa the same interface program at the P.C. can be used.
|the P.C. interface|
The above versions all use a fixed number for the air pressure, but we all know it does change . . .
So, to make the psychrometer more precise I needed the air pressure and attached a BMP180 sensor
to the little board. It is using I2C and the SDA and SCL lines are connected to the same pins the
temperature sensors are already connected to. This gave some interesting problems . . .
First I had some problems finding a I2C library, the one I found at mbed, an on-line compiler for LPC
uP's, did not work for me, it looked to be checking and waiting for something that did not happen, so
I used the LPC800 manual and wrote my own I2C read- and write-functions.
The second problem was that once the I2C module was connected to the chosen pins, using the
data from the 'Switch Matrix Tool', it did stay connected and I could no longer use the pins for
the also attached temperature sensors. Here too the manual showed me the reset condition of the
switch matrix and I used this data to disconnect the I2C module from the I/O pins.
So first I set-up the pins for the temperature measurement, resetting the I2C switch, then after the
temperatures are stored I set-up the pins for the barometric pressure measurement using I2C.
It all now works perfectly. However I wish the Switch Matrix Tool will be expanded to disconnecting
the connections from a module to pins as well !
This last version, let's call it Psychrometer SuperdeLuxe ☺, is using nearly all program memory, and
also asks for a revamp of the P.C. program, which can be seen below.
|the P.C. interface, now including barometric pressure|
Like the previous versions you can select a COM port to connect to the Psychrometer,
there is a button to switch on / off the little fan, a button to do one measurement and
a button to do automatic measurements, which are done every 30 seconds.
All you have to do is add some water to the reservoir for the wet sensor every few
days, change the cloth ( use a small piece of cotton for that ) every few months and
buy a bottle of distilled water every few years . . . But then you have an interesting and
unique way of measuring the humidity of air !
It was fun using a 8-pin chip with a 32-bit core, 4K was just enough ( well . . . , at least
when using a fixed-point math ), the switch matrix is a powerful feature, but a few things
could be improved : documentation of the I2C and UART - ROM routines, I tried to use them
as I needed nearly all memory, but I could not get them working, and the switch matrix tool
would be even more useful if it can be used to disconnect modules as well . . .
For those of you who want to see this in action there is PSYCHRO - the MOVIE !
( and click here for Psychro - the pictures)
And finally, I would like to thank element14 and NXP for their LPC800-minikit with the
LPC810 uP, without it this project probably still would be a dream . . .
 http://home.kpn.nl/vanadovv/Meteo.html ( in Dutch ! )
The following files can be downloaded :
Psychrometer_deLuxe ( including Visual Basic Express 2005 and LPCXpresso projects )
Psychrometer_deLuxe_plus ( including Visual Basic Express 2005 and LPCXpresso projects )
Psychrometer_SuperdeLuxe ( including Visual Basic Express 2005 and LPCXpresso projects )
N.B. Using the above material is entirely at your own risk, no support is to be expected as well !
|back to previous page|