This is an application note for SHTxx humidity and temperature sensors. It provides C code examples for reading humidity or temperature, calculating relative humidity linearization and temperature compensation, accessing status register, calculating dew point temperature, etc.
The document presents an example application note that includes C source code for interfacing the SHTxx humidity and temperature sensor. It covers basic readout, linearization, temperature compensation, status register access, and dew‑point calculation, along with UART handling for data output.
The sample program demonstrates a full measurement cycle: resetting the sensor, acquiring raw humidity and temperature ticks, converting them to physical units, computing compensated humidity and dew point, and printing the results. The code is written for the 80C51 family using the Keil compiler.
| Humidity measurement resolution | 12‑bit |
|---|---|
| Temperature measurement resolution | 14‑bit |
Call the function s_connectionreset(), which sends a reset command to the sensor.
Use the function calc_dewpoint(h, t) which applies the formula shown in the code to compute dew point in °C.
The code targets the 80C51 family of microcontrollers.