Generic C driver for the HTU2xD(F) sensor
The HTU2xD(F) sensor is a self-contained humidity and temperature sensor that is fully calibrated during manufacturing. The sensor can operate from 1.5V to 3.6V, has selectable resolution, low battery detection, and checksum capability. The HTU21D has a low current stand-by mode for power-sensitive applications.
- Measures relative humidity from 0% to 100%
- Measures temperature from -40°C to 125°C
- Humidity resolution selectable from 8 to 12 bits
- Temperature resolution selectable from 11 to 14 bits
- 0.14 µA sleep current
- 500 µA operating current (during measurement only)
- ±3% accuracy
- Connection test
- Reset
- Select I2C master mode
- Aquisition resolution management
- Built-in heater management
- Check battery status
- Read serial number
- Temperature and Humidty measurement
- Calculate compensated humidity
- Calculate dew point
NB: This driver is intended to provide an implementation example of the sensor communication protocol, in order to be usable you have to implement a proper I2C layer for your target platform.