ST Sensor Hume Dad
ST Sensor Hume Dad
Applications
Air conditioning, heating and ventilation
Air humidifier
Refrigerators
Wearable devices
Smart home automation
Industrial automation
+/*$/
[[PP
Description
The HTS221 is an ultra compact sensor for
relative humidity and temperature. It includes a
Features sensing element and a mixed signal ASIC to
0 to 100% relative humidity range provide the measurement information through
digital serial interfaces.
Supply voltage: 1.7 to 3.6 V
Low power consumption: 2 µA @ 1 Hz ODR The sensing element consists of a polymer
dielectric planar capacitor structure capable of
Selectable ODR from 1 Hz to 12.5 Hz detecting relative humidity variations and is
High rH sensitivity: 0.004% rH/LSB manufactured using a dedicated ST process.
Humidity accuracy: ± 4.5% rH, 20 to +80% rH The HTS221 is available in a small top-holed cap
Temperature accuracy: ± 0.5 °C,15 to +40 °C land grid array (HLGA) package guaranteed to
operate over a temperature range from -40 °C to
Embedded 16-bit ADC
+120 °C.
16-bit humidity and temperature output data
SPI and I²C interfaces
Factory calibrated
Tiny 2 x 2 x 0.9 mm package
ECOPACK® compliant
Contents
3 Functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.1 IC interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.2 Factory calibration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4 Application hints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4.1 Soldering information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11
5 Digital interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.1 I²C serial interface (CS = HIGH) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.1.1 I²C operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.2 SPI bus interface (CS = LOW) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.2.1 SPI write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.2.2 SPI read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
6 Register mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
7 Register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
7.1 WHO_AM_I . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
7.2 AV_CONF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
7.3 CTRL_REG1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
7.4 CTRL_REG2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
7.5 CTRL_REG3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
7.6 STATUS_REG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
7.7 HUMIDITY_OUT_L . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
7.8 HUMIDITY_OUT_H . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
7.9 TEMP_OUT_L . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
7.10 TEMP_OUT_H . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
10 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Charge
OpAmp
Op Control I²C
MUX ADC
Amp Logic SPI
Temperature
Sensor
Voltage
Sensor Driver Clock & Timing
Current Bias
GAMS0104141505SG
1 2
5 4
GND
SDA/SDI/SDO
CS (3)
SPC (3)
tsu(S I) th(SI)
SDI/SDO
MSB OUT LSB OUT (3)
GAMS1203141550SG
Note: Measurement points are done at 0.2·VDD and 0.8·VDD, for both ports.
WVX65
WZ6365 67$57
6'$
WVX63 6723
6&/
Measurement points are done at 0.2·VDD and 0.8·VDD, for both ports.
This is a mechanical shock sensitive device, improper handling can cause permanent
damage to the part.
This is an ESD sensitive device, improper handling can cause permanent damage to
the part.
3 Functionality
The HTS221 is a digital humidity and temperature sensor, packaged in an HLGA holed
package.The device includes the sensing element and an IC (integrated circuit) interface
able to take information from the sensing element and provide a digital signal to the external
world, communicating through I²C/SPI interfaces with the host controller.
3.1 IC interface
The complete measurement chain consists of a low-noise capacitive amplifier, which
converts the capacitive imbalance of the humidity sensor into an analog voltage signal, and
an analog-to-digital converter is used to generate the digital information.
The converter is coupled with a dedicated hardware (HW) averaging filter to remove the
high frequency component and reduce the serial interface traffic.
The relative humidity and temperature data can be accessed through an I²C/SPI interface,
making the device particularly suitable for direct interfacing with a microcontroller.
4 Application hints
C1
100 nF
SCL/SPC
GND
VDD
2 1
DRDY TOP
3 VIEV
TOP VIEW 6 CS
4 5
GND
SDA/SDI/SDO
GND
GAMS1203141525SG
The device is supplied through the VDD line. The power supply decoupling capacitor (100 nF
ceramic) should be placed as near as possible to the supply pad of the device (common
design practice).
The functionality of the device and the measured data outputs are selectable and accessible
through the I²C/SPI interfaces.
5 Digital interfaces
The registers embedded in the HTS221 may be accessed through both the I²C and SPI 3-
wires serial interfaces.
The serial interfaces are mapped onto the same pins.To select the I²C interface, the CS line
must be tied high (i.e. connected to VDD) or unconnected (internal pull-up); to select the SPI
interface, the CS line must be tied low (i.e. connected to GND).
There are two signals associated with the I²C bus: the serial clock line (SCL) and the serial
data line (SDA). The latter is a bi-directional line used for sending and receiving the data
to/from the interface. Both lines must be connected to VDD through pull-up resistors.
The I²C interface is compliant with fast mode (400 kHz) I²C standards as well as with normal
mode.
Table 13. Transfer when master is receiving (reading) one byte of data from slave
Master ST SAD + W SUB SR SAD + R NMAK SP
Table 14. Transfer when master is receiving (reading) multiple bytes of data from
slave
Master ST SAD+W SUB SR SAD+R MAK MAK NMAK SP
Data are transmitted in byte format (DATA). Each data transfer contains 8 bits. The number
of bytes transferred per transfer is unlimited. Data is transferred with the most significant bit
(MSB) first. If a receiver can’t receive another complete byte of data until it has performed
some other functions, it can hold the clock line, SCL LOW to force the transmitter into a wait
state. Data transfer only continues when the receiver is ready for another byte and releases
the data line. If a slave receiver does not acknowledge the slave address (i.e. it is not able to
receive because it is performing some real-time function) the data line must be kept HIGH
by the slave. The master can then abort the transfer. A LOW to HIGH transition on the SDA
line while the SCL line is HIGH is defined as a STOP condition. Each data transfer must be
terminated by the generation of a STOP (SP) condition.
In order to read multiple bytes incrementing the register address, it is necessary to assert
the most significant bit of the sub-address field. In other words, SUB(7) must be equal to 1
while SUB(6-0) represents the address of the first register to be read.
In the presented communication format MAK is master acknowledge and NMAK is no
master acknowledge.
I²C high speed HS-mode devices can transfer information at bit rates of up to 3.4 Mbit/s, yet
they remain fully downward compatible with fast or standard-mode (F/S-mode) devices for
bi-directional communication in a mixed-speed bus system. With the exception that
arbitration and clock synchronization is not performed during the HS-mode transfer, the
same serial bus protocol and data format is maintained as with the F/S-mode system.
HS-mode can only begin after the following conditions (all of which are in F/S-mode):
1. START condition (S)
2. 8-bit master code (00001XXX)
3. not-acknowledge bit (A)
This master code has two main functions:
It allows arbitration and synchronization between competing masters at F/S-mode speeds,
resulting in one winning master.
It indicates the beginning of an HS-mode transfer. HS-mode master codes are reserved 8-
bit codes, which are not used for slave addressing or other purposes.
The master code indicates to other devices that an HS-mode transfer is to begin and the
connected devices must meet the HS-mode specification. As no device is allowed to
acknowledge the master code, the master code is followed by a not-acknowledge (A). After
the not-acknowledge bit (A), and the SCLH line has been pulled up to a HIGH level, the
active master switches to HS-mode and enables (at time tH, see data transfer in HS mode)
the current-source pull-up circuit for the SCLH signal. As other devices can delay the serial
transfer before tH by stretching the LOW period of the SCLH signal, the active master will
enable its current-source pull-up circuit when all devices have released the SCLH line and
the SCLH signal has reached a HIGH level, thus speeding up the last part of the rise time of
the SCLH signal. The active master then sends a repeated START condition (Sr) followed
by a 7-bit slave address (or 10-bit slave address; see previous section) with a R/W bit
address, and receives an acknowledge bit (A) from the selected slave.
After a repeated START condition and after each acknowledge bit (A) or not-acknowledge
bit (A), the active master disables its current-source pull-up circuit. This enables other
devices to delay the serial transfer by stretching the LOW period of the SCLH signal. The
active master re-enables its current-source pull-up circuit again when all devices have
released and the SCLH signal reaches a HIGH level, and so speeds up the last part of the
SCLH signal’s rise time. Data transfer continues in HS-mode after the next repeated START
(Sr), and only switches back to F/S-mode after a STOP condition (P). To reduce the
overhead of the master code, it’s possible that a master links a number of HS-mode
transfers, separated by repeated START conditions (Sr).
SPC
SDI/SDO
RW DO7 DO6 DO5 DO4 DO3 DO2 DO1 DO0
MS AD5 AD4 AD3 AD2 AD1 AD0
GAMS1203141530SG
The SPI write command is performed with 16 clock pulses. A multiple byte write command
is performed by adding blocks of 8 clock pulses to the previous one.
bit 0: WRITE bit. The value is 0.
bit 1: MS bit. When 0, does not increment the address; when 1, increments the address in
multiple writes.
bit 2 -7: address AD(5:0). This is the address field of the indexed register.
bit 8-15: data DI(7:0) (write mode). This is the data that will be written inside the device
(MSB first).
bit 16-...: data DI(...-8). Further data in multiple byte writes.
SCL
SDI/SDO
DI7 DI6 DI5 DI4 DI3 DI2 DI1 DI0 DI15 DI14 DI13 DI12 DI11 DI10 DI9 DI8
RW
MS AD5 AD4 AD3 AD2 AD1 AD0
GAMS1203141540SG
CS
SPC
SDI/O
RW DO7 DO6 DO5 DO4 DO3 DO2 DO1 DO0
MS AD5 AD4 AD3 AD2 AD1 AD0
6 Register mapping
The table below provides a list of the 8-bit registers embedded in the device and the related
addresses.
Registers marked as Reserved must not be changed. Writing to those registers may cause
permanent damage to the device.
The content of the CALIB_0..F registers that are loaded at power-on from device internal
non-volatile memory should never be modified.
7 Register description
The device contains a set of registers which are used to control its behavior and to retrieve
humidity and temperature data. The register address, made up of 7 bits, is used to identify
and to read/write the data, through the serial interfaces.
7.1 WHO_AM_I
Device identification
7 6 5 4 3 2 1 0
1 0 1 1 1 1 0 0
7.2 AV_CONF
Humidity and temperature resolution mode
7 6 5 4 3 2 1 0
[7:6] Reserved
[5:3] AVGT2-0: To select the numbers of averaged temperature samples (2 - 256), see Table 16
[2:0] AVGH2-0: To select the numbers of averaged humidity samples (4 - 512), see Table 16
7.3 CTRL_REG1
Control register 1
7 6 5 4 3 2 1 0
PD Reserved BDU ODR1 ODR0
The PD bit is used to turn on the device. The device is in power-down mode when PD = ‘0’
(default value after boot). The device is active when PD is set to ‘1’.
The BDU bit is used to inhibit the output register update between the reading of the upper
and lower register parts. In default mode (BDU = ‘0’), the lower and upper register parts are
updated continuously. If it is not certain whether the read will be faster than output data rate,
it is recommended to set the BDU bit to ‘1’. In this way, after the reading of the lower (upper)
register part, the content of that output register is not updated until the upper (lower) part is
read also.
This feature prevents the reading of LSB and MSB related to different samples.
The ODR1 and ODR0 bits permit changes to the output data rates of humidity and
temperature samples.The default value corresponds to “one shot” configuration for both
humidity and temperature output. ODR1 and ODR0 can be configured as described in
Table 17.
0 0 One shot
0 1 1 Hz 1 Hz
1 0 7 Hz 7 Hz
1 1 12.5 Hz 12.5 Hz
7.4 CTRL_REG2
Control register 2
7 6 5 4 3 2 1 0
BOOT Reserved Heater ONE_SHOT
The BOOT bit is used to refresh the content of the internal registers stored in the Flash
memory block. At device power-up, the content of the Flash memory block is transferred to
the internal registers related to trimming functions to permit good behavior of the device
itself. If, for any reason, the content of the trimming registers is modified, it is sufficient to
use this bit to restore the correct values. When the BOOT bit is set to ‘1’ the content of the
internal Flash is copied inside the corresponding internal registers and is used to calibrate
the device. These values are factory trimmed and are different for every device. They permit
good behavior of the device and normally they should not be changed. At the end of the
boot process, the BOOT bit is set again to ‘0’.
The ONE_SHOT bit is used to start a new conversion. In this situation a single acquisition of
temperature and humidity is started when the ONE_SHOT bit is set to ‘1’. At the end of
conversion the new data are available in the output registers, the STATUS_REG[0] and
STATUS_REG[1] bits are set to ‘1’ and the ONE_SHOT bit comes back to ‘0’ by hardware.
The Heater bit is used to control an internal heating element, that can effectively be used to
speed up the sensor recovery time in case of condensation. The heater can be operated
only by an external controller, which means that it has to be switched on/off directly by FW.
Humidity and temperature output should not be read during the heating cycle; valid data can
be read out once the heater has been turned off, after the completion of the heating
cycle.Typical power consumption related to VDD is described in Table 18.
3.3 33
2.5 22
1.8 12
7.5 CTRL_REG3
Control register 3
7 6 5 4 3 2 1 0
DRDY_H_L PP_OD Reserved DRDY Reserved
The DRDY_EN bit enables the DRDY signal on pin 3. Normally inactive, the DRDY output
signal becomes active on new data available: logical OR of the bits STATUS_REG[1] and
STATUS_REG[0] for humidity and temperature, respectively. The DRDY signal returns
inactive after both HUMIDITY_OUT_H and TEMP_OUT_H registers are read.
7.6 STATUS_REG
Status register
7 6 5 4 3 2 1 0
Reserved H_DA T_DA
[7:2] Reserved
[1] H_DA: Humidity data available.
(0: new data for Humidity is not yet available; 1: new data for Humidity is available)
[0] T_DA: Temperature data available.
(0: new data for temperature is not yet available; 1: new data for temperature is available)
H_DA is set to 1 whenever a new humidity sample is available. H_DA is cleared anytime
HUMIDITY_OUT_H (29h) register is read.
T_DA is set to 1 whenever a new temperature sample is available. T_DA is cleared anytime
TEMP_OUT_H (2Bh) register is read.
7.7 HUMIDITY_OUT_L
Relative humidity data (LSB)
7 6 5 4 3 2 1 0
7.8 HUMIDITY_OUT_H
Relative humidity data (MSB)
15 14 13 12 11 10 9 8
Address: 29h(R)
Description: Humidity data are expressed as HUMIDITY_OUT_H & HUMIDITY_OUT_L in 2’s
complement. Values exceeding the operating humidity range (see Table 3) must be
clipped by SW.
7.9 TEMP_OUT_L
Temperature data (LSB)
7 6 5 4 3 2 1 0
7.10 TEMP_OUT_H
Temperature data (MSB)
15 14 13 12 11 10 9 8
The Registers in 30h..3Fh address range contain calibration coefficients. Every sensor
module has individual coefficients. Before the first calculation of temperature and humidity,
the master reads out the calibration coefficients.
Output Registers
28 H7 H6 H5 H4 H3 H2 H1 H0
H_OUT (s16)
29 H15 H14 H13 H12 H11 H10 H9 H8
2A T7 T6 T5 T4 T3 T2 T1 T0
T_OUT (s16)
2B T15 T14 T13 T12 T11 T10 T9 T8
Calibration Registers
30 H0_rH_x2 (u8) H0.7 H0.6 H0.5 H0.4 H0.3 H0.2 H0.1 H0.1
31 H1_rH_x2 (u8) H1.7 H1.6 H1.5 H1.4 H1.3 H1.2 H1.1 H1.0
32 T0_degC_x8 (u8) T0.7 T0.6 T0.5 T0.4 T0.3 T0.2 T0.1 T0.0
33 T1_degC_x8 (u8) T1.7 T1.6 T1.5 T1.4 T1.3 T1.2 T1.1 T1.0
34 Reserved (u16)
35 T1/T0 msb (u2),(u2) 0 0 0 0 T1.9 T1.8 T0.9 T0.8
36 7 6 5 4 3 2 1 0
H0_T0_OUT (s16)
37 15 14 13 12 11 10 9 8
38 7 6 5 4 3 2 1 0
Reserved
39 15 14 13 12 11 10 9 8
3A 7 6 5 4 3 2 1 0
H1_T0_OUT (s16)
3B 15 14 13 12 11 10 9 8
3C 7 6 5 4 3 2 1 0
T0_OUT (s16)
3D 15 14 13 12 11 10 9 8
3E 7 6 5 4 3 2 1 0
T1_OUT (s16)
3F 15 14 13 12 11 10 9 8
(u8) is the unsigned 8 bit quantity, and (s16) the signed 16 bit quantity using 2’s complement
format. In the example below, the two steps required to calculate temperature and relative
humidity output values are described. The T0 and T1 calibration temperature values are
actually composed of 10 bits (unsigned), where the 2 MSB are in reg 35h, and the 8 LSB are
in regs 32h and 33h, respectively. T0 and T1 are the actual calibration temperature values
multiplied by 8.
&
7B'HJ&FDO
7B'HJ& PHDV
7B'HJ&FDO
/6%$'&
7B287FDO
7B287FDO
7B287PHDV
+ B 5 + FD O
+ B 5 + P H D V
+ B 5 + FD O
/ 6 % $ ' &
+ B 7 B 2 8 7FDO
+ B 7 B 2 8 7FDO
+ B 7B 2 8 7PHDV
BOTTOM VIEW
H
W
Pin 1 indicator
TOP VIEW
L
POA_8487220_A
10 Revision history
Information in this document is provided solely in connection with ST products. STMicroelectronics NV and its subsidiaries (“ST”) reserve the
right to make changes, corrections, modifications or improvements, to this document, and the products and services described herein at any
time, without notice.
All ST products are sold pursuant to ST’s terms and conditions of sale.
Purchasers are solely responsible for the choice, selection and use of the ST products and services described herein, and ST assumes no
liability whatsoever relating to the choice, selection or use of the ST products and services described herein.
No license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted under this document. If any part of this
document refers to any third party products or services it shall not be deemed a license grant by ST for the use of such third party products
or services, or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of such
third party products or services or any intellectual property contained therein.
UNLESS OTHERWISE SET FORTH IN ST’S TERMS AND CONDITIONS OF SALE ST DISCLAIMS ANY EXPRESS OR IMPLIED
WARRANTY WITH RESPECT TO THE USE AND/OR SALE OF ST PRODUCTS INCLUDING WITHOUT LIMITATION IMPLIED
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE (AND THEIR EQUIVALENTS UNDER THE LAWS
OF ANY JURISDICTION), OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT.
ST PRODUCTS ARE NOT DESIGNED OR AUTHORIZED FOR USE IN: (A) SAFETY CRITICAL APPLICATIONS SUCH AS LIFE
SUPPORTING, ACTIVE IMPLANTED DEVICES OR SYSTEMS WITH PRODUCT FUNCTIONAL SAFETY REQUIREMENTS; (B)
AERONAUTIC APPLICATIONS; (C) AUTOMOTIVE APPLICATIONS OR ENVIRONMENTS, AND/OR (D) AEROSPACE APPLICATIONS
OR ENVIRONMENTS. WHERE ST PRODUCTS ARE NOT DESIGNED FOR SUCH USE, THE PURCHASER SHALL USE PRODUCTS AT
PURCHASER’S SOLE RISK, EVEN IF ST HAS BEEN INFORMED IN WRITING OF SUCH USAGE, UNLESS A PRODUCT IS
EXPRESSLY DESIGNATED BY ST AS BEING INTENDED FOR “AUTOMOTIVE, AUTOMOTIVE SAFETY OR MEDICAL” INDUSTRY
DOMAINS ACCORDING TO ST PRODUCT DESIGN SPECIFICATIONS. PRODUCTS FORMALLY ESCC, QML OR JAN QUALIFIED ARE
DEEMED SUITABLE FOR USE IN AEROSPACE BY THE CORRESPONDING GOVERNMENTAL AGENCY.
Resale of ST products with provisions different from the statements and/or technical features set forth in this document shall immediately void
any warranty granted by ST for the ST product or service described herein and shall not create or extend in any manner whatsoever, any
liability of ST.
ST and the ST logo are trademarks or registered trademarks of ST in various countries.
Information in this document supersedes and replaces all information previously supplied.
The ST logo is a registered trademark of STMicroelectronics. All other names are the property of their respective owners.