Electronics Projects

Using Temperature/Humidity Sensor Si7005

Many temperature/humidity meter projects published on the Internet are based on digital sensors. Such sensors provide high accuracy and repeatability of measurements and, as a rule, do not require any calibration. One of popular sensors that one can find in many constructions is Sensirion SHT-15 or SHT-21. These sensors work very good, however, are too expensive. Fortunately, they have less expensive alternatives, such as HIH-6130, which are available for about half of price for SHT-15. However, they have narrower working temperature range (-25 - 85°C vs. -40 - 125°C), but on the other hand have a wider range of power voltages (2.3 - 5.5V vs. 2.1 - 3.6V).

In late October of 2012 Silicon Laboratories contributed to this story with their new sensor Si7005 with digital I2C interface. The price of Si7005 is about 1/3 of the one for SHT-15. They can be powered from 2.1 - 3.6V and are manufactured in two modifications: for positive temperatures 0 - 70°C (models with suffix FM) and industrial temperature range -40 - 85°C (models with suffix GM). Furthermore, both types of models come with a filter installed (suffix FM1) or without (suffix GM1). The filter protects the sensing element from dust and moisture condensation. All sensor models are packaged into QFN24 4x4mm packages.

Sensor Schematic

The sensors are equipped with a heater that can increase the internal sensor room temperature on up to 5°C. Just 9 pins are used out of 24 pins of the package, the package exposed pad does not have to be grounded. During the data conversion the sensor consumes only 240 - 320 μA and it takes just 10 msec for the sensor to be ready for use after powering it up. The sensor has no sleep mode and for low-power applications it is recommended to power it off for the time of inactivity. It is important to note that the CS pin of the sensor must be pulled up during the communication with other slave devices on the same I2C bus. Otherwise, it holds the SDA line low making further usage of the bus impossible. In my test circuit the sensor was the only I2C slave on the bus, so I just grounded its CS pin. The sensor measurements are displayed on a 16-segment LCD controlled by CP2401 driver.

Measuring temperature Measuring humidity

Processing sensor's temperature data is pretty straightforward. However, processing the raw humidity data takes a little more work compared to SHT-21 or HIH-6130 sensors and reminds one for SHT-15. First, one should linearize the raw sensor data RH according to the equation

RHlin = RH + 0.00393·RH2 - 0.4008·RH + 4.7844

The next step is thermo-compensate the linearized data as follows:

RHt = RHlin + (T - 30)· (RHlin·0.00237 + 0.1973)

Here T is the ambient temperature in °C. Such data processing is really needed, since otherwise the obtained humidity values will be higher than in reality. The next graphs show the raw sensor data (red line), the linearized one (green curve), and linearized and thermo-compensated one for T = 20°C.

To avoid dealing with fractions in firmware one can multiply both above formulas by 105. One has

RHlin·105 = RH + 393·RH2 - 40080·RH + 478440
RHt·105 = (RHlin·105) + (T - 30)· ((RHlin·105)·0.00237 + 19730)

To obtain the humidity value as an integer number one should extract two higher-order decimal digits from RHt·105. To compute the product of RHlin·105 with 0.00237 one can multiply the (integer) RHlin·105 value by 39762. In the obtained result the lower-order 24 bits are fractional ones. Without a significant loss of accuracy one can discard 16 lower-order bits of the product, then multiply the resulting value by (T - 30) and discard 8 lower-order bits of result. The number 39762 was obtained by taking into account that 0.00237 = 0.9B52 in hex and 0x9B52 = 39762. Effective multiplication is provided by using a microcontroller with a built-in 32x32-bit hardware multiplier.

The difference between the sensor humidity values and the one provided by SHT-15 did not exceed ±2%, which is in the sensor's accuracy range.


Last modified:Mon, Jan 23, 2023.

02463