SHT15 is based on a capacitive
polymer sensing element.
The bandgap PTAT (Proportional
To Absolute Temperature) temperature sensor component and relative
humidity sensor component are connected to an on-chip 14-bit analog-to-digital converter. Temperature and
humidity data are transferred via the
Sensirion SHT15’s on-chip two-wire
To provide maximum stability, all
of the Sensirion SHT15 sensing and
communications elements are
deposited on a single CMOS chip.
The Sensirion SHT15’s accuracy is
ensured by factory-programmed calibration coefficients, which are used
by the Sensirion SHT15 internally to
calibrate signals from the temperature
and humidity sensor elements when
measurements are made.
Although Photo 2 implies that the
Sensirion SHT15 is an eight-pin device,
it is actually a four-pin device with pins
for power, ground, data (DATA), and
clock (SCK). The Sensirion SHT15 can
operate within a supply voltage range
of 2.4 VDC to 5. 5 VDC. The Sensirion
SHT15’s operation voltage does
not affect the humidity calculations,
but the Sensirion SHT15 supply
voltage is a concern for temperature
The Sensirion SHT15 datasheet
provides temperature measurement
constants for use at various supply
voltage levels. However, 3. 3 VDC was
not in the Sensirion SHT15’s
datasheet temperature constant table.
Since the SHT15’s PTAT temperature
sensor’s output is linear, I simply took
a scientific guess and chose a logical
constant value between the 3.0 VDC
and 3. 5 VDC values listed in the
temperature constant table to use in
my temperature calculations.
The terms two-wire, DATA, and
SCK are synonymous with I2C.
However, the Royal Philips invention is
not used by the Sensirion SHT15. The
Sensirion SHT15 uses a proprietary bit-bang approach to deliver its data.
Fortunately, the Sensirion SHT15
datasheet lays out the bit-bang
sequences in detail and the sensor’s
bit-bang waveforms are easy to formulate in code. The SCK signal is used to
synchronize the data transfers between
the SHT15 and the PIC18LF6722.
Warp speeds at the microcontroller
end are not necessary as the SHT15
has no minimum SCK frequency.
The transfer of data via the
Sensirion SHT15’s DATA line is SCK
level dependent. Data on the SHT15’s
DATA pin changes after the falling
edge of SCK and is valid on the rising
edge of SCK. Data on the SHT15
DATA pin must remain stable while
SCK is high. As the Sensirion SHT15’s
DATA pin is bidirectional, the
PIC18LF6722 only drives the DATA
This is fairly straightforward. We are
simply bit-banging the transmission
start sequence that is depicted graphically at the code’s header. Since I had
no need for speed, I used 1 mS delays.
// generates a transmission start
// _____ ________
// DATA: |_______|
// ___ ___
// SCK : ___| |___| |______
I used the seconds value from the real-time clock to set up the timeout period for the
SHT15 measurement cycle. Don’t worry about the variables you don’t see in this listing. I’ll supply the entire complement of C source code on the Nuts & Volts website.
char sht_measure(unsigned int *p_value, char *p_checksum, char mode)
// takes a measurement (humidity/temperature) with checksum
unsigned int i;
//send command to sensor
timer = secs;
}while(DATA_IN == 1 && secs < timer);
//wait for measurement to complete
//timeout in 2 secs
hi_byte = sht_read_byte(ACK);
lo_byte = sht_read_byte(ACK);
*p_value = make16(hi_byte,lo_byte);
// or timeout (2 sec) is reached
//read the first byte (MSB)
//read the second byte (LSB)