The HTU21D is a new digital humidity sensor with temperature output. Setting new standards in terms of size and intelligence, it is embedded in a reflow solderable Dual Flat No leads (DFN) package with a small 3 x 3 x 0.9 mm footprint. This sensor provides calibrated, linearized signals in digital, I²C format. HTU21D(F) digital humidity sensors are dedicated humidity and temperature plug and play transducers for OEM applications.
The HTU21D driver has been developed to provide easy interface to the sensor through 4 public functions. The driver will return humidity, temperature and serial number and allow software reset of the device. To enjoy the functionality, it is necessary to add the hrd_i2c.c, hrd_i2c.h, drv_i2c.c and drv_i2c.h to your project and include “drv_i2c.h” into your main file. In order to preserve the HTU21 from self-heating, it is recommended to call the measurement functions less than two times per seconds. The driver has initially been written for Microchip dsPIC33 family microcontrollers but could be easily ported to any platform by modifying the hrd_i2c files.