A look at a very accurate, out of the ordinary, and less-known type of sensor that could improve environmental interface projects like weather stations.
In Issue 58, we presented a humidity-based fan controller. We opted for a combined humidity and temperature digital sensor in that build, mainly as an expedient: It did the job asked of it, but only just. In the course of the development phase for this controller, we looked at dedicated humidity sensors which are more accurate and have a better range of operation, both in humidity and temperature (which is still a limiting factor even though the devices do not measure it). We even bought some of one, the HS1101LF from TE Connectivity.
While we didn't use it because of other design considerations, the sensor itself is definitely worth exploring. There is not enough information to fill a Classroom article, so here it is presented as a What The Tech.
The basic premise is a capacitor, the value of which changes according to the relative humidity at the face of the sensor. This change is precise and defined, and the capacitor value has a tight tolerance as well. The result is that, with a suitable oscillator, a frequency can be obtained which is closely calibrated to the ambient relative humidity.
It is worth recapping the explanation we gave in our humidity fan controller project of what humidity actually is. There are two main ways of measuring the amount of moisture in a given body of air. Air can hold a certain amount of moisture, and that amount changes with temperature. It also changes with composition, such as if the atmosphere is rich in carbon dioxide or heavily nitrogenated, or in some other way is not pure air. For pure air, the amount of moisture held in the air is absolute humidity. It can be expressed as an amount of water in a given volume of air (grams per cubic metre, g/m3) or as a ratio between the mass of water compared to the mass of completely dry air as though the water and air have been fully separated. This is usually expressed in grams per kilogram (g/kg).
Relative humidity is the amount of moisture in the air, as a percentage of how much moisture the air could hold at a given temperature and pressure. It is never an absolute unit of measurement like the gram or millilitre, but rather always expressed as a percentage or related concept (we have seen it written as a ratio). So, a relative humidity of 50% means the air has half of the moisture that it could hold under those conditions.
There is also Specific Humidity, but this is the ratio of the mass of the moisture to the total mass of the air mass, including the water in it. This can be confused with absolute humidity sometimes, but absolute humidity relates the mass of moisture to the mass of the separated dry air. That is why specific humidity is expressed as a ratio, and not a unit measurement. It has scientific uses and most people will never encounter its use.
Most relative humidity data, and indeed every sensor we have seen, assumes natural atmospheric pressure conditions. The pressure at which an air mass is under alters how much moisture it can hold even if temperature remains the same (which a gas never does when it is pressurised positively or negatively with no other factors or inputs like active heating or cooling). Therefore, these sensors would not be suitable for monitoring the moisture content inside an air compressor receiver, for example.
The sensor is packaged with two gold-plated metal leads and a black plastic round housing with airflow slots moulded in. The sensitive parts are protected inside. There is a tab on the base of the case to indicate polarity, and the case base forms one side of the capacitor (or at least is connected to it, the datasheet and physical construction do not make it clear). This should always be connected to ground, which indicates that the tab is the positive side. Underneath, this pin is isolated from the case base by visible insulating material.
The capacitance of the device is designed to vary in a very precise manner, which means it can be used to create an oscillator whose frequency is related to the ambient relative humidity.
This is not the only way to use the device, but it is the most practical. If you are feeling advanced, and in the mood for some engineering, there are other options. The capacitor could be used in a small charge pump circuit, the voltage of which would vary depending on the capacitance caused by the ambient humidity. It could also be used with constant current charging, and the time constant measured.
There is also a block diagram in the datasheet for a proportional voltage output using a reference oscillator and an oscillator using the sensor capacitor. These are fed to an error, then a low pass filter, and finally a gain stage. The error amplifier in this case would need to be a reasonably sophisticated circuit, as it would need to compare the length of the pulses from the oscillators, or convert the frequency to voltage before comparing.
Either way, for most makers, this is a curiosity but harder to implement than the oscillator on its own. To this end, the datasheet only contains the schematic for the frequency output circuit.
In practical terms, the HS1101LF would be used with a local circuit at the sensor to generate a frequency which would then be interpreted by a microcontroller. While the charge pump or frequency to voltage converter ideas would yield the ability to use the sensor with purely analog circuits like a comparator, the added complexity over a microcontroller is unlikely to be helpful unless you have a reason to avoid a microcontroller. Perhaps, coding is not your strength but you are experienced with analog circuit design.
ADVANTAGES AND DISADVANTAGES
Compared to a combined, digital sensor like the common DHT11, the HS1101LF gives half the functionality (humidity only, lacking temperature), and needs to have specific code written to use it while most modules made with DHT11s have pre-written libraries. However, it is more accurate, and has a far better operating range. The DHT11, for example, senses between 20% and 80% relative humidity, and has an upper temperature limit of 60°C for both measurement and operation. That makes it not the best choice for a roof space, for example. In comparison, the HS1101LF can sense humidity at 0% to 100%, can withstand condensation longer and recover quicker from it, and has a huge operating temperature range of -60°C to 140°C.
In addition, the DHT11 is optimised for Arduino, and needs coding adaptation to work with other platforms. Meanwhile, the frequency output of the HS1101LF and its accompanying circuit are somewhat universal, as reading the frequency of a digital input is a standard operation within each microcontroller's language and development environment, regardless of the frequency's source. For example, you could find a block of code for your microcontroller that is meant to read a tachometer, and scale the information to represent humidity based on the frequency to humidity table in the datasheet.
-60 to 140
161.6 to 193.1
5 to 300
The build comes courtesy of the TE Connectivity datasheet, with a couple of modifications. Some very precise, uncommon resistor values are used in the circuit. One is a 49.9kΩ 1%, while another is a 499kΩ 0.5%. That's no problem for an engineer or commercial environment, but not great for many makers. As such, we've swapped them for potentiometers so that the right values can be obtained. One resistor in the circuit always was a potentiometer. We have used 25-turn top-adjust trimpots for this, for the best precision we can reasonably achieve.
The datasheet specifies a CMOS 555, for its precision and crisp output transitions. We have used an Intersil-branded 7555 (or at least, it's stamped as such) for this job. The precise chip and low-tolerance, specific-value components are intended to preserve the accuracy of the device. If the circuit is built accurately enough, no further calibration is necessary as can be seen from the frequency to humidity conversion table. Besides these precise components, the circuit is a standard 555 astable multivibrator. Note that C1 and C2 are power rail filter capacitors and do not take part in timing, nor does the standard 100nF pin 5 decoupling capacitor, C3.
The circuit is built on our favourite prototyping board, a solder breadboard. This allows us to transfer functioning designs very easily from a solderless development board straight to a soldered version. The sensor is mounted on the board rather than on a cable. The datasheets are very specific in pointing out that in longer runs, capacitance between conductors or around the board can affect the accuracy of the device. The manufacturer says three metres (actually, they say ten feet) but the shorter the distance between sensor and circuit, the better.
In selecting components, note that R2 has a tuned value of 49.9kΩ. With the tolerance of most trimpots on the retail market, a 50kΩ trimpot may not get to 49.9kΩ. The 25-turn variety tends to be better, but the tolerance still does not guarantee it. Rather than buy ones that do have a better tolerance, which come from commercial suppliers and are very expensive, just measure a few across the outer pins with a multimeter before you buy them. For example, our two on-hand units were 48.26kΩ and 51.38kΩ. The same principle may go for the 499kΩ R3, however, the range we bought from did not include a 500kΩ value and therefore a 1MΩ was used.
|1 x Solder Breadboard*
|1 x Packet Breadboard Wire Links
|1 x 1kΩ Resistor
|2 x 50kΩ 25-Turn Trimpots
|1 x 1MΩ 25-Turn Trimpots
|1 x 2.2nF MKT Capacitor
|1 x 10nF MKT Capacitor
|1 x 100nF MKT Capacitor
|1 x 7555 CMOS Timer IC
|1 x HS1101LF Humidity Sensor
|1 x 8-Pin IC Socket
We purchased our from Element14 HPP801A031
It could be argued that the two trimpots in series between pins 7 and 6 could be replaced by one trimpot, but we stuck with the original design save for using trimpots instead of the hard-to-find precise resistors.
Assembly is so simple, that we don't feel that steps are necessary. It is worth noting, however, that there is a small amount of heat shrink on the legs of the sensor. These help prevent any conductivity between the legs of the sensor, from a very humid environment, as some moist air contains conductive evaporites depending on the air source. Also notice the small wire links which bridge the wiper and one terminal of the trimpots: They are hard to see on either the board or Fritzing.
The photograph contains a mistake. On the lower half of the board, the short uninsulated wire link bridging the wiper and one terminal of R4 is too far up its row. It should be in line with the green insulated wire link.
The trimpots should be adjusted before installing on the board, with the exception of R4. Even the capacitor connected to ground from the resistors may be enough of a current path for false readings if the trimpots are measured in circuit.
After calibration, you should have a sensor outputting a frequency that tightly correlates to Relative Humidity.
Calibration is fairly simple, but requires either an oscilloscope, frequency counter, or a multimeter with an accurate frequency function. Some cheaper multimeters have a frequency function but do not guarantee its accuracy. Also needed is a way to measure capacitance. In practical terms, this would be a multimeter or LCR meter. The other methods we discussed in The Classroom from Issue 45 do not suit this situation because speed is the key, as ambient conditions can change quickly. Additionally, we don't want to remove the capacitive sensor from the board.
Using the response lookup tables from the datasheet, first measure the capacitance of the sensor across the legs, and use it to determine the ambient humidity at that time. Then, see what frequency should be output for the same humidity in the frequency response lookup table, and alter R4 until that frequency is achieved.