Measuring Relative Humdity with a Honeywell HIH-3605

copyright, Peter H Anderson and Nakia Collins, Baltimore, MD, Nov, '01

Introduction.

This work was performed by Nakia Collins as a part of her Senior Design Project at Morgan State University.

The discussion deals with measuring relative humidity using a Honeywell HIH-3605-A RH to Voltage sensor. The HIH-3605 is simply a three terminal device with power +5 VDC (V_ref), GRD and the output which provides a voltage which is proportional to the relative humidity. Thus, measuring relative humidity is simply a matter of performing an A/D conversion and then calculating the RH. A minor correction for temperature might also be performed.

Routines are presented to interface with a BasicX BX24. These routines may be adapted to a PIC or similar processor having an A/D converter and the ability to perform floating point arithmetic. This application vividly illustrates the superiority of the BX24 over the Parallax Basic Stamp which has neither capability.

The discussion also compares this method of directly interfacng a remote HIH-3605 with an A/D converter using twisted pairs with an approach used by Dallas in their 1-W Weather Station which appears to have been discontinued.

As of this writing, I have a supply of HIH-3605A which are three terminal SIPs, quite easy for experimenters to work with. They are \$25.00 plus shipping.

Data Sheet (.pdf format, 300K).

Note that with the HIH-3605 positioned such that the sensing element is facing toward you, from left to right, the terminals are GRD, OUT, +5VDC.

Detailed Discussion.

The output of the HIH-3605 varies with the relative humidity;

(1)	RH = (V_out / V_ref - 0.16) / 0.0062
The output of the HIH-3605 might be measured using a 10-bit A/D;
(2)	V_out = adval / 1024 * V_ref
Where V_ref is the nominal +5.0 VDC supply which powers both the A/D and the HIH-3605.

Substituting (2) into (1) and doing a bit of algebra;

(3)	RH = 0.157 * adval - 25.80
where adval is the A/D measurement which is in the range of 0 to 1023.

For an 8-bit A/D this is;

(3a) RH = 0.628 * adval - 25.80
where adval is in the range of 0 to 255.

For an 12-bit A/D, the expression is;

(3b) RH = 0.03925 * adval - 25.80
where adval is in the range of 0 to 4095.

Program HIH3605_1.BAS.

This program continually measures the A/D value of the humidity sensor and displays the calculated RH on the terminal using the Debug.Print command.

Note that I desired to display the relative humidity with one digit after the decimal point and used Sub SplitSingle to split the quantitiy into a whole part (WP) and a fractional part (FP) and then used the Debug.Print command to output the WP, followed by a decimal point, followed by the fractional part. In doing this, I discovered that the use of CInt to cast a single to an integer statistically rounds the Single while FixI truncates the single.

' Program HIH3605_1.Bas
'
' Continually measures output of an HIH-3605 and calculates and displays the
' relative humidity.
'
' HIH3605									BX24
'
'  GRD - Term 1
'  OUT - Term 2 ------------------------ Term 13
'  +5 VDC - Term 3
'
' copyright, Peter H Anderson, Baltimore, MD, Nov, '01

Sub Main()

Dim ADVal as Integer, WholePart as Integer, FractPart as Integer
Dim RH as Single

Call Sleep(1.0)

Do
RH = 0.157 * CSng(ADVal) - 25.80
Call SplitSingle(RH, WholePart, FractPart)
Debug.Print CStr(WholePart); "."; CStr(FractPart)
Call Sleep(5.0)
Loop

End Sub

Sub SplitSingle(ByVal Q as Single, ByRef WP as Integer, ByRef FP as Integer)
' for postive numbers only

Dim FP_float as Single
WP = FixI(Q)						' truncate Q using FixI
FP_float = Q - CSng(WP)			' calculate the fractional part
FP = CInt(FP_float * 10.0)		' multiply by 10 and typecast to Int.
If (FP = 10) Then				' this would occur for values such as 23.97
FP = 0
WP = WP + 1
End If

End Sub

Program HIH3605_2.Bas.

This program differs from the above only in that 100 A/D measurements are performed and the average is used to calculate the relative humidity. This avoids the RH hopping around one or two percentage points.

' Program HIH3605_2.Bas
'
' Continually measures output of an HIH-3605 and calculates and displays the
' relative humidity.
'
' Differs from program HIH3605_1.Bas in that multiple A/D readings are performed
' and the average value is used.
'
' HIH3605								BX24
'
'  GRD - Term 1
'  OUT - Term 2 ------------------------ 13
'  +5 VDC - Term 3
'
' copyright, Peter H Anderson, Baltimore, MD, Nov, '01

Sub Main()

Dim WholePart as Integer, FractPart as Integer
Dim RH as Single, ADValAvg as Single

Call Sleep(1.0)

Do
RH = 0.157 * ADValAvg - 25.80
Call SplitSingle(RH, WholePart, FractPart)
Debug.Print CStr(WholePart); "."; CStr(FractPart)
Call Sleep(5.0)
Loop

End Sub

Function MultADC(ByVal Pin as Byte, ByVal NumSamps as Integer) as Single

Dim Sum as Single
Dim N as Integer

Sum = 0.0

For N = 1 to NumSamps
Next

End Function

Sub SplitSingle(ByVal Q as Single, ByRef WP as Integer, ByRef FP as Integer)

Dim FP_float as Single
WP = FixI(Q)				' truncate Q
FP_float = Q - CSng(WP)
FP = CInt(FP_float * 10.0)		' CInt used as it rounds
If (FP = 10) Then
FP = 0
WP = WP + 1
End If

End Sub

Program HIH3605_3.Bas.

The relative humidity might be corrected for temperature using the expression;

(4) RH_corrected = RH * 1.0 / (1.0546 - 0.00216 * TC)
where TC is the temperature in degrees C.

or

(5) RH_corrected = RH * 1/(1.093 - 0.0012 * TF)
where TF is the temperature in degrees F.

Note that this amounts to a zero percent correction at 25 degrees C, a -6.0 percent correction at 0 degrees C and a +6.0 percent correction at 50 degrees C. Note that this is six percent of the reading. For example, an uncorrected RH of 50 percent at 50 degrees C is corrected by six percent to 53 percent RH.

In fact, this is quite small and in many situations, one might dispense with the correction altogether. For example, in a home, the temperature is probably in the range of 20 to 30 degrees C and the correction is but a bit over one percent. In a weather station application, for an outdoor temperature of freezing, the uncorrected reading is six percent high. But, if the uncorrected RH reading is 16 percent, does one really care that this is six percent high and the corrected RH is 15 percent.

However, measring temperature using a negative temperature coefficieent (NTC) thermistor costs less than a dollar and in many applications, you proably want to know the temperature as well.

In program HIH3605_3.Bas, the uncorrected RH is calculated based on 100 A/D measurements on terminal 13, the temperature is calculated based on 100 A/D measurements on terminal 14.

' Program HIH3605_3.Bas
'
' Continually measures output of an HIH-3605 and calculates and displays the
' relative humidity.
'
' Differs from program HIH3605_2.Bas in that a temperature measurement is also
' performed and the value of RH is corrected.  Note that an NTC thermistor is
' used for measuring temperature.
'
' HIH3605
'
'  GRD - Term 1
'  OUT - Term 2 ------------------------ BX24, Term 13
'  +5 VDC - Term 3
'
'
'
'        +5 VDC
'	   	   |
'          10K
'	       |------------------- BX24 Term 14
'          |
'          10K NTC Thermistor
'          |
'         GRD
'
' copyright, Peter H Anderson, Baltimore, MD, Nov, '01

Const A_THERMISTOR as Single = 0.000623	' Thermistor two-point model used to calculate Temperature
Const B_THERMISTOR as single = 0.000297

Sub Main()

Dim WholePart as Integer, FractPart as Integer
Dim RH as Single, TC as Single, RHCorrected as Single

Call Sleep(1.0)

Do
RH = MeasRH(13)
TC = MeasTemperature(14)
RHCorrected = RH/(1.0546 - 0.00216 * TC)

Debug.Print CStr(CInt(RHCorrected)); "  "; CStr(CInt(TC))

Call Sleep(5.0)
Loop

End Sub

Function MeasRH(ByVal Pin as Byte) as Single

Dim ADValAvg as Single, RH as Single

RH = 0.157 * ADValAvg - 25.80
MeasRH = RH

End Function

Function MeasTemperature(ByVal Pin as Byte) as Single

Dim ADValAvg as Single, Rtherm as Single, TK as Single, TC as Single

Rtherm = 10000.0/(1024.0/ADValAvg-1.0)		' Calculate thermistor R
TK = 1.0/(A_THERMISTOR + B_THERMISTOR *log(Rtherm))	' T_Kelvin
TC = TK-273.15					' T_Celcius
MeasTemperature = TC

End Function

Function MultADC(ByVal Pin as Byte, ByVal NumSamps as Integer) as Single

Dim Sum as Single
Dim N as Integer

Sum = 0.0

For N = 1 to NumSamps
Next

End Function

Sub SplitSingle(ByVal Q as Single, ByRef WP as Integer, ByRef FP as Integer)

' for positive numbers only
Dim FP_float as Single
WP = FixI(Q)						' truncate Q
FP_float = Q - CSng(WP)
FP = CInt(FP_float * 10.0)		' CInt used as it rounds
If (FP = 10) Then
FP = 0
WP = WP + 1
End If

End Sub

Wiring Considerations.

In some cases one may be interested in measuring the relative humidity several hundred feet from the BX24, perhaps in a silo, a green house or outdoors,

Note that output of the HIH-3605 ranges from near 0.2 VDC for zero percent RH to near 3.0 VDC for 100 percent RH. Thus, each perecentage RH corresponds to a signal change of nominally 30 mV which is quite large when compared with thermocouples where temperature changes cause voltage changes in the uV range. My point is that it really is not necessary to locate a remote A/D near the remote sensor, but rather to simply use twisted pair cable to run the IH-3605 analog output to the processor over a distance of several hundred feet.

My suggestion is to run two twisted pairs as illustrated below.

+5VDC --------------------------------------- HIH-3605, Term 3
0.1 uFd				0.1 uFd
GRD ----------------------------------------- HIH-3605, Term 1

BX24 ADC Term 13 ---------------------------- HIH-3605, Term 2
100K 0.1 uFd   0.1 uFd
GRD ----------------------------------------- No Connection
The advantage of twisted pair is that a changing field by a noise source will induce a current flow in one twist, but induce an opposite current flow in the next twist. Twisted pair cable has been used by the telephone company for over a century where the talk power is in tens of mV. Note that the GRD associated with the output of the HIH-3605 is not connected at the distant end to avoid a ground loop.

Noise might be further reduced using 0.1 uFd ceramic capacitors and by terminating the output of the 3605 with a 100K resistor near the input to the A/D.

If the temperature is also to be measured at the remote location, a third twisted pair might be used;

+5 VDC
|
10K
|
|
------------------------------------------
0.1 uFd						0.1 uFd   10K NTC Thermistor
GRD --------------------------------------

Although three pairs may seem a bit of a burden, CAT 5 cable which provides four pairs is relatively inexpensive.

Comparison with the Dallas DSHS01K Humidity Kit

Over the past few years Dallas has developed a weather package using the Dallas 1-W protocol. I was never too sure there was all that much money for Dallas in hobbyist weather kits. Dallas has been purchased by Maxim and perhaps high management came to the same conclusion. It appears this effort is now little to none and most of the designs are now sold by Texas Weather. The prices are a bit beyond the reach of most hobbyists; \$200 for the RH add-on.

As a part of the development, Dallas developed a humidity kit which consisted of a 0.6 diameter inch circular PCB with a HIH-3610 (similar to the 3605) and a DS2438 battery mangement IC. Using the Dallas 1-W interface one could read the value of the supply voltage V_ref, the value of the output of the HIH-3610 and the temperature and thus determine the RH plus the temperature at the remote unit. The unit included diodes and capacitors such that, in theory, the unit could be run in the parasitic power mode where the unit was powered from the signal lead.

This unit was available from the Dallas i-button Store at \$20.00 and at that price, it was a good buy and I developed sample BX24 routines and also resold the Humidity Kit.

However, as of this writing, it appears the DSHS01K RH Kit is no longer available and my general feeling is that although the design was clever, it is not worth the effort of duplicating. One is confronted with acquiring a DS2435 and mounting this surface mount device along with two diodes, capacitors and the HIH-3610 RH sensor.

This is quite an expense and a good deal of effort, and unless one is absolutely locked into using the Dallas 1-W interface, what's the point.

The design was also a bit flawed in that in attempting to power the HI-3610 from the signal lead, the idle voltage on the signal lead dropped a full volt. Thus, by adding this package to an existing 1-W network, the idle voltage dropped such that the operation of other devices on the network was marginal.

The approach offered in this discussion directly interfaces the output of an HIH-3605 with an A/D on a processor such as a BX24 or Microchip PIC. It does use two or three pairs, but it is straight forward and relatively inexpensive.