Specifications

83
Data can be transmitted across the SDA line only after a “start condition” has
been met. The start condition entails the SDA line going from high to low while
the SCL is high. Once data transmission is complete, a “stop condition” of the
SDA going from low to high while SCL is high. Once the start condition has been
acknowledged, the data bits are set while SCL is low (blue sections) and the data
is transmitted and received while the SCL is high (green sections). An example
of this process is described in Figure 41 below.
Figure 41 Start Conditions for I
2
C protocol (Reprinted with permission from
Sensirion)
The I
2
C protocol begins by sending the start condition from the microcontroller as
mentioned above, followed by a header that is made up of a 7-bit device address
and an SDA directional bit. The directional bit is set up to be a „1‟ for Read and a
„0‟ for write. After the falling edge of the eighth clock cycle, the sensor will
acknowledge the command by pulling the SDA pin low.
The sensor now is ready to accept a command. The commands that the SHT21
accepts are trigger temperature measurement (hold master and no hold master),
trigger relative humidity measurement (hold master and no hold master), and
write user register, read user register, and soft reset. The corresponding codes
for these commands are summarized in Figure 42 below.
Command
Comment
Code
Trigger T measurement
hold master
1110'0011
Trigger RH measurement
hold master
1110'0101
Trigger T measurement
no hold master
1111'0011
Trigger RH measurement
no hold master
1111'0101
Write user register
1110'0110
Read user register
1110'0111
Soft reset
1111'1110
Figure 42 Commands accepted by SHT21 (Reprinted with permission from
Sensirion)
The difference between hold master mode and no hold master mode is as
follows. In hold master mode the clock line is blocked by the sensor while the
measurement is taking place. In no hold master mode the clock line is left open
so that other communication can take place while the sensor is making a
measurement. Whichever mode is chosen, the maximum resolution for either
relative humidity or temperature is 14 bits. This leaves the two LSB‟s to describe
the type of measurement. The most LSB is not assigned to anything, but the
second most LSB describes a temperature reading with a „0‟ and a relative
humidity reading with a „1‟. The soft reset command essentially reboots the